FirewallEventLog
Resource configuration reference · Kind/name · when · dependsOn
apiVersion: firewall.routerd.net/v1alpha1 · metadata.name
Enable the firewall packet-log collector and configure its database, Linux NFLOG group and renderer logging options.
Conditions and references
- enabled defaults false. On Linux the collector uses NFLOG; FreeBSD uses pflog0. This does not turn every accept/deny rule into a logged rule: FirewallRule.log and FirewallPolicy.logDeny also determine which packets are logged.
- Use one enabled resource: renderer options come from the first enabled resource, while service generation uses a shared routerd-firewall-logger service name. Multiple independent collector instances are not provided by multiple resource names.
Configuration syntax
This is explanatory notation, not YAML to copy. Unbracketed fields are required within their parent; [ ... ] marks fields that can be omitted, subject to the conditions in the table. <type> is a placeholder, and (a | b) lists alternatives. Optional parents may contain required children. Conditional requirements, exclusions and runtime defaults are described below. Use the linked YAML example for an ordinary configuration.
- apiVersion: firewall.routerd.net/v1alpha1
kind: FirewallEventLog
metadata:
name: "<name>"
spec:
[ enabled: <boolean> ]
[ log:
[ acceptSampleRate: <integer> ]
[ copyRange: <integer> ]
[ dropSampleRate: <integer> ]
]
[ nflogGroup: <integer> ]
[ path: <string> ]
Field meaning and default
Required children of optional objects apply only when their parent is used. Other exact conditions are in the explanation; bracketed alternatives may still require one choice.
| YAML | Presence | Type / constraints | Field meaning and default |
|---|---|---|---|
spec.enabled |
Optional | boolean | Default false; true starts the firewall log collector and the nDPI agent used for direct packet classification. |
spec.path |
Conditionally required | string | Optional SQLite database path. Default /var/lib/routerd/firewall-logs.db on Linux and /var/db/routerd/firewall-logs.db on FreeBSD. This is a database, not a JSON-lines output file. |
spec.nflogGroup |
Optional | integer; minimum=0; maximum=65535 | Integer 0–65535; omitted or 0 selects group 1 on Linux for both nftables logging and the collector. FreeBSD uses pflog0 and ignores this group. |
spec.log |
Optional | object | Optional renderer logging options; omitted fields decode to zero or false. |
spec.log.acceptSampleRate |
Optional | integer; minimum=0 | Default 0 disables extra implicit-accept logging. On nftables, positive N logs approximately 1/N of eligible packets (1 logs all). PF uses a positive value only as an enable switch, not a 1/N sampler. Explicit FirewallRule.log is separate. |
spec.log.dropSampleRate |
Optional | integer; minimum=0 | Default 0; nftables rates 0/1 log all already-enabled implicit deny logs, positive N>1 samples approximately 1/N. This does not itself enable FirewallPolicy.logDeny. PF does not use this sampling value. |
spec.log.copyRange |
Optional | integer; minimum=0 | Nonnegative NFLOG snaplen in bytes; default 0 omits the nftables snaplen argument. Positive values cap copied packet bytes. Not applied by the PF renderer. |
Implementation: pkg/api/specs.go · pkg/config/validate_firewall.go · pkg/config/validate.go · pkg/render/nftables.go · pkg/render/pf.go · pkg/render/firewall_logger.go · pkg/render/freebsd_rcd.go · pkg/render/dpi_systemd.go · pkg/controller/chain/system.go · pkg/controller/chain/logretention.go · pkg/platform/platform.go
Referenceable status fields
The ordinary status-reference validator accepts these field names for this kind. This allowlist does not guarantee that every field is currently populated; inspect runtime status. These are outputs, not YAML spec fields.
phase