Git Product home page Git Product logo

waf-brain's Introduction

WAF-Brain

WAF-Brain: the clever and efficient Firewall for the Web

Project site https://github.com/bbva/waf-brain
Issues https://github.com/bbva/waf-brain/issues/
Latest Version 1.0.0-alpha
Python versions 3.6 or above
License Apache 2

Overview

This project was born to try to create a WAF(Web Application Firewall) with Deep Learning way.

Link to the article

This library allow:

  • Launch a web-server with a Machine Learning model for stop SQL Injection Attacks
  • Use your custom machine-learning model.

How install

pip install -e .

How use

1. Launch the waf server and the application server

This is a example repo for launch modsecurity server with express server <https://github.com/theonemule/docker-waf>

2. Launch waf-benchmark over the waf server address

You have multiples kind of benchmarking

  • For launch a server in test mode with our model on localhost, and collect partial results, launch this command

python -m waf_brain -T --dump-file logs.txt -l 0.0.0.0

  • Use custom model

python -m waf_brain -T --dump-file logs.txt -l 0.0.0.0 -M custom_model.h5

NOTE: Default port 8000

Research

Contribute to the project, get our Notebooks and datasets for train new models.

For more info go to this link: <https://github.com/BBVA/waf-brain/blob/master/research/RESEARCH.md>

Other Options

usage: __main__.py [-h] [-v] [--backend-timeout BACKEND_TIMEOUT]
[-A PROTECTED_URL] [-l LISTEN] [-p PORT] [-b BACKLOG] [--blocking-mode] [--blocking-threshold BLOCKING_THRESHOLD] [-M MODEL] [-T] [--dump-file DUMP_FILE] [-a]

WAF-brain: the clever and efficient Firewall for the Web

optional arguments:
-h, --help show this help message and exit
-v log level
Server Options:
--backend-timeout BACKEND_TIMEOUT
 timeout to connect to the backend
-A PROTECTED_URL, --protected-url PROTECTED_URL
 address service to protect with the WAF
-l LISTEN, --listen LISTEN
 listen address. Default: 127.0.0.1
-p PORT, --port PORT
 listen port for service. Default: 8000
-b BACKLOG, --backlog BACKLOG
 maximum concurrent connections
WAF Behavior:
--blocking-mode
 enables active blocking of dangerous request
--blocking-threshold BLOCKING_THRESHOLD
 if the dangerous levels is upper this number, and blocking mode is enabled, WAF will block a request
-M MODEL, --model MODEL
 model used for WAF
Enable testing mode:
-T, --enable-testing
 enable testing mode
--dump-file DUMP_FILE
 dump file to track each request
-a, --access-log
 enable access log for each request

waf-brain's People

Contributors

cr0hn avatar engapa avatar sergiodfdez avatar

Watchers

 avatar

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.