Skip to content

Latest commit

 

History

History
121 lines (91 loc) · 3.3 KB

README.md

File metadata and controls

121 lines (91 loc) · 3.3 KB

Aegis

Simple Web Application Firewall

Aegis is a web application firewall written in Rust. It provides features like robust content filtering and rate limiting with redis.

Features

  • Rate Limiting with Redis: Prevent abuse and control traffic using Redis-backed rate limiting, ensuring that your services remain performant under heavy load.
  • Custom Rules for Filtering Requests: Define custom rules to block, allow, or monitor web traffic based on parameters such as IP, headers, URI, and more.
  • Hot Reload Configuration: Easily update firewall rules without downtime by reloading configurations on the fly.

Installation

  1. Prerequisites:

    • Rust
    • Redis
    • Optional: Docker for running Redis locally
  2. Clone the Repository:

    git clone https://github.com/utibeabasi6/aegis.git
    cd aegis
  3. Run the Project: Make sure Redis is running:

    docker run -p 6379:6379 redis

    Then, start the Aegis firewall:

    cargo run

Usage

Aegis is designed to be simple and highly configurable. Once running, you can define custom rules for rate limiting, request filtering, and traffic monitoring.

Installation

Install the latest version of Aegis by running the following command

cargo install aegis-waf

Start aegis by running

aegis --config-file /path/to/your/config.yaml

Example Config

upstream: "http://localhost:8000"
default_action: "Block"
rules:
  - action: "Allow"
    condition: "All"
    type: "Regular"
    statements:
      - inspect: 
          Header:
            key: "hello"
        negate_statement: false
        match_type: "Contains"
        match_string: "world"

This rule only allows requests which have a header named hello set to world. For a description of the various fields, please refer to this document.

Contributing

We welcome contributions! To get started:

  1. Fork the repository:

    git clone https://github.com/utibeabasi6/aegis.git
    cd aegis
  2. Create a feature branch:

    git checkout -b feature-branch-name
  3. Make your changes: Add new features, fix bugs, or improve documentation.

  4. Commit your changes:

    git add .
    git commit -m "Add feature or fix description"
  5. Push to your branch:

    git push origin feature-branch-name
  6. Create a pull request: Go to the repository on GitHub and submit a pull request describing your changes.


License

This project is licensed under the MIT License. See the LICENSE file for more details.


Contact