Logging pipeline
pf writes each logged packet to a virtual interface. A small helper turns those packets into syslog lines carrying the rule's name, and syslogd sends them over TLS to the SIEM in the cluster.
The path#
- pflog0. Every logged block, and every logged new connection, appears here as a packet.
- pflog2syslog. An rc service reads pflog0 with tcpdump and appends
label=<rule name>from a map it rebuilds at every start. - syslogd. Forwards over TLS, includes its hostname and writes ISO timestamps in UTC. It verifies the receiver against the home CA, and proves itself with a client certificate of its own: Vector accepts no connection without one.
- Vector, in the cluster. Parses each line into structured fields and writes it to OpenSearch.
Configuration#
*.notice;local0.info;auth.info;authpriv.info @tls://siem.internal:6514- Selector order matters:
*.noticecomes first, or it overrides the more specific entries after it.
syslogd_flags=-h -Z -C /etc/ssl/homelab-ca.crt
pkg_scripts=pflog2syslog-hadds the hostname,-Zswitches to ISO timestamps in UTC,-Cnames the CA that the receiver's certificate must chain to.