Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix default reject rule to correctly handle packets that should be re…
…assembled When using an L7 NetworkPolicy that allows egress HTTP requests, the corresponding Suricata rules may look like the following example: ``` reject ip any any -> any any (msg: "Reject by AntreaNetworkPolicy:default/egress-allow-http"; flow: to_server, established; sid: 1;) pass http any any -> any any (msg: "Allow http by AntreaNetworkPolicy:default/egress-allow-http"; http.method; content:"GET"; sid: 2;)` ``` If an HTTP request exceeds the MTU, it will be split into multiple packets. The packets should be reassembled and allowed by the corresponding Suricata rule for the L7 NetworkPolicy. However, there is a default reject rule which is to reject packets which are not matched by the `pass` rule, which will take effect before packets are reassembled and matched by the `pass` rule, causing the connection to fail. To address the issue, the keyword `only_stream` is added to the default reject rule. This ensures that only reassembled packets are matched, preventing premature rejection of packets that should be allowed after reassembly. Signed-off-by: Hongliang Liu <[email protected]>
- Loading branch information