GithubHelp home page GithubHelp logo

iomoath / redwardenlite Goto Github PK

View Code? Open in Web Editor NEW
42.0 2.0 9.0 134 KB

A lightweight HTTP/HTTPS reverse proxy for efficient, policy-based traffic filtering and redirection.

License: GNU General Public License v3.0

Python 100.00%

redwardenlite's Introduction

RedWarden Lite - A lightweight HTTP/HTTPS reverse proxy for efficient, policy-based traffic filtering and redirection.

This project is a modified version of the original project RedWarden

Unlike the original RedWarden project, which is designed to work with specific apps and policies, RedWarden Lite is a universal HTTP/HTTPS proxy filter and redirector. This means you can deploy it to inspect, proxy, drop, or redirect traffic based on policies specified in the YAML config file.

Several tests were made against traffic originating from different web browsers and both desktop and web applications.

Process

Core Features

  • Listening on multiple ports: HTTP, HTTPS, or custom ports
  • SSL inspection
  • Support for proxying multiple URLs (final-allowed destinations)
  • Flexible options to take action when a request does not comply with proxy policies: Reset, Redirect, Proxy
  • Redirecting traffic that does not comply with rules to one or multiple URLs (random selection)
  • Protection against replay attacks
  • Whitelisting specific IP addresses to pass without policy checks
  • Auto-whitelisting peers after X number of successful policy checks
  • Banning IPs based on specific keywords in headers, such as curl in the user-agent
  • Verifying peer IP using third-party IP information providers such as ipgeolocation.io and ip-api.com

Policies

policy:
  # [IP: ALLOW, reason:0] Request conforms ProxyPass entry (url="..." host="..."). Passing request to specified host
  allow_proxy_pass: True
  # [IP: ALLOW, reason:2] Peer's IP was added dynamically to a whitelist based on a number of allowed requests
  allow_dynamic_peer_whitelisting: True
  # [IP: DROP, reason:2] HTTP header name contained banned word
  drop_http_banned_header_names: True
  # [IP: DROP, reason:3] HTTP header value contained banned word:
  drop_http_banned_header_value: True
  # [IP: DROP, reason:4b] peer's reverse-IP lookup contained banned word
  drop_dangerous_ip_reverse_lookup: True
  # [IP: DROP, reason:4e] Peer's IP geolocation metadata contained banned keyword! Peer banned in generic fashion.
  drop_ipgeo_metadata_containing_banned_keywords: True
  # [IP: DROP, reason:5] HTTP request did not contain expected header
  drop_request_without_expected_header: False
  # [IP: DROP, reason:6] HTTP request did not contain expected header value:
  drop_request_without_expected_header_value: False
  # [IP: DROP, reason:7] Unexpected HTTP method:
  drop_request_without_expected_http_method: True
  # [IP: DROP, reason:8] Unexpected URIs:
  drop_request_without_expected_uri: False

Usage

  1. Grab a copy of RedWardenLite: wget https://github.com/iomoath/RedWardenLite/archive/refs/heads/master.zip or git clone https://github.com/iomoath/RedWardenLite
  2. Extract the archive and adjust your settings in example-config.yaml
  3. Run the command: python RedWardenLite.py -c example-config.yaml
  • The application will keep running in the background; you may use screen or tmux to manage this.
  • Tested on Ubuntu 18.04 (LTS) x64 with Python 3.8.3

Credits

Special thanks to Mariusz Banach / mgeeky for the significant effort they put into RedWarden

   Mariusz Banach / mgeeky, '19-'21
   <mb [at] binary-offensive.com>
   (https://github.com/mgeeky) 

redwardenlite's People

Contributors

iomoath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

redwardenlite's Issues

Not really an issue

can [#- content-type
#- referrer
#- accept-language ]
be added as expected headers ? and add of course their values in expected_headers_values ? thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.