heyer.systems Open Source

Use

Security

What every guest is protected by, what iac verifies before it installs something – and what it trusts.

In every guest

Loginroot with an SSH key only: PasswordAuthentication no, PermitRootLogin prohibit-password, 3 attempts and 20 seconds per connection. No X11 or agent forwarding – a compromised guest can’t use the keys of your agent; no port forwarding or tunnels – a stolen key doesn’t turn the guest into a proxy into your networks (allow it per guest: your own changes). The journal names the key of every login (LogLevel VERBOSE). No admin user and no sudo, no keys in images – the keys come with the deployment
Firewallnftables, incoming policy drop (below)
Secretsgenerated once per instance in /etc/iac/settings.env (0600) – never in a repository or an image
Sandboxservices of the apps run with ProtectSystem=strict, only their data writable, a syscall filter and no needless capabilities; the CI rejects a unit rated worse than 5.0 by systemd-analyze security. Exceptions (e.g. update, backup) are marked in the unit with a reason
Kernel(VM) kernel addresses and dmesg only for root, ptrace only on own children, no loading of another kernel at runtime (kexec), no SysRq keys, no BPF and no TTY line disciplines for users, no ICMP redirects or source routing, impossible source addresses logged; the protocols dccp, sctp, rds and tipc can’t be loaded; AppArmor active. Containers are unprivileged and take these from the host
Traceabilityetckeeper commits /etc before and after every update; every run is logged in /var/log/iac/iac.log

Firewall

  • Incoming: established connections, loopback, ICMP, DHCP and SSH (port 22) are allowed; everything else is dropped.
  • The app’s ports and those of active modules are opened per port – public for everyone, private only from 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7 and fe80::/10. 172.16.0.0/12 also contains Docker’s bridge networks: containers on the guest count as private.
  • From NetBox: every port – the app’s, a module’s or a new one – can be public, private, limited to a list of addresses or closed; SSH can be restricted but not closed. Those rules run in a chain of their own before all others, so they win over what the app or a module opens.
  • Your own rules: /etc/nftables.d/90-local.nft. Each file is checked with nft -c first, so a broken one leaves the old rules in place.
  • Web interfaces get TLS from a reverse proxy such as Traefik. Apps that are opened directly bring a self-signed certificate today – the internal CA WIP will replace it.

What iac verifies

SourceCheck
Debian packagesDebian’s signatures (apt)
Third-party APT repositoriesonly where an app needs one (Zammad, Elasticsearch, Jellyfin), key pinned in iac-core
Downloads of apps (GitHub, Codeberg, …)checksum of the release before anything is unpacked; no checksum, no download
npm packagesintegrity hashes of the registry
App versionsmost apps are pinned to a version the CI built and boot-tested; new releases are raised by pull request once they are 3 days old (a hijacked release is usually pulled by then – its checksum comes from the same release), majors wait for a review
VM imagesbuilt and booted in a test VM, smoke test green, then published with SHA256SUMS; vm.sh checks the checksum before the import

What iac trusts

Running iac means trusting this chain:

  • The one-liners (ct.sh, vm.sh, adopt.sh) run as root on the Proxmox host and load iac-core from git.heyer.systems. Feel free to read them first – they’re short and just load lib/host.func.
  • update loads iac-core (tag v2) and the app (branch main) over HTTPS from git.heyer.systems and runs them as root. Their integrity rests on TLS and on who may write to the organisation iac – there aren’t any signatures yet. With auto-update a change reaches every guest within a day; without it, only when you run update.
  • Image checksums come from the same server as the images: they catch broken downloads, not a compromised server.

Work in progress – planned, not available yet

Planned: signatures in addition to the checksums, checked by update and vm.sh.

Modules for more

Preselected for every new guest: auto-update, unattended-upgrades, fail2ban and security-report.

ModuleUse
auto-updatenightly update – Debian security updates and app updates without waiting for you
unattended-upgradesDebian security updates only, daily – also between two runs of auto-update, or alone without it
backuprestic to SFTP, S3, a REST server or a path – the way back after a mistake or an attack
fail2banblocks addresses after failed SSH logins
crowdsecdetects attacks in the logs and blocks them with nftables, with the community blocklist

Behind a reverse proxy, fail2ban in the guest would see nothing but the proxy – so those apps (or the nginx in front of them) limit failed logins themselves.