FirewallRule
¶
Source code in docs_src/capo_network_firewall/types/firewall_rule.py
accept_prior_hooks
instance-attribute
¶
accept_prior_hooks: NotRequired[AcceptPriorHooks]
Whether Network Firewall automatically accepts the earlier application-layer hooks that a connection must pass to reach this rule's hook. Because the firewall engine is drop by default, accepting prior hooks lets you author a single rule for the hook you care about, instead of also authoring a rule for each earlier hook. This setting accepts the earlier application-layer hooks only; it doesn't accept the TCP layer. For more information, see Rule groups for a firewall using a Next Generation policy in the Network Firewall Developer Guide.
action
instance-attribute
¶
action: FirewallRuleAction
The action that the firewall engine takes on traffic that matches the rule. The firewall engine supports the following actions:
-
ACCEPT- Allow the traffic. -
DROP- Block the traffic and discontinue inspection. -
REJECT- Block the traffic and send a TCP reset packet back to the client. -
REJECT_DST- Block the traffic and send a TCP reset packet to the destination. -
REJECT_BOTH- Block the traffic and send a TCP reset packet to both the client and the destination.
You combine the action with an action scope, for example accept:flow. To send accepted traffic straight to its destination and skip the IPS engine, pair an accept action with the BypassIPSEnabled setting. For more information, see Rule groups for a firewall using a Next Generation policy in the Network Firewall Developer Guide.
action_scope
instance-attribute
¶
action_scope: ActionScope
The scope that controls how much of the matched traffic the action applies to. The valid scopes depend on the action: ACCEPT supports all four scopes, and DROP, REJECT, REJECT_DST, and REJECT_BOTH support only PACKET and FLOW.
-
PACKET- The current packet only. -
HOOK- The current hook only. The firewall engine evaluates the connection again at the next hook. -
TX- The current transaction. The firewall engine continues to evaluate later transactions on the connection. -
FLOW- The entire connection. For an accept action, the connection skips the firewall engine's remaining hooks and advances to the IPS engine.
In a Suricata-compatible rule string, you write the scope in lowercase, for example accept:flow.
alert_enabled
instance-attribute
¶
alert_enabled: NotRequired[AlertEnabled]
Specifies whether the rule also generates an alert log for the traffic that it matches. Turning on alerting adds a secondary alert action to the rule, so that Network Firewall logs the match in addition to taking the rule's primary action.
bypass_ips_enabled
instance-attribute
¶
bypass_ips_enabled: NotRequired[BypassIPSEnabled]
Specifies whether an accepted connection bypasses the IPS engine. By default, traffic that the firewall engine accepts advances to the IPS engine for threat inspection. When you turn on this setting for an accept rule, the accepted traffic goes straight to its destination without IPS inspection. You can set the bypass only on accept rules, and it uses the same scope as the rule's accept action; only the flow and packet scopes support a bypass. For more information, see Rule groups for a firewall using a Next Generation policy in the Network Firewall Developer Guide.
dest_i_ps
instance-attribute
¶
dest_i_ps: NotRequired[Destination]
The destination IP addresses and address ranges to inspect for, in CIDR notation. A firewall rule always compiles to a forward-direction rule, so you express inbound compared to outbound traffic through the source and destination addresses.
hook
instance-attribute
¶
hook: HookKey
The connection-state hook at which the firewall engine evaluates the rule. The hook encodes both the protocol and the connection state, for example a TCP hook or a TLS client_hello hook. For the hooks that the firewall engine supports and how they map to the connection lifecycle, see Rule groups for a firewall using a Next Generation policy in the Network Firewall Developer Guide and the Suricata firewall mode documentation.
protocol
instance-attribute
¶
protocol: FirewallRuleProtocol
The protocol of the rule's hook. The protocol is derived from the hook and must match the hook's protocol prefix. Network Firewall rejects a rule whose protocol doesn't match its hook.
rule_metadata
instance-attribute
¶
rule_metadata: NotRequired[RuleMetadata]
Optional metadata for the rule: whether the rule is enabled and a description. Metadata doesn't change how the rule matches or acts on traffic.
rule_options
instance-attribute
¶
rule_options: NotRequired[RuleOptions]
Additional options for the rule. These are the Suricata RuleOptions settings, such as the signature ID (sid) and match keywords.
source_i_ps
instance-attribute
¶
source_i_ps: NotRequired[Source]
The source IP addresses and address ranges to inspect for, in CIDR notation. A firewall rule always compiles to a forward-direction rule, so you express inbound compared to outbound traffic through the source and destination addresses.