Skip to main content

Framework for Testing WAFs

Project description

Framework for Testing WAFs (FTW)

Build Status PyPI version

Purpose

This project was created by researchers from ModSecurity and Fastly to help provide rigorous tests for WAF rules. It uses the OWASP Core Ruleset V3 as a baseline to test rules on a WAF. Each rule from the ruleset is loaded into a YAML file that issues HTTP requests that will trigger these rules. Users can verify the execution of the rule after the tests are issued to make sure the expected response is received from an attack

Goals / Use cases include:

  • Find regressions in WAF deployments by using continuous integration and issuing repeatable attacks to a WAF
  • Provide a testing framework for new rules into ModSecurity, if a rule is submitted it MUST have corresponding positive & negative tests
  • Evaluate WAFs against a common, agreeable baseline ruleset (OWASP)
  • Test and verify custom rules for WAFs that are not part of the core rule set

For our 1.0 release announcement, check out the OWASP CRS Blog

Installation

  • git clone https://github.com/coreruleset/ftw.git
  • cd ftw
  • virtualenv env && source ./env/bin/activate
  • pip install -r requirements.txt
  • py.test -s -v test/test_default.py --ruledir=test/yaml

Writing your first tests

The core of FTW is it's extensible yaml based tests. This section lists a few resources on how they are formatted, how to write them and how you can use them.

OWASP CRS wrote a great blog post describing how FTW tests are written and executed.

YAMLFormat.md is ground truth of all yaml fields that are currently understood by FTW.

After reading these two resources, you should be able to get started in writing tests. You will most likely be checking against status code responses, or web request responses using the log_contains directive. For integrating FTW to test regexes within your WAF logs, refer to ExtendingFTW.md

Provisioning Apache+Modsecurity+OWASP CRS

If you require an environment for testing WAF rules, there has been one created with Apache, Modsecurity and version 3.0.0 of the OWASP core ruleset. This can be deployed by:

  • Checking out the repository: git clone https://github.com/fastly/waf_testbed.git
  • Typing vagrant up

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ftw-1.3.0.tar.gz (118.9 kB view details)

Uploaded Source

Built Distribution

ftw-1.3.0-py3-none-any.whl (152.9 kB view details)

Uploaded Python 3

File details

Details for the file ftw-1.3.0.tar.gz.

File metadata

  • Download URL: ftw-1.3.0.tar.gz
  • Upload date:
  • Size: 118.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for ftw-1.3.0.tar.gz
Algorithm Hash digest
SHA256 b91832c438c7ad956db03324b35f52783be1c2c199a9c67166be94f3d1bde529
MD5 b34ad9d4543cd8f5bd1bd8ffa251980d
BLAKE2b-256 828d59f73b6bace1dff25acebca693569e40f60bfd7e50a55c0d1c526d4eb5ba

See more details on using hashes here.

File details

Details for the file ftw-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: ftw-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 152.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for ftw-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f64a871a202a7b5304d0de5296c147c0375bbf4833687eb493a46d6c337b74c3
MD5 e8abed72268647670567da21f8228fb2
BLAKE2b-256 2136223b902a3518cc6ad5da1fc39183ce59f1328c171aae321ffa749d0bfdb6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page