Security report
Weekly report in /var/lib/iac/security-report.txt: vulnerabilities of the Debian packages that already have a fix (debsecan), services and kernel waiting for a restart (needrestart), warnings of a Lynis audit. By mail with the module mail-relay. Now: iac-security-report
Add to a guest
In the guest as root – container and VM alike:
update --add-modules security-reportRuns a normal update and installs the module on the way.
From the Proxmox node, without logging in:
pct exec <ID> -- update --add-modules security-report # container
ssh root@<IP> update --add-modules security-reportChoose when creating a guest
Without a dialog, on the Proxmox node:
IAC_NONINTERACTIVE=1 var_modules=auto-update,security-report \
bash -c "$(curl -fsSL https://haypack.dev/<app>/ct.sh)"var_modules replaces the app's preselection – keep auto-update in the list if you want it. Interactive: choose “advanced” in the dialog, or tick the module in the generator on the app page.
Remove
update --remove-modules security-reportRemoves the module's packages, services, firewall rules and configuration again. Data stays.
Details
Checks the guest every week and writes a report to /var/lib/iac/security-report.txt – with
the module mail-relay it also goes to root by mail (mail_root_to). All tools come from
Debian:
| Part | Tool | What it shows |
|---|---|---|
| Vulnerabilities | debsecan | installed packages with a known vulnerability (CVE) that Debian has fixed already – data from the Debian Security Tracker |
| Other sources | apt-cache policy, /etc/apt/sources.list.d/ | packages installed from another source (NodeSource, PGDG, …) or without one, and APT sources iac does not manage – debsecan cannot judge them, update does not update them |
| Restart needed | needrestart | services that still run with replaced libraries, and a new kernel that waits for a reboot (VM) |
| Hardening | Lynis | a hardening index (0–100), warnings and suggestions on the configuration |
| Access | sshd, ssh-keygen, the accounts | SSH keys of every account that can log in (DSA and RSA below 3072 bits marked weak), the sshd settings in effect, accounts with a login shell and whether they have a password, sudo, the admin accounts of the app |
| Network | ss, nft, dpkg -S | every port that listens beyond loopback with its process, service (unit) and package, and what the firewall does with it: open, restricted to addresses, closed, docker (published by Docker past the firewall), or unknown (the rules cannot be read); whether the firewall of iac is loaded, other nftables tables (Docker, …) and rule files iac did not write. Judging it against what the app and its modules document is up to iac-compliance |
| Failed logins | fail2ban (module) | per jail in the last 7 days: failures, bans and the addresses banned – as numbers |
| Disk space | disk-space (module) | every local file system – ok, low or critical, with free space, inodes and the rate it fills; low and critical ones also in the summary |
| Time | timedatectl, chronyc tracking | whether the clock is synchronized; a VM with source, stratum and offset of chrony, an LXC the state of its node (it shares the node’s kernel and clock); clock not synchronized also in the summary |
Read it
cat /var/lib/iac/security-report.txt # the last report
iac-security-report # check now (takes about a minute)
systemctl list-timers iac-security-report.timer # next run (Mondays, 05:00–06:00)
The first line sums it up, e.g.:
Security report of web1.example.org – 2026-10-26 05:23 CET
2 fixable vulnerabilities, 1 services to restart, reboot needed: no, 1 Lynis warnings, 3 fail2ban bans in 7 days
What to do
- Vulnerabilities: run
update– or let the modulesauto-updateorunattended-upgradesdo it. Vulnerabilities without a fix in Debian are not listed; nothing can be done about them in the guest. - Packages and APT sources outside Debian and iac: their CVEs are not counted – debsecan
compares them with Debian’s versions, which says nothing about theirs (a Node.js 20.20.2 from
NodeSource has the fix Debian’s tracker asks for). Remove what the guest does not need; what it
needs is kept up to date by its own source. iac manages third-party sources only centrally
(
iac-core/apt/, marked# managed by iac). - Services to restart:
systemctl restart <service>– the report names the command. iac never restarts them on its own; needrestart only lists them, also after anupdate. - Reboot: a new kernel only takes effect after
reboot– iac never reboots by itself. With NetBox: the field Reboot needed and the tagiac-reboot-now. Ten minutes after every boot the report runs again (without a mail), so it no longer asks for the reboot that just happened. If an install orupdateis still running, the report waits for its end. - Lynis: warnings deserve a look, suggestions are hints. Details on one:
lynis show details <ID>. Lynis’ hint “release is more than 4 months old” (LYNIS) is left out: it checks Lynis’ own version, and the Debian package stays at its version. - Access: each key should belong to someone who still needs it – remove the others from
/root/.ssh/authorized_keys. Replace weak keys (ssh-keygen -t ed25519). An account with a password or a sudo rule that nobody remembers deserves a look. - Network: a listening port that nobody documents deserves a look – close the service or the port. closed means the firewall blocks a port the service listens on (harmless, but the service may be unneeded). Docker opens ports past the firewall of iac: the report lists every published port as docker (ports bound to loopback are left out, TCP, UDP, port ranges and IPv6 count, with or without
docker-proxy; the container behind a port:docker ps). - fail2ban: bans on a guest that is reachable from the internet are normal – many from few
addresses, or failures on a guest that only the LAN reaches, deserve a look. Failures are the
log lines fail2ban counted, one login attempt can make two. The addresses stay in the guest:
fail2ban-client status sshd,zgrep ' Ban ' /var/log/fail2ban.log*. Without the module fail2ban the part is missing; when fail2ban is installed but stopped, the report says so. - Disk space: the report runs the check of the module disk-space anew. Low or critical
file systems show up in the summary (
disk space: 1 critical, 0 low); the limits and how to read it are in disk-space. Its mails come on their own, when a level changes. Without the module the part says not checked. - Time: on a VM
chronyc sourcesshows which servers chrony reaches – the pool of Debian orntp_servers. An LXC has the clock of its node: when it is not synchronized, check the node (pve.shchecks its time, too). Right after a boot chrony may need a moment.
In NetBox
Next to the text, the report writes /var/lib/iac/security.json – the vulnerabilities with and
without a fix in Debian, restarts, Lynis findings with their ID, access (keys, sshd, accounts,
sudo), the network (listening ports with unit, package and firewall state), fail2ban, disk space and the clock (clock) as data. Every vulnerability lists the running services (units) that have a file of its package loaded – a library like libssl3 shows which service to restrict. After every update it runs again in the
background (without a mail), so the state is current. With
iac-provisioner the CVEs show up on the VM in NetBox
– search a CVE over all guests, and run the report on many guests at once with the tag
iac-security-report-now.
Lynis tests left out
Some Lynis tests do not fit an iac guest. The module writes them to /etc/lynis/custom.prf
(skip-test=…); Lynis then leaves them out of the findings and of the hardening index:
| Tests | Why they do not fit |
|---|---|
| AUTH-9230, AUTH-9262, AUTH-9282, AUTH-9286 | password rules – guests have no password logins, root logs in with SSH keys only |
| DEB-0810, DEB-0811, PKGS-7394 | tools for upgrades by hand – update and unattended-upgrades do them, debsecan reports the vulnerabilities |
| DEB-0880 | fail2ban: iac writes jail.d/iac.conf, own jails go to jail.d/*.local – no jail.local needed |
| FILE-6310 | separate partitions for /home, /var, /tmp – a guest has one root file system |
| DEB-0280 | libpam-tmpdir – only root works in the guest |
| SSH-7408:PORT | SSH on port 22 – another port only hides it; keys only, fail2ban and the firewall protect it (the other SSH options are checked) |
| KRNL-5788, KRNL-6000, NETW-3200, USB-1000, STRG-1846, TIME-3104 | container only: kernel, sysctl values, kernel modules and the clock belong to the Proxmox host (a VM sets them itself) |
| BOOT-5122 | VM only: a GRUB password – who reaches the console of a VM is in Proxmox already |
| KRNL-6000:KERNEL.MODULES_DISABLED | VM only: it forbids loading modules after boot – Docker, KVM and nftables extensions would fail; unneeded modules are blocked one by one instead |
What iac does about other findings: a login banner at the console and before the SSH login
(BANN-7126, BANN-7130), UMASK 027 (AUTH-9328), on a VM no USB or FireWire storage (USB-1000,
STRG-1846), SSH sessions with TCPKeepAlive no, ClientAliveInterval 300 and MaxSessions 4
(SSH-7408), /etc/crontab, sshd_config and the cron directories readable by root only
(FILE-7524), no unused Postfix in a container (MAIL-8818), the unchanged configuration of removed
packages purged by update (PKGS-7346 – an edited file stays, someone may still use it), the PostgreSQL configuration readable by postgres only (DBS-1828).
The findings come with the details Lynis gives – the SSH option, the sysctl keys, the files – so
NetBox shows what to change. Lynis does not refresh the package lists itself
(refresh-repositories=no) – that would run apt-get update while apt may be installing.
Your own exceptions: /etc/lynis/custom.local.prf, one skip-test=<ID> per line, then update
– the module adds them to custom.prf.
What it does not cover
Only Debian packages are checked. Apps that iac installs from a release on GitHub, Codeberg or npm do not appear – their version is pinned in the app and raised by iac when it was tested.
When the module is removed, debsecan, needrestart, Lynis and the report go again;
/etc/lynis/custom.local.prf stays.
Prüft den Gast jede Woche und schreibt einen Bericht nach /var/lib/iac/security-report.txt –
mit dem Modul mail-relay geht er auch per Mail an root (mail_root_to). Alle Werkzeuge kommen
aus Debian:
| Teil | Werkzeug | Was er zeigt |
|---|---|---|
| Schwachstellen | debsecan | installierte Pakete mit einer bekannten Schwachstelle (CVE), die Debian schon behoben hat – Daten aus dem Debian Security Tracker |
| Andere Quellen | apt-cache policy, /etc/apt/sources.list.d/ | Pakete aus einer anderen Quelle (NodeSource, PGDG, …) oder ganz ohne Quelle sowie APT-Quellen, die iac nicht verwaltet – debsecan kann sie nicht beurteilen, update aktualisiert sie nicht |
| Neustart nötig | needrestart | Dienste, die noch mit ersetzten Bibliotheken laufen, und ein neuer Kernel, der auf einen Neustart wartet (VM) |
| Härtung | Lynis | ein Härtungsindex (0–100), Warnungen und Vorschläge zur Konfiguration |
| Zugang | sshd, ssh-keygen, die Konten | SSH-Schlüssel jedes Kontos, das sich anmelden kann (DSA und RSA unter 3072 Bit als schwach markiert), die wirksamen sshd-Einstellungen, Konten mit Login-Shell und ob sie ein Passwort haben, sudo, die Admin-Konten der App |
| Netzwerk | ss, nft, dpkg -S | jeder Port, der außerhalb von Loopback lauscht, mit Prozess, Dienst (Unit) und Paket, und was die Firewall damit macht: offen, auf Adressen beschränkt, gesperrt, docker (von Docker an der Firewall vorbei veröffentlicht) oder unknown (die Regeln sind nicht lesbar); ob die Firewall von iac geladen ist, weitere nftables-Tabellen (Docker, …) und Regeldateien, die iac nicht geschrieben hat. Die Bewertung gegen das, was App und Module dokumentieren, macht iac-compliance |
| Fehlgeschlagene Anmeldungen | fail2ban (Modul) | pro Jail in den letzten 7 Tagen: Fehlversuche, Sperren und gesperrte Adressen – als Zahlen |
| Speicherplatz | disk-space (Modul) | jedes lokale Dateisystem – ok, knapp oder kritisch, mit freiem Platz, Inodes und Tempo, in dem es vollläuft; knappe und kritische auch in der Zusammenfassung |
| Zeit | timedatectl, chronyc tracking | ob die Uhr synchron ist; eine VM mit Quelle, Stratum und Abweichung von chrony, ein LXC den Zustand seines Node (er teilt Kernel und Uhr des Node); clock not synchronized auch in der Zusammenfassung |
Ablesen
cat /var/lib/iac/security-report.txt # der letzte Bericht
iac-security-report # jetzt prüfen (dauert etwa eine Minute)
systemctl list-timers iac-security-report.timer # nächster Lauf (montags, 05:00–06:00)
Die erste Zeile fasst zusammen, etwa:
Security report of web1.example.org – 2026-10-26 05:23 CET
2 fixable vulnerabilities, 1 services to restart, reboot needed: no, 1 Lynis warnings, 3 fail2ban bans in 7 days
Was zu tun ist
- Schwachstellen:
updateausführen – oder die Moduleauto-updateoderunattended-upgradesdas erledigen lassen. Schwachstellen ohne Fix in Debian werden nicht aufgeführt; im Gast lässt sich gegen sie nichts tun. - Pakete und APT-Quellen außerhalb von Debian und iac: Ihre CVEs werden nicht gezählt –
debsecan vergleicht sie mit Debians Versionen, und das sagt nichts über ihre eigenen aus (ein
Node.js 20.20.2 von NodeSource enthält den Fix, den Debians Tracker verlangt). Entfernen, was der
Gast nicht braucht; was er braucht, hält seine eigene Quelle aktuell. Fremde Quellen verwaltet
iac nur zentral (
iac-core/apt/, gekennzeichnet mit# managed by iac). - Neu zu startende Dienste:
systemctl restart <dienst>– der Bericht nennt den Befehl. iac startet sie nie von selbst neu; needrestart listet sie nur auf, auch nach einemupdate. - Neustart: Ein neuer Kernel wirkt erst nach
reboot– iac startet nie von selbst neu. Mit NetBox: das Feld Reboot needed und der Tagiac-reboot-now. Zehn Minuten nach jedem Start läuft der Bericht erneut (ohne Mail), damit er nicht mehr nach dem Neustart fragt, der gerade stattgefunden hat. Läuft gerade eine Installation oder einupdate, wartet der Bericht auf dessen Ende. - Lynis: Warnungen verdienen einen Blick, Vorschläge sind Hinweise. Details zu einem davon:
lynis show details <ID>. Der Hinweis von Lynis „release is more than 4 months old“ (LYNIS) fehlt im Bericht: Er prüft die eigene Version von Lynis, und das Debian-Paket bleibt bei seiner Version. - Zugang: Jeder Schlüssel sollte jemandem gehören, der ihn noch braucht – die anderen aus
/root/.ssh/authorized_keysentfernen. Schwache Schlüssel ersetzen (ssh-keygen -t ed25519). Ein Konto mit Passwort oder eine sudo-Regel, an die sich niemand erinnert, verdient einen Blick. - Netzwerk: Ein lauschender Port, den niemand dokumentiert hat, verdient einen Blick – Dienst oder Port schließen. closed heißt: Die Firewall sperrt einen Port, auf dem der Dienst lauscht (harmlos, aber der Dienst ist vielleicht überflüssig). Docker öffnet Ports an der Firewall von iac vorbei: der Bericht nennt jeden veröffentlichten Port als docker (an Loopback gebundene fehlen, TCP, UDP, Portbereiche und IPv6 zählen, mit und ohne
docker-proxy; der Container hinter einem Port:docker ps). - fail2ban: Sperren auf einem Gast, der aus dem Internet erreichbar ist, sind normal – viele
von wenigen Adressen oder Fehlversuche auf einem Gast, den nur das LAN erreicht, verdienen einen
Blick. Fehlversuche sind die Logzeilen, die fail2ban gezählt hat; ein Anmeldeversuch kann zwei
ergeben. Die Adressen bleiben im Gast:
fail2ban-client status sshd,zgrep ' Ban ' /var/log/fail2ban.log*. Ohne das Modul fail2ban fehlt der Teil; ist fail2ban installiert, aber gestoppt, sagt der Bericht das. - Speicherplatz: Der Bericht führt die Prüfung des Moduls disk-space neu aus. Knappe oder
kritische Dateisysteme erscheinen in der Zusammenfassung (
disk space: 1 critical, 0 low); die Grenzen und wie man sie abliest, stehen bei disk-space. Dessen Mails kommen eigenständig, wenn sich eine Stufe ändert. Ohne das Modul steht im Teil not checked. - Zeit: Auf einer VM zeigt
chronyc sources, welche Server chrony erreicht – den Debian-Pool oderntp_servers. Ein LXC hat die Uhr seines Node: Ist sie nicht synchron, den Node prüfen (pve.shprüft auch seine Uhrzeit). Direkt nach dem Boot braucht chrony einen Moment.
In NetBox
Neben dem Text schreibt der Bericht /var/lib/iac/security.json – die Schwachstellen mit und ohne
Fix in Debian, Neustarts, Lynis-Befunde mit ihrer ID, Zugang (Schlüssel, sshd, Konten, sudo),
das Netzwerk (lauschende Ports mit Unit, Paket und Firewall-Stand), fail2ban, Speicherplatz und die Uhr (clock) als Daten. Jede Schwachstelle nennt die laufenden Dienste (units), die eine Datei ihres Pakets geladen haben – bei einer Bibliothek wie libssl3 sieht man, welchen Dienst man einschränkt. Nach jedem update läuft er im Hintergrund erneut (ohne
Mail), damit der Stand aktuell ist. Mit
iac-provisioner erscheinen die CVEs an der VM in
NetBox – eine CVE lässt sich über alle Gäste suchen, und der Tag iac-security-report-now führt
den Bericht auf vielen Gästen auf einmal aus.
Ausgelassene Lynis-Tests
Einige Lynis-Tests passen nicht zu einem iac-Gast. Das Modul schreibt sie nach
/etc/lynis/custom.prf (skip-test=…); Lynis lässt sie dann bei den Befunden und beim
Härtungsindex aus:
| Tests | Warum sie nicht passen |
|---|---|
| AUTH-9230, AUTH-9262, AUTH-9282, AUTH-9286 | Passwortregeln – Gäste haben keine Passwort-Anmeldungen, root meldet sich nur mit SSH-Schlüsseln an |
| DEB-0810, DEB-0811, PKGS-7394 | Werkzeuge für Upgrades von Hand – update und unattended-upgrades erledigen sie, debsecan meldet die Schwachstellen |
| DEB-0880 | fail2ban: iac schreibt jail.d/iac.conf, eigene Jails gehören nach jail.d/*.local – kein jail.local nötig |
| FILE-6310 | eigene Partitionen für /home, /var, /tmp – ein Gast hat ein Root-Dateisystem |
| DEB-0280 | libpam-tmpdir – im Gast arbeitet nur root |
| SSH-7408:PORT | SSH auf Port 22 – ein anderer Port versteckt ihn nur; nur Schlüssel, fail2ban und die Firewall schützen ihn (die anderen SSH-Optionen werden geprüft) |
| KRNL-5788, KRNL-6000, NETW-3200, USB-1000, STRG-1846, TIME-3104 | nur Container: Kernel, sysctl-Werte, Kernelmodule und die Uhr gehören dem Proxmox-Host (eine VM setzt sie selbst) |
| BOOT-5122 | nur VM: ein GRUB-Passwort – wer die Konsole einer VM erreicht, ist schon in Proxmox |
| KRNL-6000:KERNEL.MODULES_DISABLED | nur VM: verbietet das Laden von Modulen nach dem Start – Docker, KVM und nftables-Erweiterungen würden scheitern; nicht benötigte Module werden stattdessen einzeln gesperrt |
Was iac gegen andere Befunde tut: ein Anmeldebanner an der Konsole und vor der SSH-Anmeldung
(BANN-7126, BANN-7130), UMASK 027 (AUTH-9328), auf einer VM kein USB- oder FireWire-Speicher
(USB-1000, STRG-1846), SSH-Sitzungen mit TCPKeepAlive no, ClientAliveInterval 300 und
MaxSessions 4 (SSH-7408), /etc/crontab, sshd_config und die Cron-Verzeichnisse nur für root
lesbar (FILE-7524), kein ungenutztes Postfix in einem Container (MAIL-8818), die unveränderte
Konfiguration entfernter Pakete räumt update weg (PKGS-7346 – eine bearbeitete Datei bleibt,
vielleicht nutzt sie noch jemand), die PostgreSQL-Konfiguration nur für postgres lesbar (DBS-1828).
Die Befunde kommen mit den Details, die Lynis liefert – die SSH-Option, die sysctl-Schlüssel, die
Dateien –, damit NetBox zeigt, was zu ändern ist. Die Paketlisten aktualisiert Lynis nicht selbst
(refresh-repositories=no) – das wäre ein apt-get update, während apt vielleicht gerade
installiert.
Eigene Ausnahmen: /etc/lynis/custom.local.prf, ein skip-test=<ID> pro Zeile, danach update –
das Modul übernimmt sie in custom.prf.
Was er nicht abdeckt
Geprüft werden nur Debian-Pakete. Apps, die iac aus einem Release auf GitHub, Codeberg oder npm installiert, erscheinen nicht – ihre Version ist in der App festgelegt und wird von iac angehoben, wenn sie getestet ist.
Wird das Modul entfernt, verschwinden debsecan, needrestart, Lynis und der Bericht wieder;
/etc/lynis/custom.local.prf bleibt.