Reference
The guest
What every container and VM comes with, what lives where and where your own changes belong.
Access
- Log in only as root with an SSH key, without a password. A root password only exists with the module desktop – for RDP, not for SSH.
- Without network:
pct enter <ID>(container) or the serial consoleqm terminal <ID>(VM) on the Proxmox host. - Need more keys? Append them to
/root/.ssh/authorized_keys.
What every guest comes with
| Debian 13 | no third-party sources – unless an app needs one (Zammad, Elasticsearch, Jellyfin), then with a key pinned in iac-core; time zone Europe/Berlin |
| Firewall | nftables: incoming only SSH, the app’s ports and the ports of active modules – some only from private networks (Security) |
| Sandbox | the app’s services run in a systemd sandbox: only their data is writable, no needless privileges |
| Kernel | (VM) hardened sysctl values in /etc/sysctl.d/50-iac.conf, your own in 90-local.conf; modules a server does not need are blocked (/etc/modprobe.d/50-iac.conf: rare network protocols, USB and FireWire storage); a container takes all of it from the Proxmox host |
| Login | SSH keys only, a short warning at the console and before the SSH login (/etc/issue, /etc/issue.net – no host name, version or owner), UMASK 027 for new users |
| Modules | preselected for new guests: auto-update, unattended-upgrades, fail2ban, security-report – deselect them when creating the guest, or later with update --remove-modules |
| etckeeper | every change to /etc ends up in a Git repository (git -C /etc log) |
update | one command for all updates, nightly with auto-update (Update) |
| Ansible | from Debian, runs only locally and establishes the target state on install and update |
| Self-test | bash /var/lib/iac/src/core/bin/iac-smoke – the same test that runs before every image release |
Your own changes
Files that start with # managed by iac – do not edit belong to iac – each update resets them
to the target state. Put your own changes in the files haypack sets aside for that:
| What | Where |
|---|---|
| Firewall rules | /etc/nftables.d/90-local.nft |
| Kernel settings (VM) | /etc/sysctl.d/90-local.conf |
| SSH settings | /etc/ssh/sshd_config.d/90-local.conf – 10-iac.conf is read first and wins for its own options; read after yours and so changeable there: port forwarding is off (95-iac-forwarding.conf, allow it with AllowTcpForwarding local, best with PermitOpen 127.0.0.1:<port>), sessions (96-iac-sessions.conf: dead connections closed after 10 minutes, MaxSessions 4) |
| Settings of a service | systemctl edit <service> |
| App configuration | the local file the app names (e.g. traefik.local.yaml, configuration.local.py) |
| Settings and secrets of the instance | /etc/iac/settings.env, then update |
Opening an extra port, for example:
echo 'add rule inet iac input tcp dport 8443 accept' >> /etc/nftables.d/90-local.nft
systemctl reload nftables
What lives where
| Path | Content |
|---|---|
/etc/iac/instance.json | app, version, active modules, platform, versions of iac-core and the app – written by haypack after every successful run |
/etc/iac/settings.env | settings and generated secrets of this instance (root only, 0600) |
/var/lib/iac/src/ | iac-core and the app in the installed version |
/var/log/iac/iac.log | log of every installation and every update |
/var/backups/iac/ | backups adopt.sh made before an adoption |
/var/lib/iac/update.json | result of the last update: time, ok/failed, exit code (Update) |
Work in progress – planned, not available yet
The internal CA will add these paths:
| Path | Content |
|---|---|
/etc/iac/ca/*.crt | your own root certificates – the guest trusts them system-wide |
/etc/iac/tls/key.pem, cert.pem | the certificate of this guest; apps with their own TLS use it instead of a self-signed one |
When something doesn’t work
bash /var/lib/iac/src/core/bin/iac-smoke # what runs, what does not
tail -n 100 /var/log/iac/iac.log # last run
IAC_VERBOSE=1 bash /var/lib/iac/src/core/bin/iac-install # target state again, with all details
Running iac-install again is harmless – all it does is establish the target state.
For additional service ports, see Local firewall rules and the firewall tutorial.
Zugang
- Anmeldung als root per SSH-Schlüssel, ohne Passwort. Ein root-Passwort gibt es nur beim Desktop-Modul für RDP, nicht für SSH.
- Ohne Netzwerk auf dem Proxmox-Host:
pct enter <ID>für Container,qm terminal <ID>für die serielle VM-Konsole. - Weitere öffentliche Schlüssel an
/root/.ssh/authorized_keysanhängen.
Gemeinsame Ausstattung
| Bereich | Inhalt |
|---|---|
| Debian 13 | Fremdquellen nur bei App-Bedarf; Schlüssel in iac-core festgelegt. Zeitzone Europe/Berlin |
| Firewall | nftables: eingehend SSH, App- und Modulports; teilweise nur aus privaten Netzen. Siehe Security-Manifest |
| Sandbox | App-Dienste mit systemd-Sandbox, nur eigene Daten schreibbar und ohne unnötige Rechte |
| Kernel | VM: gehärtete sysctl-Werte in /etc/sysctl.d/50-iac.conf, lokale Ergänzungen in 90-local.conf. Nicht benötigte Protokolle und USB-/FireWire-Speicher über /etc/modprobe.d/50-iac.conf gesperrt. Container nutzen den Host-Kernel |
| Anmeldung | SSH-Schlüssel; kurzer Hinweis in /etc/issue und /etc/issue.net ohne Hostname, Version oder Eigentümer. UMASK 027 für neue Benutzer |
| Module | auto-update, unattended-upgrades, fail2ban und security-report vorausgewählt; beim Erstellen abwählen oder später mit update --remove-modules entfernen |
| etckeeper | Änderungen in /etc im Git-Repository: git -C /etc log |
| Update | Gemeinsamer Befehl für alle Aktualisierungen; mit auto-update nachts |
| Ansible | Aus Debian, ausschließlich lokale Ausführung bei Installation und Update |
| Selbsttest | bash /var/lib/iac/src/core/bin/iac-smoke, derselbe Test wie vor Image-Veröffentlichungen |
Eigene Änderungen
Dateien mit # managed by iac – do not edit werden bei Updates auf den Zielzustand zurückgesetzt. Eigene Änderungen gehören in die vorgesehenen Dateien:
| Anpassung | Ort |
|---|---|
| Firewall | /etc/nftables.d/90-local.nft |
| Kernel, nur VM | /etc/sysctl.d/90-local.conf |
| SSH | /etc/ssh/sshd_config.d/90-local.conf. 10-iac.conf wird zuerst gelesen und gewinnt bei seinen Optionen. Später gelesen werden 95-iac-forwarding.conf und 96-iac-sessions.conf, deren Vorgaben lokal überschrieben werden können: Forwarding aus; bei Bedarf AllowTcpForwarding local, möglichst mit PermitOpen 127.0.0.1:<port>. Tote Sitzungen nach zehn Minuten schließen, MaxSessions 4 |
| Dienst | systemctl edit <service> |
| App-Konfiguration | Von der App genannte lokale Datei, etwa traefik.local.yaml oder configuration.local.py |
| Instanzeinstellungen und Geheimnisse | /etc/iac/settings.env, danach update |
Beispiel für einen zusätzlichen Port:
echo 'add rule inet iac input tcp dport 8443 accept' >> /etc/nftables.d/90-local.nft
systemctl reload nftables
Wichtige Pfade
| Pfad | Inhalt |
|---|---|
/etc/iac/instance.json | App, Version, aktive Module, Plattform sowie Core-/App-Versionen; nach erfolgreichem Lauf geschrieben |
/etc/iac/settings.env | Instanzeinstellungen und erzeugte Geheimnisse, nur root, Modus 0600 |
/var/lib/iac/src/ | Installierte Quellen von iac-core und App |
/var/log/iac/iac.log | Installations- und Updatelog |
/var/backups/iac/ | Vor einer Übernahme angelegte Sicherungen |
/var/lib/iac/update.json | Zeitpunkt, Status und Exit-Code des letzten Updates |
Geplant mit der internen CA: /etc/iac/ca/*.crt für systemweit vertraute Stammzertifikate sowie /etc/iac/tls/key.pem und cert.pem für das Gastzertifikat. Details: Zertifikate.
Fehler untersuchen
bash /var/lib/iac/src/core/bin/iac-smoke
tail -n 100 /var/log/iac/iac.log
IAC_VERBOSE=1 bash /var/lib/iac/src/core/bin/iac-install
Erneutes iac-install stellt wieder den Zielzustand her; es ist keine Neuinstallation mit Datenlöschung.
Zusätzliche Dienstports erklären Lokale Firewallregeln und das Firewall-Tutorial.