feat(zabbix): an active-only agent closes the port netOrk opened for it (NetOrk/netork#2693)

ufw, iptables and firewalld do not say who wrote a rule. opened_ports keeps a
root-owned record of the rules a driver opened, written only when the firewall
did not have the rule before, and read strictly. ZabbixAgentMixin's firewall
step calls the driver's optional _revoke_zabbix_agent_sources for an
active-only agent; a driver without it changes nothing and says why.
This commit is contained in:
christianmanivong committed 2026-11-26 08:14:56 +01:00
1 parent fb927e7255
commit ebd3255e5a
6 files changed
+570 -8

No files matched your search

+16
View File
@@ -7,6 +7,22 @@ recorded here; their history is the git log.
## [Unreleased]
### Added
- `opened_ports`: the record of the firewall rules netOrk opened on a host
(NetOrk/netork#2693). ufw, iptables and firewalld do not say who wrote a rule, so a
driver that opens a port in one of them appends the rule to `/var/lib/netork/opened-ports`
(root's, mode 644) -- only when the firewall did not have it before, so an identical rule
the operator wrote is never recorded. `parse_opened_ports_record` reads it strictly: not at
all where the directory or the file is not root's alone or is a symbolic link, and a line
that is not exactly a rule is reported, never acted on. `ufw_allow_recorded_command` and
`ufw_delete_command` are ufw's commands, which napalm-linux and napalm-proxmox share;
`revoked_output` says what closing removed and what it left for the port.
- `ZabbixAgentMixin._revoke_zabbix_agent_sources(settings)`, optional: for an `active_only`
agent, `configure_zabbix_agent`'s firewall step has the driver close what netOrk opened
for the agent on an earlier passive run, and nothing else (NetOrk/netork#2693). A driver
without it changes nothing and says that it cannot tell netOrk's rule from the
operator's.
## [4.42.0] - 2026-11-25
### Added