Skip to content

Commit b9bb445

Browse files
committed
added basic documentation
1 parent 358dc7c commit b9bb445

File tree

21 files changed

+960
-113
lines changed

21 files changed

+960
-113
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ dist/
99
testdata/custom_*
1010
scripts/cli_custom.sh
1111
tmp/
12+
13+
docs/build/

CONTRIBUTE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Contribute
2+
3+
Contributions are welcome (:
4+
5+
What would be helpful for now:
6+
* Feel free to discuss the ideas and roadmap for this project with us: [GitHub discussions](https://github.com/O-X-L/firewall-testing-framework/discussions) or [contact us directly](mailto://contact@oxl.at)
7+
* Open [issues](https://github.com/O-X-L/firewall-testing-framework/issues) if you think you have found a problem with the existing code (be aware that it might not yet be in a usable state)
8+
9+
* Please do not post any generic AI-slop.. thanks.
10+
* Be friendly and respectful
11+
12+
----
13+
14+
## Documentation
15+
16+
Please read the developer-documentation: [ftf.oxl.app](https://ftf.oxl.app/dev/1_intro.html)

README.md

Lines changed: 34 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -3,139 +3,60 @@
33
[![Lint](https://github.com/O-X-L/firewall-testing-framework/actions/workflows/lint.yml/badge.svg?branch=latest)](https://github.com/O-X-L/firewall-testing-framework/actions/workflows/lint.yml)
44
[![Test](https://github.com/O-X-L/firewall-testing-framework/actions/workflows/test.yml/badge.svg?branch=latest)](https://github.com/O-X-L/firewall-testing-framework/actions/workflows/test.yml)
55

6-
A framework for testing and troubleshooting firewall Layer 3-4 rulesets.
7-
8-
**WARNING**: This project is still in the conception-phase.
6+
A framework for **testing and troubleshooting firewall rulesets**.
97

108
----
119

12-
## Goal / Why?
13-
14-
When having to administer IT infrastructure and networks - we will often have multiple firewalls in place.
15-
16-
Maintaining these might be time-consuming. You might also face some challenges:
17-
18-
* **Troubleshooting & Analysis**:
19-
20-
Even for senior network engineers it can be a challenge to find the source of an unexpected block/accept in large rulesets that are distributed across multiple systems and firewall vendors.
21-
22-
Infrastructure-as-Code does help to keep the rulesets in a consistent state - but it does not solve the issue of having to manually analyze/troubleshoot existing rulesets.
10+
## Documentation
2311

24-
This project wants to provide one interface for simulating traffic over multiple firewall systems.
25-
26-
* **Automated Regression-Tests**:
27-
28-
Why would you want to do ruleset-regression-tests?
29-
* You may want/need to periodically verify that the currently active rulesets actually allow/deny the traffic you expect
30-
This can be a tedious task - you might overlook some edge-case.
31-
* Especially when a ruleset is administered by teams of engineers over a long time period - it can be a challenge to:
32-
* detect configuration errors/mistakes before they can be exploited
33-
* make sure the design-choices for the ruleset are adhered to
34-
35-
* If you already utilize Infrastructure-as-Code and change-reviews for updating your rulesets you might want to also validate the functionality of that ruleset via automated CI-jobs.
36-
37-
How do regression-tests work?
38-
* You define test-cases that simulate traffic over one or multiple firewalls
39-
* You assert that the traffic was allowed/denied/rejected
40-
* You might even want to assert that the traffic took a specific outbound route or was NATed to a specific IP
41-
42-
This way you can continuously extend these test-cases and easily verify that the currently active rulesets comply with them.
43-
44-
----
45-
46-
## Idea
47-
48-
Take a look at this topology:
12+
You can find the documentation at: [ftf.oxl.app](https://ftf.oxl.app)
4913

5014
<img src="https://raw.githubusercontent.com/O-X-L/firewall-testing-framework/refs/heads/latest/docs/source/_static/img/topology.svg" max-width="700"></img>
5115

52-
The flow is planned to be:
53-
54-
1. Either:
55-
* manually pull the current config from the existing firewalls
56-
* or utilize existing `pull-plugins` to do so (p.e. via API)
57-
58-
2. The vendor-specific configuration gets parsed by `translation-plugins` which output a standardized firewall config-schema.
59-
60-
3. The user provides a high-level `topology-config`
61-
62-
4. If automated tests should be run: The user needs to provide a `test-traffic config`
63-
64-
Else the user has the option to enter an interactive shell where traffic can be sent manually
65-
66-
5. The `firewall/network simulator`
67-
68-
* parses the provided config
69-
* generates the network-topology
70-
* finds where the packet originates from (or notifies the user if more information is required)
71-
* finds the route the packet should take
72-
* tests the traffic against the rulesets of firewalls that are hops of that route
73-
74-
Thanks already go to @MikPisula, the creator of the [MikPisula/packet-simulator](https://github.com/MikPisula/packet-simulator) for creating a simulator for netfilter (IPTables/NFTables) firewalls.
75-
76-
Also thanks to the [go-ftw (Web Application Firewall Testing Framework) project](https://github.com/coreruleset/go-ftw) that inspired us to support regression-tests.
77-
78-
----
79-
80-
## Principles
81-
82-
* **Strict separation of vendor-specific plugins** from the core traffic-simulator.
83-
84-
Plugins CAN be used to pull the current configuration (rulesets, interfaces, routes) from a firewall system, but admins should always be able to manually provide this information.
85-
86-
Some might not want to trust some 'nice-to-have' tool with access to their firewalls.
87-
88-
* The user should be able to choose the **output verbosity**.
89-
90-
We want to provide full transparency (*show every rule the traffic interacts with*) but if not required (*p.e in automated/CI-mode*) it should be brief.
91-
92-
----
93-
94-
## Contribute
95-
96-
Contributions are welcome (:
97-
98-
What would be helpful for now:
99-
* Feel free to discuss the ideas and roadmap for this project with us: [GitHub discussions](https://github.com/O-X-L/firewall-testing-framework/discussions) or [contact us directly](mailto://contact@oxl.at)
100-
* Open [issues](https://github.com/O-X-L/firewall-testing-framework/issues) if you think you have found a problem with the existing code (be aware that it might not yet be in a usable state)
101-
102-
* Please do not post any generic AI-slop.. thanks.
103-
* Be friendly and respectful
104-
10516
----
10617

10718
## Roadmap
10819

10920
### 2025
11021

11122
**Core Simulator**:
112-
* Generating Layer 3 Topology
113-
* Generating multiple Firewalls
114-
* Detect Firewall-chaining (one firewall routes to another one - p.e. over VPN)
115-
* Run modes:
116-
* Basic interactive shell
117-
* Automated/CI mode
118-
* Defining basic config-schema (Topology, Rulesets, Tests)
119-
* Run multiple Test-cases from config (CLI pytest-like?)
120-
* Option to Output results to JSON
121-
* Security Features to protect users:
122-
* Warn before executing non-verified (code review) plugin
23+
- [ ] Fundamental Features
24+
- [x] Routing
25+
- [x] Network Interfaces
26+
- [x] Firewall Tables
27+
- [x] Firewall Chains
28+
- [x] Firewall Rules
29+
- [x] System-Specific Translate-Plugins
30+
- [x] System-Specific Rule-Matching
31+
- [ ] Run modes:
32+
- [x] One-Shot CLI
33+
- [ ] Basic interactive shell
34+
- [ ] Automated/CI mode
35+
- [ ] Run multiple Test-cases from config (CLI pytest-like?)
36+
- [ ] Defining basic config-schema (Topology, Rulesets, Tests)
37+
- [ ] Option to Output results to JSON
38+
- [ ] Supporting multiple Firewalls
39+
- [ ] Generating Layer 3 Topology
40+
- [ ] Detect Firewall-chaining (one firewall routes to another one - p.e. over VPN)
12341

12442
**Development**:
125-
* Create Plugin Templates
126-
* Create Guide on how to develop Plugins
43+
- [ ] Create Plugin Templates
44+
- [ ] Create Guide on how to develop Plugins
12745

12846
**Firewall Support**:
129-
* Netfilter (NFTables/IPTables)
130-
* OPNsense (Plugin that parses Config-Backup-File)
47+
- [ ] Netfilter (NFTables/IPTables)
48+
- [ ] OPNsense (Information from Config-Backup-File and runtime-infos like routes from API)
49+
50+
----
51+
52+
## Contribute
53+
54+
See: [CONTRIBUTING](https://github.com/O-X-L/firewall-testing-framework/blob/latest/CONTRIBUTING.md)
13155

13256
----
13357

134-
### What will be out-of-scope for now
58+
## Credits
13559

136-
Why? Because we initially need to focus on building the core simulator!
60+
* Thanks to the [go-ftw (Web Application Firewall Testing Framework) project](https://github.com/coreruleset/go-ftw) that inspired us to create this project
13761

138-
* Transparent firewalls (layer 2 interception)
139-
* Application-Level Protocols
140-
* Connection-Tracking helpers (rules that use these CT-states)
141-
* Non-static routing (dynamic routing, rule-based routing via fwmark and routing-table lookup)
62+
* Thanks go to [@MikPisula](https://github.com/MikPisula) for some inspiration on how to simulate network-traffic over a firewall ([MikPisula/packet-simulator](https://github.com/MikPisula/packet-simulator))

docs/html.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
cd "$(dirname "$0")"
6+
7+
rm -rf build
8+
mkdir build
9+
10+
sphinx-build -b html source/ build/

docs/html_infra.sh

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/bash
2+
3+
if [ -z "$1" ]
4+
then
5+
DEST_DIR='build'
6+
else
7+
DEST_DIR="$1"
8+
fi
9+
10+
set -euo pipefail
11+
12+
function log() {
13+
msg="$1"
14+
echo ''
15+
echo "### ${msg} ###"
16+
echo ''
17+
}
18+
19+
cd "$(dirname "$0")"
20+
21+
SRC_DIR="$(pwd)"
22+
23+
TS="$(date +%s)"
24+
TMP_DIR="/tmp/${TS}"
25+
mkdir -p "${TMP_DIR}"
26+
27+
VENV_BIN='/tmp/.oxl-docs-venv/bin/activate'
28+
if [ -f "$VENV_BIN" ]
29+
then
30+
source "$VENV_BIN"
31+
fi
32+
33+
log 'BUILDING DOCS'
34+
export PYTHONWARNINGS='ignore'
35+
sphinx-build -b html source/ "${TMP_DIR}/" >/dev/null
36+
37+
log 'PATCHING METADATA'
38+
cp "${SRC_DIR}/meta/"* "${TMP_DIR}/"
39+
40+
HTML_META_SRC="<meta charset=\"utf-8\" />"
41+
HTML_META="${HTML_META_SRC}<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'self'; img-src 'self' https://files.oxl.at data:; style-src 'self' https://files.oxl.at 'unsafe-inline'; script-src 'self' https://files.oxl.at 'unsafe-inline' 'unsafe-eval'; connect-src 'self' https://api.github.com;\">"
42+
HTML_META="${HTML_META}<link rel=\"icon\" type=\"image/webp\" href=\"https://files.oxl.at/img/oxl3_sm.webp\">"
43+
HTML_META_EN="${HTML_META}" # <link rel=\"alternate\" href=\"https://docs.o-x-l.at\" hreflang=\"de\">
44+
# HTML_LOGO_LINK_SRC='href=".*Go to homepage"'
45+
# HTML_LOGO_LINK_EN='href="https://www.o-x-l.com" class="oxl-nav-logo" title="OXL IT Services Website"'
46+
HTML_LANG_NONE='<html'
47+
HTML_LANG_EN='html lang="en"'
48+
49+
cd "${TMP_DIR}/"
50+
51+
sed -i "s|$HTML_META_SRC|$HTML_META_EN|g" *.html
52+
sed -i "s|$HTML_META_SRC|$HTML_META_EN|g" */*.html
53+
# sed -i "s|$HTML_LOGO_LINK_SRC|$HTML_LOGO_LINK_EN|g" *.html
54+
# sed -i "s|$HTML_LOGO_LINK_SRC|$HTML_LOGO_LINK_EN|g" */*.html
55+
sed -i "s|$HTML_LANG_NONE|<$HTML_LANG_EN|g" *.html
56+
sed -i "s|$HTML_LANG_NONE|<$HTML_LANG_EN|g" */*.html
57+
58+
log 'ACTIVATING'
59+
cd "$SRC_DIR"
60+
if [ -d "$DEST_DIR" ]
61+
then
62+
rm -r "$DEST_DIR"
63+
fi
64+
mkdir -p "${DEST_DIR}/"
65+
66+
mv "${TMP_DIR}/"* "${DEST_DIR}/"
67+
68+
touch "${DEST_DIR}/${TS}"
69+
70+
rm -rf "$TMP_DIR"
71+
72+
log 'FINISHED'

docs/meta/robots.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
User-agent: anthropic-ai
2+
Disallow: /
3+
4+
User-agent: Claude-Web
5+
Disallow: /
6+
7+
User-agent: ClaudeBot
8+
Disallow: /
9+
10+
User-agent: PerplexityBot
11+
Disallow: /
12+
13+
User-agent: CCBot
14+
Disallow: /
15+
16+
User-agent: Google-Extended
17+
Disallow: /
18+
19+
User-agent: GPTBot
20+
Disallow: /
21+
22+
User-agent: ChatGPT-User
23+
Disallow: /
24+
25+
User-agent: *
26+
Disallow:
27+
Sitemap: sitemap.xml

docs/meta/sitemap.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3+
<url><loc>https://ftf.oxl.app/</loc></url>
4+
5+
<url><loc>https://ftf.oxl.app/usage/1_intro.html</loc></url>
6+
<url><loc>https://ftf.oxl.app/usage/2_system_support.html</loc></url>
7+
<url><loc>https://ftf.oxl.app/usage/3_run.html</loc></url>
8+
<url><loc>https://ftf.oxl.app/usage/4_config.html</loc></url>
9+
10+
<url><loc>https://ftf.oxl.app/dev/1_intro.html</loc></url>
11+
<url><loc>https://ftf.oxl.app/dev/2_plugins.html</loc></url>
12+
</urlset>

docs/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sphinx
2+
sphinx_immaterial

docs/source/_include/head.rst

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.. warning::
2+
This project still in early development! **DO NOT USE IN PRODUCTION!**

0 commit comments

Comments
 (0)