Feature #8712
closedfirewall: add default app policy options
Description
Add options to specific a default policy for policies that aren't specified.
firewall:
policies:
default-policy:
- "accept:hook"
http:
default-policy:
- "accept:hook"
request-started:
- "accept:hook"
request-trailer:
- "accept:hook"
request-complete:
- "accept:hook"
# implied request-body uses firewall.policies.http.default-policy
# implied tls uses firewall.policies.default-policy
VJ Updated by Victor Julien 2 months ago
- Related to Feature #7701: firewall: configurable default policies added
- Related to Bug #8389: firewall: Add monitor/observe mode to preview firewall policy without enforcing drops added
VJ Updated by Victor Julien 2 months ago
- Subject changed from firewall: add default app policy to firewall: add default app policy options
LS Updated by Lukas Sismis 2 months ago
- Status changed from New to Assigned
- Assignee set to Lukas Sismis
- Target version changed from TBD to 9.0.0-beta1
LS Updated by Lukas Sismis about 2 months ago
Would it be ok to redefine the policy section of the configuration file to a format like this?
The current format as is in: https://github.com/OISF/suricata/blob/43bc2db41e4f7356f6cadb3247750d66e27ea8fe/suricata.yaml.in#L2396
Feels ambiguous, especially since it doesn't allow defining policies to packet-related tables only (hence adding a "packet" node).
The same would be for defining global app policy option (hence adding "app" configuration node)
firewall:
policies:
default-policy: ["accept:hook"] # global fallback (all hooks)
packet:
default-policy: ["drop:packet"] # fallback for packet hooks
filter: ["drop:packet"]
pre-flow: ["accept:hook"]
pre-stream: ["accept:hook"]
app:
default-policy: ["drop:flow"] # fallback for all app hooks
dns:
default-policy: ["drop:flow"] # fallback for dns hooks
request-started: ["accept:hook"]
request-complete: ["drop:flow", "alert"]
response-started: ["accept:tx"]
VJ Updated by Victor Julien about 2 months ago
I think it makes sense. @Yash Datre any opinions?
LS Updated by Lukas Sismis about 2 months ago
Not particularly related to this ticket, but I would like to propose the change of the app layer policy from "http" to "http1" to be in line with FW rules.
YD Updated by Yash Datre about 2 months ago
Yes, this should solve the use-case.
AP Updated by Aneesh Patel about 1 month ago
Any update on this ticket? This is a pretty critical one for us
LS Updated by Lukas Sismis about 1 month ago
Hello, yes, it is on top of my list. I have it implemented, and after my testing/review, I expect I'll create a PR on Monday/Tuesday.
JI Updated by Jason Ish about 1 month ago
- Status changed from Assigned to In Progress
- Priority changed from Normal to High
LS Updated by Lukas Sismis about 1 month ago
- Status changed from In Progress to In Review
LS Updated by Lukas Sismis about 1 month ago
- Label Needs backport to 8.0 added
OT Updated by OISF Ticketbot about 1 month ago
- Subtask #8770 added
OT Updated by OISF Ticketbot about 1 month ago
- Label deleted (
Needs backport to 8.0)
JF Updated by Juliana Fajardini Reichow about 1 month ago
- Related to Feature #8781: firewall: allow bypass as a default policy added
LS Updated by Lukas Sismis 16 days ago
Prequel merged.
https://github.com/OISF/suricata/pull/16021
LS Updated by Lukas Sismis 16 days ago
As thinking through the usability I thought of one extra improvement.
Currently, protocols with substates follow this hierarchy:
``app.<proto>.<sub state>.<hook / generic_state>`` >``app.<proto>.<sub state>.default-policy`` > ``app.<proto>.default-policy`` > ``app.default-policy`` > ``policies.default-policy`` > built-in (``drop:flow``)
But in case, e.g. for http2, the user wants to set both stream and global substates to the same values, then the config needs to be defined for every substate.
Allowing to set hook name on the protocol level could have save this explicitness on the substate level.
The final chain could look like:
``app.<proto>.<sub state>.<hook / generic_state>`` > ``app.<proto>.<hook / generic_state>`` >``app.<proto>.<sub state>.default-policy`` > ``app.<proto>.default-policy`` > ``app.default-policy`` > ``policies.default-policy`` > built-in (``drop:flow``)
And in the config:
From this:
firewall:
policies:
http2:
stream:
request-started: ["accept:hook"]
request-completed: ["accept:hook"]
response-started: ["accept:hook"]
response-completed: ["accept:hook"]
global:
request-started: ["accept:hook"]
request-completed: ["accept:hook"]
response-started: ["accept:hook"]
response-completed: ["accept:hook"]
to this:
firewall:
policies:
http2:
request-started: ["accept:hook"]
request-completed: ["accept:hook"]
response-started: ["accept:hook"]
response-completed: ["accept:hook"]
Leaving this for a discussion for now, it not part of the current PR.
LS Updated by Lukas Sismis 8 days ago
- Status changed from In Review to Resolved
LS Updated by Lukas Sismis 8 days ago
- Status changed from Resolved to Closed