Replaces iptables. Use for all new Linux deployments.
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
ct state established,related accept
iif lo accept
# specific allow rules here
}
chain forward {
type filter hook forward priority 0; policy drop;
}
chain output {
type filter hook output priority 0; policy drop;
ct state established,related accept
# explicit egress rules here
}
}
Egress filtering on output is critical and almost universally neglected. Malware, data exfil, and C2 all depend on unrestricted outbound access. Whitelist only ports/destinations your system actually needs.