Documentation
¶
Overview ¶
Package firewall implements the reconcile.Controller that converges internal/store's firewall_rules table onto the local host's ufw via internal/firewall. v1 only manages rules whose NodeID is the local node ("" sentinel); a remote-node rule is skipped and logged, not silently dropped, pending a future per-node agent RPC.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller converges the local host's ufw rules to match every firewall_rules row assigned to the control plane's own local node.
func New ¶
func New(ruleStore RuleStore, syncer Syncer, opts ...Option) *Controller
New builds a Controller.
func (*Controller) Reconcile ¶
Reconcile implements reconcile.Controller. It lists every desired firewall rule, builds the set this controller's local node should enforce, re-validates each against the required-ports allowlist as a defense-in-depth check (the API layer already refuses an unsafe rule at write time, so this should never trigger in practice), and syncs the remainder against ufw via Syncer.Sync.
type Option ¶
type Option func(*Controller)
Option configures optional Controller behavior.
func WithLogger ¶
WithLogger overrides the logger used for per-rule skip decisions. Defaults to slog.Default().
func WithRequiredPorts ¶
WithRequiredPorts overrides the ports internal/firewall.Validate refuses to close, defaulting to firewall.DefaultRequiredPorts. Pass the control plane's actually configured ports (management API, agent gRPC listener, ingress) rather than relying on the defaults whenever any of them were moved off their default address.