Skip to main content

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

Release files for ftw 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ftw 1.3.0
File Size Uploaded
ftw-1.3.0.tar.gz 118.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ftw 1.3.0
File Interpreter ABI Platform
ftw-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 271.7 kB

Release files / ftw-1.3.0.tar.gz

Download URL ftw-1.3.0.tar.gz
Size 118.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b91832c438c7ad956db03324b35f52783be1c2c199a9c67166be94f3d1bde529
BLAKE2b-256 checksum
How to use checksums
828d59f73b6bace1dff25acebca693569e40f60bfd7e50a55c0d1c526d4eb5ba
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / ftw-1.3.0-py3-none-any.whl

Download URL ftw-1.3.0-py3-none-any.whl
Size 152.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f64a871a202a7b5304d0de5296c147c0375bbf4833687eb493a46d6c337b74c3
BLAKE2b-256 checksum
How to use checksums
2136223b902a3518cc6ad5da1fc39183ce59f1328c171aae321ffa749d0bfdb6
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.0

1 release file

1.1.7

1 release file

1.1.6

1 release file

1.1.5

2 release files

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.2

1 release file

1.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page