Bug 11977

Summary: Deduplication of firewall rules when filtering is performed on hosts/networks known since green0
Product: IPFire Reporter: julien <blais.julien.30>
Component: ---Assignee: Stefan Schantl <stefan.schantl>
Status: ASSIGNED --- QA Contact:
Severity: Security    
Priority: Will affect all users CC: bbitsch, peter.mueller, stefan.schantl
Version: 2   
Hardware: all   
OS: Linux   
Bug Depends on:    
Bug Blocks: 12278    

Description julien 2019-01-23 21:07:36 UTC
Hello,

In the case where static roads are known on the green0 side by Ipfire and you want to filter on these networks, the firewall rules are duplicated in 3 specific cases.

1/
When a FORWARD rule has as its source a host or a network known since green0 and as a red0 interface output, we have an unnecessary rule that is added to INPUTWF.

2/
When a SNAT rule has as its source a host or network known from green0 with an IP redirection from green0 and as an output to a host of the same network known from green0, we have an unnecessary rule that is added to INPUTFW

3
When a DNAT rule with any network source and output to the firewall with a redirection of the destination IP to a host on the network known since green0, we have an unnecessary rule that is added to OUTGOINGFW.

An email was sent to the Ipfire development team to detail the 3 bugs. Below is a diagram to understand the infrastructure.

The objective is that Ipfire can filter/NAT on a network known since green0 without creating unwanted rules.


+-----------------------------+
| +----------+                |
| |          |                |
| |  SRV     | +--+           |
| |          |    |           |
| +----------+    |           |      192.168.X.0/24
|                 |           |      +----------->           +----------->
|  192.168.X.0/24 |           |          no NAT                   NAT
|                 |           |
|                 |           |
| +----------+    |      +---------+                 +---------+        +----------+
| |          |    |      |         | 192.168.y.252/30|         |        |          |
| |  PC      | +--+--+   |         | +-------------+ | Ipfire  | +----+ | INTERNET |
| |          |           |         |                 |         |        |          |
| +----------+           +---------+                 +---------+        +----------+
|                             |
+-----------------------------+

With kind regards
Comment 1 Michael Tremer 2019-01-28 11:46:45 UTC
https://lists.ipfire.org/pipermail/development/2019-January/005261.html

There are more details here...