feat: add firewall enforcement status checking to policy apply with datacenter/node/guest/interface validation and warning collection

Add cluster_firewall_options_url and node_firewall_options_url helpers to build firewall options endpoint paths, implement config_interface_status to parse network interface firewall flags from VM/LXC config with bridge/firewall/raw fields, add firewall_enforcement_status to check enable status across datacenter/node/guest levels and validate interface firewall flags with warning collection for disabled settings, extend apply_rules response with enforcement_
This commit is contained in:
2026-07-09 21:16:13 +02:00
parent 35ffcb6768
commit da60155710
2 changed files with 67 additions and 0 deletions
+4
View File
@@ -34,6 +34,10 @@ class FakeAsyncClient:
async def get(self, url: str, **__: object) -> FakeResponse:
if url.endswith("/config"):
return FakeResponse({"net0": "virtio=AA:BB:CC:DD:EE:FF,bridge=vmbr0,firewall=0", "name": "web"})
if url.endswith("/cluster/firewall/options"):
return FakeResponse({"enable": 1})
if url.endswith("/firewall/options"):
return FakeResponse({"enable": 1})
return FakeResponse(
[
{"pos": 0, "comment": "manual rule"},