Skip to content

Commit 756560c

Browse files
committed
update docs & add intro-gif
1 parent aa066d4 commit 756560c

File tree

6 files changed

+104
-45
lines changed

6 files changed

+104
-45
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ A framework for **testing and troubleshooting firewall rulesets**.
88

99
[Module on pypi.org](https://pypi.org/project/firewall-test/)
1010

11+
<img src="https://raw.githubusercontent.com/O-X-L/firewall-testing-framework/refs/heads/latest/docs/source/_static/img/opnsense.gif" alt="Intro GIF" width="70%"/>
12+
1113
----
1214

1315
## Documentation
2.88 MB
Loading

docs/source/dev/1_intro.rst

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,17 @@ Out-of-Scope
4444
Some of this features might be make sense later on.
4545

4646
* Transparent firewalls (layer 2 interception)
47+
4748
* Non-IP traffic (layer 2 ARP/bridge layer)
49+
4850
* Application-Level Protocols
51+
4952
* Automatic connection-simulation
53+
5054
* Rule-based routing (fwmark with routing-table lookup)
55+
5156
* Simulation of dynamic routing (we only use the routes provided to the translate-plugins - static or runtime export)
57+
5258
* Applying multiple DNAT or SNAT rules for a single packet
5359

5460
Principles
@@ -124,23 +130,23 @@ The entrypoints are designed to be executed by the user.
124130

125131
* :code:`cli` can be executed by the command :code:`ftf-cli`
126132

127-
It is designed to be a one-shot simulation of a packet
133+
It is designed to be a one-shot simulation of a packet
128134

129135
* :code:`ci` can be executed by the command :code:`ftf-ci`
130136

131137
.. warning::
132138

133-
To be implemented.
139+
To be implemented.
134140

135-
It is designed to simulate many packets. A test-traffic configuration-file needs to be provided!
141+
It is designed to simulate many packets. A test-traffic configuration-file needs to be provided!
136142

137143
* :code:`shell` can be executed by the command :code:`ftf-shell`
138144

139145
.. warning::
140146

141-
To be implemented.
147+
To be implemented.
142148

143-
It is designed to be an interactive shell for simulating multiple packets.
149+
It is designed to be an interactive shell for simulating multiple packets.
144150

145151
----
146152

@@ -161,7 +167,9 @@ The network-traffic configuration as provided by the user is parsed to packets.
161167
The configuration-files provided by the user are loaded and parsed as configured for the target firewall-system.
162168

163169
1. Loading the target-system config (:code:`plugins/system/*`)
170+
164171
2. Reading the config-files provided by the user
172+
165173
3. Parsing the configuration as implemented by the target-system-specific translate-plugins (:code:`plugins/translate/*`)
166174

167175
----
@@ -188,43 +196,43 @@ The configuration-files provided by the user are loaded and parsed as configured
188196

189197
2. **It is checked which kind of traffic-flow applies**
190198

191-
* If the source or destination IPs are local to the firewall
199+
* If the source or destination IPs are local to the firewall
192200

193-
* Estimated traffic-flow (:code:`input, forward or output`)
201+
* Estimated traffic-flow (:code:`input, forward or output`)
194202

195203
3. **The source-route is looked-up**
196204

197-
* The routing-simulator is queried for the source-route
205+
* The routing-simulator is queried for the source-route
198206

199-
* Updates the inbound-interface
207+
* Updates the inbound-interface
200208

201-
* Throws an error if no source-route was found
209+
* Throws an error if no source-route was found
202210

203-
.. tip::
211+
.. tip::
204212

205-
The detailed function of the :ref:`routing- and firewall-simulators are covered later on <dev_intro_router>`.
213+
The detailed function of the :ref:`routing- and firewall-simulators are covered later on <dev_intro_router>`.
206214

207215
4. **Pre-Routing and Pre-DNAT Firewall-Filters are processed**
208216

209217
5. **Destination-NAT is processed**
210218

211-
* Updating if the destination IP is local to the firewall
219+
* Updating if the destination IP is local to the firewall
212220

213-
* Updates the traffic-flow
221+
* Updates the traffic-flow
214222

215223
6. **The destination-route is looked-up**
216224

217-
* The routing-simulator is queried for the destination-route
225+
* The routing-simulator is queried for the destination-route
218226

219-
* Updates the outbound-interface
227+
* Updates the outbound-interface
220228

221-
* Throws an error if no destination-route was found
229+
* Throws an error if no destination-route was found
222230

223231
7. **System-specific filters**
224232

225-
* These are custom filters that might be outside the control of the firewall-ruleset itself (like Linux kernel)
233+
* These are custom filters that might be outside the control of the firewall-ruleset itself (like Linux kernel)
226234

227-
* Drops traffic to bogon-networks on WAN - if the firewall-system if configured to
235+
* Drops traffic to bogon-networks on WAN - if the firewall-system if configured to
228236

229237
8. **Main Firewall-Filters are processed**
230238

docs/source/plugins/firewall_opnsense.rst

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
.. |export_network| image:: ../_static/img/plugin-opnsense-export.png
77
:class: wiki-img-sm
88

9+
.. |intro_gif| image:: ../_static/img/opnsense.gif
10+
:class: wiki-img-sm
11+
912
.. include:: ../_include/head.rst
1013

1114
===================
@@ -14,16 +17,31 @@ Firewall - OPNsense
1417

1518
.. include:: ../_include/warn_develop.rst
1619

20+
|intro_gif|
21+
22+
Limitations
23+
###########
24+
25+
* Currently only the main Firewall-Ruleset (:code:`Firewall - Rules`) is supported.
26+
27+
Support for the new Ruleset (:code:`Firewall - Automation - Filter`) will get added later on - if you have demand for it feel free to `open a feature-request <https://github.com/O-X-L/firewall-testing-framework/issues>`_.
28+
29+
* Only the main match-expressions are currently supported.
30+
31+
See: :ref:`Config Parsing <plugins_fw_opnsense_cnf>`
32+
33+
----
34+
1735
Config Export
1836
#############
1937

2038
1. `Download a Config-Backup <https://docs.opnsense.org/manual/backups.html>`_ (referenced as :code:`config.xml`)
2139

22-
|export_backup|
40+
|export_backup|
2341

2442
2. Download the current network status via the WebUI: :code:`Interfaces - Overview - Download Buttom` (referenced as :code:`network.json`)
2543

26-
|export_network|
44+
|export_network|
2745

2846
----
2947

@@ -156,6 +174,8 @@ Source Code
156174
157175
----
158176
177+
.. _plugins_fw_opnsense_cnf:
178+
159179
Config-Parsing
160180
##############
161181

docs/source/usage/1_intro.rst

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
.. |topology| image:: ../_static/img/topology.svg
44
:class: wiki-img
55

6+
.. |intro_gif| image:: ../_static/img/opnsense.gif
7+
:class: wiki-img-sm
8+
9+
610
.. include:: ../_include/head.rst
711

812
=========
@@ -11,6 +15,9 @@
1115

1216
|topology|
1317

18+
|intro_gif|
19+
20+
1421
Goal / Reason / Why?
1522
####################
1623

@@ -32,25 +39,25 @@ Automated Regression-Tests
3239

3340
**Why would you want to do ruleset-regression-tests?**
3441

35-
* You may want/need to periodically verify that the currently active rulesets actually allow/deny the traffic you expect
42+
* You may want/need to periodically verify that the currently active rulesets actually allow/deny the traffic you expect
3643

37-
This can be a tedious task - you might overlook some edge-case.
44+
This can be a tedious task - you might overlook some edge-case.
3845

39-
* Especially when a ruleset is administered by teams of engineers over a long time period - it can be a challenge to:
46+
* Especially when a ruleset is administered by teams of engineers over a long time period - it can be a challenge to:
4047

41-
* detect configuration errors/mistakes before they can be exploited
48+
* detect configuration errors/mistakes before they can be exploited
4249

43-
* make sure the design-choices for the ruleset are adhered to
50+
* make sure the design-choices for the ruleset are adhered to
4451

45-
* 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.
52+
* 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.
4653

4754
**How do regression-tests work?**
4855

49-
* You define test-cases that simulate traffic over one or multiple firewalls
56+
* You define test-cases that simulate traffic over one or multiple firewalls
5057

51-
* You assert that the traffic was allowed/denied/rejected
58+
* You assert that the traffic was allowed/denied/rejected
5259

53-
* You might even want to assert that the traffic took a specific outbound route or was NATed to a specific IP
60+
* You might even want to assert that the traffic took a specific outbound route or was NATed to a specific IP
5461

5562
This way you can continuously extend these test-cases and easily verify that the currently active rulesets comply with them.
5663

@@ -65,36 +72,40 @@ Please take a took `at the roadmap <https://github.com/O-X-L/firewall-testing-fr
6572

6673
1. **Provide the firewall configuration**:
6774

68-
* manually pull the current config from the existing firewalls
75+
* manually pull the current config from the existing firewalls
6976

70-
* or utilize existing :code:`pull-plugins` to do so (p.e. via API)
77+
* or utilize existing :code:`pull-plugins` to do so (p.e. via API)
7178

7279
2. **Vendor-specific plugins**:
7380

74-
The vendor-specific configuration gets parsed by :code:`translation-plugins` which output a standardized firewall config-schema.
81+
vendor-specific configuration gets parsed by :code:`translation-plugins` which output a standardized firewall config-schema.
7582

7683
3. **Run**:
7784

78-
* Use the **one-shot CLI** (:code:`command: ftf-cli`)
85+
* Use the **one-shot CLI** (:code:`command: ftf-cli`)
7986

80-
* Enter an interactive shell (:code:`command: ftf-shell`)
87+
* Enter an interactive shell (:code:`command: ftf-shell`)
8188

82-
.. warning::
89+
.. warning::
8390

84-
Still under development.
91+
Still under development.
8592

86-
* Run **automated tests** (:code:`command: ftf-ci`) by providing a test-traffic configuration
93+
* Run **automated tests** (:code:`command: ftf-ci`) by providing a test-traffic configuration
8794

88-
.. warning::
95+
.. warning::
8996

90-
Still under development.
97+
Still under development.
9198

9299

93100
5. **The Simulator**
94101

95-
* parses the provided config
96-
* generates the network-topology
97-
* finds where the packet originates from
98-
* finds the route the packet should take
99-
* tests the traffic against the rulesets of firewalls that are hops of that route
102+
* parses the provided config
103+
104+
* generates the network-topology
105+
106+
* finds where the packet originates from
107+
108+
* finds the route the packet should take
109+
110+
* tests the traffic against the rulesets of firewalls that are hops of that route
100111

docs/source/usage/4_config.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,21 @@
77
==========
88

99
.. include:: ../_include/warn_wip.rst
10+
11+
Multiple Firewalls
12+
##################
13+
14+
We plan on supporting the simulation of packets across whole network topologies with multiple firewall-hops.
15+
16+
This is currently not yet implemented.
17+
18+
----
19+
20+
CI Mode
21+
#######
22+
23+
With the CI-Mode you will be able to supply a configuration listing test-packets and the expected outcome to **automate the process of validating** the ruleset.
24+
25+
This can be great for ensuring compliance when changes to the firewalls are done by teams of engineers.
26+
27+
The CI Run-Mode is not yet supported.

0 commit comments

Comments
 (0)