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://iac.heyer.systems/<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.