fix(snmp): open udp/161 in firewalld, not behind it #79

Merged
christianmanivong merged 3 commits from fix/snmp-firewalld into main 2026-11-12 11:34:15 +00:00
Owner

On a host running firewalld, the SNMP fix inserted an iptables ACCEPT for udp/161. firewalld's own nftables table rejects the packet anyway, so the step reported the port open while SNMP stayed blocked.

With firewalld active (systemctl is-active firewalld), _allow_snmp_sources now adds a rich rule per allowed source to the default zone and every active zone, at runtime and --permanent, each only when the zone lacks it. There is no --reload, which would drop runtime rules others keep (Docker). ufw and iptables hosts behave as before.

Tests: the step's commands on a firewalld host, plus the generated shell run against a stand-in firewall-cmd (zones, IPv4/IPv6, no duplicate rules). 408 passed; test_time_sync fails on main already (#78).

Closes #77

On a host running firewalld, the SNMP fix inserted an iptables ACCEPT for udp/161. firewalld's own nftables table rejects the packet anyway, so the step reported the port open while SNMP stayed blocked. With firewalld active (`systemctl is-active firewalld`), `_allow_snmp_sources` now adds a rich rule per allowed source to the default zone and every active zone, at runtime and `--permanent`, each only when the zone lacks it. There is no `--reload`, which would drop runtime rules others keep (Docker). ufw and iptables hosts behave as before. Tests: the step's commands on a firewalld host, plus the generated shell run against a stand-in `firewall-cmd` (zones, IPv4/IPv6, no duplicate rules). 408 passed; `test_time_sync` fails on main already (#78). Closes #77
christianmanivong added 1 commit 2026-11-12 11:15:24 +00:00
fix(snmp): open udp/161 in firewalld, not behind it
driver / standard (pull_request) Failing after 14s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 59s
driver / test (3.12) (pull_request) Failing after 1m1s
driver / test (3.13) (pull_request) Failing after 57s
driver / lowest (pull_request) Failing after 30s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Successful in 1m1s
CI / driver (pull_request) Failing after 2m29s
driver / publish (pull_request) Skipped
aab25fb049
On a host running firewalld, iptables is installed too, so the SNMP fix
inserted an iptables ACCEPT. firewalld keeps its own nftables table, whose
reject wins over it, and the step reported the port open while SNMP
stayed blocked.

With firewalld active, the step now adds a rich rule per allowed source to
the default zone (which takes interfaces in no zone, such as a WireGuard
interface) and to every active zone, at runtime and permanently, each only
when missing. No reload, which would drop rules others keep at runtime.

Closes #77
christianmanivong added 1 commit 2026-11-12 11:22:36 +00:00
refactor(snmp): the SNMP agent's helpers in a module of their own
driver / lint (pull_request) Successful in 13s
driver / standard (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m7s
driver / test (3.13) (pull_request) Failing after 1m2s
driver / test (3.12) (pull_request) Failing after 1m16s
driver / lowest (pull_request) Failing after 29s
driver / build (pull_request) Successful in 26s
driver / security (pull_request) Successful in 1m4s
CI / driver (pull_request) Failing after 2m20s
driver / publish (pull_request) Skipped
3683c85f21
linux.py had grown past its recorded size with the firewalld rule. The
snmpd.conf rendering, the install commands and the firewalld rule now
live in _snmp_agent.py; linux.py shrinks to 2014 lines and the baseline
records that.
christianmanivong added 1 commit 2026-11-12 11:31:15 +00:00
Merge remote-tracking branch 'origin/main' into fix/snmp-firewalld
driver / lint (pull_request) Successful in 12s
driver / standard (pull_request) Successful in 15s
driver / types (pull_request) Successful in 1m8s
driver / test (3.13) (pull_request) Successful in 1m2s
driver / test (3.12) (pull_request) Successful in 1m7s
driver / lowest (pull_request) Successful in 35s
driver / build (pull_request) Successful in 31s
driver / security (pull_request) Successful in 1m3s
CI / driver (pull_request) Successful in 2m20s
driver / publish (pull_request) Skipped
655d115324
# Conflicts:
#	tests/quality_baseline.json
christianmanivong merged commit 92ca800026 into main 2026-11-12 11:34:15 +00:00
christianmanivong deleted branch fix/snmp-firewalld 2026-11-12 11:34:15 +00:00
Sign in to join this conversation.