Salt Phase 3: nftables firewall with default deny inbound (#5) #6
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-platform!6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "5-salt-phase-3-nftables-firewall-default-d"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Changes
salt/pillar/firewall.sls: New pillar file with structured firewall rule definitions (allowed interfaces, CIDRs, per-port rules, conntrack states)salt/states/firewall/init.sls: New state — installs nftables, renders config from Jinja template, enables service with watch-based reload on config changesalt/states/firewall/nftables.conf.j2: New Jinja template rendering nftables.conf from pillar data (default drop inbound, accept outbound, drop forward)salt/pillar/top.sls: Addedfirewallpillar assignment to archboxsalt/states/top.sls: Addedfirewallstate assignment to archboxFirewall policy summary:
tailscale0interfacelointerface10.42.0.0/1610.43.0.0/1610.0.0.0/24-> port 22/tcpestablished,relatedTest Plan
salt-call state.apply firewall test=True— dry run shows expected changesnft -c -f /etc/nftables.conf— validate rendered config syntax after renderingsudo nft -f /etc/nftables.conf && sleep 60 && sudo nft flush rulesetnft list rulesetmatches pillar dataReview Checklist
Related Notes
issue-pal-e-platform-salt-phase-3-nftables— the issue this PR addressesplan-2026-02-26-salt-host-management— Phase 3host-inventory-archbox— current host state with security gaps identifiedplan-2026-02-26-network-security-hardeningPhase 2Review-fix round 1: Added conntrack (
ct state established,related accept+ct state invalid drop) to the forward chain.Without this, return traffic for connections initiated by pods through masquerade/NAT could be dropped. The input chain already had conntrack, but the forward chain was relying solely on CIDR-based rules. While the CIDR rules cover most k3s forwarding scenarios, conntrack in the forward chain is standard best practice and handles edge cases more robustly.