|
3 | 3 | [](https://github.com/O-X-L/firewall-testing-framework/actions/workflows/lint.yml) |
4 | 4 | [](https://github.com/O-X-L/firewall-testing-framework/actions/workflows/test.yml) |
5 | 5 |
|
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**. |
9 | 7 |
|
10 | 8 | ---- |
11 | 9 |
|
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 |
23 | 11 |
|
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) |
49 | 13 |
|
50 | 14 | <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> |
51 | 15 |
|
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 | | - |
105 | 16 | ---- |
106 | 17 |
|
107 | 18 | ## Roadmap |
108 | 19 |
|
109 | 20 | ### 2025 |
110 | 21 |
|
111 | 22 | **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) |
123 | 41 |
|
124 | 42 | **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 |
127 | 45 |
|
128 | 46 | **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) |
131 | 55 |
|
132 | 56 | ---- |
133 | 57 |
|
134 | | -### What will be out-of-scope for now |
| 58 | +## Credits |
135 | 59 |
|
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 |
137 | 61 |
|
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)) |
0 commit comments