Home

Awesome

bifröst

Intelligent Self-Learning Whitelist-based Web Application Firewall

THIS PROJECT IS IN EARLY DEVELOPMENT STAGE AND IS NOT READY FOR PRODUCTION. IF YOU RUN THIS, EXPECT THE WORSE. IT'S STILL VERY UNTESTED AND DESPITE ALL EFFORTS MAY STILL CONTAIN MANY BUGS. USE IT AT YOUR OWN RISK

This WEB APPLICATION FIREWALL (WAF) uses its learning mode to gather a profile of the requested page. It analyzes and learns several parameters such as post fields, request/response content-size, response header count and size, file mimetypes and such to create a locked down whitelist to each page in each HTTP method provided.

Watch the demo on YouTube.

How it works?

It analyzes the request and response headers and body, parses lots of things and compares to learnt data to check if the request or response is under conformity with the known behavior of these URLs.

Each anomaly detected adds up to the threat score (configurable) and when it reaches the threat threshold it will log and drop the connection immediately.

Installation

If you want to run in privileged ports (<1024) you'll need to run as root (sudo ./bifrost.py). BIFRÖST DOES NOT DO PRIVILEGE DROP YET! BEWARE!!

As an alternative, you might give authbind a try to allow bifröst to bind to privileged ports as an unprivileged user.

Configuration

General section

This holds general configuration information for the WAF

Analyzer

This section enables and configures the various analyzer settings. The range comparators can be min/max range [range] or average [avg], plus tolerance.

Scorer

This section defines the score for each anomaly type. Defaults below. (Huge values are given to make a given anomaly to trigger a failure no matter what)

Tolerance

Defines the tolerance margins for each range-evaluated parameter. 0 = No tolerance, 0.5 = 50% tolerance, 1 = 100% tolerance, and such. Defaults below.

Enforcer

Determines which score values will mark a request as a threat.

Usage

Bifröst will be in the middle of your connection just like a reverse proxy would. Put it on training mode and it will start learning your pages' profiles then switch (in the configuration) to operational mode and give it a HUP signal.

All ready! (if not, train more!)

Extra

To reload bifröst configuration without restarting just send a HUP signal to it.

kill -s HUP $(ps aux | grep 'sudo ./bifrost.py' | grep -v grep | cut -d' ' -f6)

@TODO