Add opt-in host firewalling with nftables and Fail2ban #85

Merged
parkel merged 2 commits from feature/host-firewall into main 2026-11-22 00:38:57 +01:00
Owner

Summary

  • Add per-host firewall policies for public, LAN, trusted reverse proxy, and service-only deployments. Policies define the IPv4 and IPv6 administrator allowlists, service ports, and per-source rate limits.
  • Preview and stage rules in a Coulobre-owned nftables table. Schedule an automatic rollback before activation and restore the last confirmed policy at boot.
  • Run distribution Fail2ban filters in a dedicated instance for SSH, Postfix authentication, and Dovecot. Expose the live rules and bans in the node CLI and record manual unblocks in an operator audit log.
  • Add local and remote service health entries and document the operator workflow, package ownership, and the layer at which to limit client requests behind a trusted reverse proxy.

Closes #76

Verification

  • Passed all 438 Django tests, the system and migration checks, and Ruff.
  • Built the source distribution and wheel and verified both against the branch commit.
  • On a disposable Debian 13 VM with the distribution packages, verified IPv4 and IPv6 access, UDP DNS rate limiting, trusted proxy source restrictions, and a Fail2ban ban and audited unblock.
  • Simulated a firewall change that blocked new administrator SSH sessions. The existing session stayed open, the timer restored fresh SSH access, and an independent nftables table kept its rules. Rebooted the VM and verified that the confirmed policy and managed Fail2ban instance returned.
## Summary - Add per-host firewall policies for public, LAN, trusted reverse proxy, and service-only deployments. Policies define the IPv4 and IPv6 administrator allowlists, service ports, and per-source rate limits. - Preview and stage rules in a Coulobre-owned nftables table. Schedule an automatic rollback before activation and restore the last confirmed policy at boot. - Run distribution Fail2ban filters in a dedicated instance for SSH, Postfix authentication, and Dovecot. Expose the live rules and bans in the node CLI and record manual unblocks in an operator audit log. - Add local and remote service health entries and document the operator workflow, package ownership, and the layer at which to limit client requests behind a trusted reverse proxy. Closes #76 ## Verification - Passed all 438 Django tests, the system and migration checks, and Ruff. - Built the source distribution and wheel and verified both against the branch commit. - On a disposable Debian 13 VM with the distribution packages, verified IPv4 and IPv6 access, UDP DNS rate limiting, trusted proxy source restrictions, and a Fail2ban ban and audited unblock. - Simulated a firewall change that blocked new administrator SSH sessions. The existing session stayed open, the timer restored fresh SSH access, and an independent nftables table kept its rules. Rebooted the VM and verified that the confirmed policy and managed Fail2ban instance returned.
parkel added this to the v0.5.0 - Operator workflows and deployment milestone 2026-11-22 00:37:20 +01:00
parkel added 2 commits 2026-11-22 00:37:20 +01:00
Document host firewall profiles and safe operation
Coulobre Panel CI / Checks (Python 3.12) (pull_request) Canceled after 0s
Coulobre Panel CI / Checks (Python 3.14) (pull_request) Canceled after 0s
402e531e48
parkel added the area/deploymentarea/hosting
kind
feature
labels 2026-11-22 00:37:20 +01:00
parkel merged commit 61f7a3f5cd into main 2026-11-22 00:38:57 +01:00
parkel deleted branch feature/host-firewall 2026-11-22 00:38:57 +01:00
Sign in to join this conversation.