Manifests
Security Manifest
What every guest is protected by, what haypack verifies before it installs something – and what it trusts.
The Security Manifest explains the protections, verification rules and trust boundaries of the core foundation. App-specific services and ports are declared in the App Manifest.
In every guest
| Login | root 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 |
| Firewall | nftables, incoming policy drop (below) |
| Secrets | generated once per instance in /etc/iac/settings.env (0600) – never in a repository or an image |
| Sandbox | services 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 |
| Traceability | etckeeper 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
portsand those of active modules are opened per port –publicfor everyone,privateonly from10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,fc00::/7andfe80::/10.172.16.0.0/12also 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 orclosed; 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 withnft -cfirst, 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
| Source | Check |
|---|---|
| Debian packages | Debian’s signatures (apt) |
| Third-party APT repositories | only 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 packages | integrity hashes of the registry |
| App versions | most 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 images | built 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 haypack means trusting this chain:
- The one-liners (
ct.sh,vm.sh,adopt.sh) run as root on the Proxmox host and load iac-core fromgit.heyer.systems. Feel free to read them first – they’re short and just loadlib/host.func. updateloads iac-core (tagv2) and the app (branchmain) over HTTPS fromgit.heyer.systemsand runs them as root. Their integrity rests on TLS and on who may write to the organisationiac– there aren’t any signatures yet. With auto-update a change reaches every guest within a day; without it, only when you runupdate.- 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.
| Module | Use |
|---|---|
| auto-update | nightly update – Debian security updates and app updates without waiting for you |
| unattended-upgrades | Debian security updates only, daily – also between two runs of auto-update, or alone without it |
| backup | restic to SFTP, S3, a REST server or a path – the way back after a mistake or an attack |
| fail2ban | blocks addresses after failed SSH logins |
| crowdsec | detects 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.
For deployment-specific ports, use local firewall drop-ins rather than editing generated app rules.
Das Security-Manifest beschreibt Schutzmaßnahmen, Prüfungen und Vertrauensgrenzen der Core-Grundlage. App-spezifische Dienste und Ports stehen im App-Manifest.
In jedem Gastsystem
| Bereich | Schutz |
|---|---|
| Anmeldung | root ausschließlich per SSH-Schlüssel: PasswordAuthentication no, PermitRootLogin prohibit-password, drei Versuche und 20 Sekunden pro Verbindung. Kein X11-, Agent- oder Port-Forwarding und keine Tunnel. Ausnahmen pro Gast über eigene Änderungen. LogLevel VERBOSE protokolliert den verwendeten Schlüssel. Kein zusätzlicher Admin-Benutzer, kein sudo und keine Schlüssel im Image; Schlüssel kommen bei der Bereitstellung hinzu |
| Firewall | nftables mit eingehender Standardregel drop |
| Geheimnisse | Einmal pro Instanz erzeugt, in /etc/iac/settings.env mit Modus 0600; nicht in Repositories oder Images |
| Sandbox | App-Dienste mit ProtectSystem=strict, nur eigene Daten schreibbar, Syscall-Filter und keine unnötigen Capabilities. Die CI lehnt Units mit systemd-analyze security über 5.0 ab. Begründete Ausnahmen wie Update oder Backup sind in der Unit markiert |
| Kernel | In VMs: Kerneladressen und dmesg nur für root, ptrace nur für eigene Kindprozesse; kein kexec, SysRq, Benutzer-BPF oder Benutzer-TTY-Line-Discipline; keine ICMP-Redirects oder Source-Routes. Unplausible Quelladressen werden protokolliert. dccp, sctp, rds und tipc gesperrt; AppArmor aktiv. Unprivilegierte Container übernehmen den Kernel des Hosts |
| Nachvollziehbarkeit | etckeeper erfasst /etc vor und nach jedem Update; Logs unter /var/log/iac/iac.log |
Firewall
- Eingehend erlaubt: bestehende Verbindungen, Loopback, ICMP, DHCP und SSH auf Port 22. Sonst wird verworfen.
- Die
portsder App und aktiver Module öffnen einzelne Ports.publicgilt für alle;privatefür10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,fc00::/7undfe80::/10. Docker-Bridges innerhalb172.16.0.0/12gelten ebenfalls als privat. - NetBox-Regeln können jeden Port als public, private, auf bestimmte Adressen beschränkt oder closed festlegen. SSH darf eingeschränkt, aber nicht geschlossen werden. Die separate Chain greift vor den App- und Modulregeln.
- Eigene Regeln:
/etc/nftables.d/90-local.nft. Vor Übernahme prüftnft -cjede Datei; bei Fehlern bleiben die bisherigen Regeln bestehen. - Weboberflächen erhalten TLS üblicherweise über einen Reverse Proxy wie Traefik. Direkt erreichbare Apps verwenden derzeit ein selbst signiertes Zertifikat. Die geplante interne CA soll es ersetzen.
Was iac prüft
| Quelle | Prüfung |
|---|---|
| Debian-Pakete | Debian-Signaturen über apt |
| Fremde APT-Quellen | Nur bei Bedarf, etwa Zammad, Elasticsearch oder Jellyfin; Schlüssel in iac-core festgelegt |
| App-Downloads | Release-Prüfsumme vor dem Entpacken; ohne Prüfsumme kein Download |
| npm | Integritätshashes der Registry |
| App-Versionen | Meist auf eine gebaute und boot-getestete Version festgelegt. Neue Releases werden nach drei Tagen per Pull Request angehoben; Hauptversionen warten auf Review. Prüfsummen stammen aus demselben Release; eine verzögerte Übernahme ist kein vollständiger Schutz gegen kompromittierte Releases |
| VM-Images | In Test-VM gebaut und gestartet, Funktionstest bestanden, anschließend mit SHA256SUMS veröffentlicht. vm.sh prüft vor dem Import |
Wem iac vertraut
- Die Einzeiler
ct.shundvm.shlaufen als root auf Proxmox und laden iac-core vongit.heyer.systems.adopt.shwird im bestehenden Gast ausgeführt. Die kurzen Einstiegsskripte lassen sich vorab lesen. updatelädt iac-core mit Tag v2 und die App aus main per HTTPS und führt sie als root aus. Vertrauen beruht auf TLS und den Schreibberechtigungen der Organisation iac; zusätzliche Signaturen gibt es noch nicht. Mit auto-update erreicht eine Änderung Gäste innerhalb eines Tages, sonst beim nächsten manuellen Update.- Image und Prüfsumme stammen vom selben Server. Das erkennt Übertragungsfehler, schützt aber nicht vor einem kompromittierten Server.
Geplant: Zusätzliche Signaturen, die update und vm.sh prüfen.
Ergänzende Module
Für neue Gäste sind auto-update, unattended-upgrades, fail2ban und security-report vorausgewählt.
| Modul | Zweck |
|---|---|
| auto-update | Nächtliches Update von Debian, App und Konfiguration |
| unattended-upgrades | Tägliche Debian-Sicherheitsupdates, auch zwischen vollständigen Updates oder unabhängig davon |
| backup | restic-Sicherungen über SFTP, S3, REST oder einen lokalen Pfad |
| fail2ban | Adressen nach fehlgeschlagenen SSH-Anmeldungen sperren |
| crowdsec | Angriffe in Logs erkennen und mit nftables sowie Community-Sperrliste abwehren |
Hinter einem Reverse Proxy sähe fail2ban im Gast häufig nur dessen Adresse. Entsprechende Apps oder der vorgeschaltete nginx begrenzen fehlgeschlagene Anmeldungen deshalb selbst.
Installationsspezifische Ports über lokale Firewall-Dateien ergänzen, statt generierte App-Regeln zu ändern.