Report a failed evaluation of the network instead of an empty list #69

Merged
kevinheyer merged 2 commits from security-report-network-failure into main 2026-11-24 09:05:00 +01:00
Member

Baut auf PR #68 auf (enthält dessen Commit); nach dessen Merge bleibt nur der zweite Commit. Refs #42

Schlägt die Auswertung der lauschenden Ports in iac-security-report fehl, fiel der Bericht auf eine leere Liste zurück: "nichts lauscht", complete: true, kein Hinweis. Jetzt zählt das wie debsecan oder Lynis als gescheiterte Prüfung: complete ist false, die Zusammenfassung nennt "checks failed: network ports", das Ende des Berichts nennt ss -tulnp und nft -j list ruleset. Das Skript endet dann wie bei den anderen Prüfungen mit Exit 1.

Geprüft: im Dev-Container mit dem Modul: normaler Lauf complete=true; mit einem nft, das eine fehlerhafte Regel ausgibt, Exit 1, complete=false, Zusammenfassung nennt "network ports". tests/host.sh grün, check-modules.sh security-report grün, lint.sh grün. Nicht geprüft: Auswirkung auf iac-provisioner und iac-compliance bei complete: false.

Baut auf PR #68 auf (enthält dessen Commit); nach dessen Merge bleibt nur der zweite Commit. Refs #42 Schlägt die Auswertung der lauschenden Ports in iac-security-report fehl, fiel der Bericht auf eine leere Liste zurück: "nichts lauscht", `complete: true`, kein Hinweis. Jetzt zählt das wie debsecan oder Lynis als gescheiterte Prüfung: `complete` ist false, die Zusammenfassung nennt "checks failed: network ports", das Ende des Berichts nennt `ss -tulnp` und `nft -j list ruleset`. Das Skript endet dann wie bei den anderen Prüfungen mit Exit 1. Geprüft: im Dev-Container mit dem Modul: normaler Lauf complete=true; mit einem `nft`, das eine fehlerhafte Regel ausgibt, Exit 1, complete=false, Zusammenfassung nennt "network ports". `tests/host.sh` grün, `check-modules.sh security-report` grün, `lint.sh` grün. Nicht geprüft: Auswirkung auf iac-provisioner und iac-compliance bei `complete: false`.
Test the evaluation of Docker ports in the security report
All checks were successful
/ lint (push) Successful in 13s
/ lint (pull_request) Successful in 12s
da477c155b
The report finds Docker ports from the DNAT rules in nat/DOCKER, not from
a listener. That path (no docker-proxy, UDP, port ranges, IPv6, loopback)
had only run against sample data.

Record the nat tables of a Docker 26 with userland-proxy off and IPv6 on
(published: 8080/tcp, 5353/udp, 8100-8102/tcp, [::]:7070/tcp, and
127.0.0.1:9090/tcp) and evaluate them with the jq program of
iac-security-report in tests/host.sh. check-modules.sh runs a tests/host.sh
of a module after its smoke test. The guides name what counts.

Tested: tests/host.sh green and red when the DOCKER chain name or the
loopback filter is broken; tools/check-modules.sh security-report green
(smoke, idempotent, removal); tools/lint.sh green.
Report a failed evaluation of the network instead of an empty list
All checks were successful
/ lint (push) Successful in 19s
/ lint (pull_request) Successful in 17s
677097a1ee
When the jq program for the listening ports failed, iac-security-report
fell back to an empty list. The report then read "nothing listens" and
the guest looked clean, with complete=true and no hint.

Count it as a failed check like debsecan or Lynis: complete is false, the
summary says "checks failed: network ports" and the end of the report
names ss and nft for a look by hand. tests/host.sh also checks that a
malformed ruleset makes the evaluation fail.

Tested in a dev container with the module: a normal run is complete; with
an nft that prints a malformed rule the run exits 1, complete is false
and the summary names "network ports". tests/host.sh green;
tools/check-modules.sh security-report green; tools/lint.sh green.
Sign in to join this conversation.
No description provided.