Pro
Certificates (internal CA) WIP
Certificates of your own CA for every guest – handed out by the NetBox provisioner or placed by hand. Every app keeps working without them.
Work in progress – planned, not available yet
This page describes how the feature is planned. It may still change; nothing on this page works in a guest yet.
Why
Normally a reverse proxy with Let’s Encrypt handles TLS for web interfaces. Some things don’t sit behind a proxy, though:
- apps you open directly, e.g. the web app of AI-Workstation – today with a self-signed certificate you have to click away;
- connections between services – central logs, metrics – where both sides should know who they talk to (client certificates; public CAs no longer issue those).
An internal CA covers both: your devices trust its root once, and each guest gets a certificate signed by it.
Three ways – every app works with all of them
| Your setup | What the guest uses |
|---|---|
| No CA | as today: the app creates a self-signed certificate |
| Own CA, no provisioner | you place the root and the guest’s certificate by hand (below), then update |
| Own CA + NetBox provisioning | the provisioner places both and renews the certificates |
A guest never relies on the provisioner – all it knows are fixed paths, and it doesn’t care who put the files there.
The paths in the guest
| Path | Content |
|---|---|
/etc/iac/ca/*.crt | roots the guest trusts. update adds them to the system’s trust store (update-ca-certificates); a deleted file disappears there with the next run |
/etc/iac/tls/key.pem | the guest’s private key – created in the guest, it never leaves it. Group ssl-cert (0640): services that need it are members |
/etc/iac/tls/cert.pem | the guest’s certificate with its chain, from any CA |
Apps with their own TLS always use these two files. Without a certificate of your CA, the first
run creates a self-signed one from the same key; your certificate later replaces just cert.pem,
and the services that use it reload.
By hand
Copy your root certificate (PEM) to
/etc/iac/ca/, e.g./etc/iac/ca/my-root.crt.Create the key and a request in the guest – the key stays there:
iac-tls csr myhost.intra.example.org 192.168.40.20 > myhost.csrSign
myhost.csrwith your CA, then install the certificate with its chain:iac-tls install < myhost.crt update # once: the root into the guest's trust store
iac-tls install checks that the certificate matches the key and is still valid before it
replaces the old one. To renew, repeat these steps before the certificate expires.
With the provisioner
The provisioner holds an intermediate of your CA and does the signing itself – no CA server, no ACME, no DNS challenge:
- It asks the node for a request from the guest (
iac-tls csrwith the names and IPs NetBox has for this VM). - It signs only if the names and IPs in the request match that VM in NetBox exactly.
- It hands the certificate back (
iac-tls install). Validity e.g. 30 days, for servers and as a client certificate. - It renews after two thirds of the validity, in its normal five-minute run.
The root comes from the config context iac in NetBox and is placed in new guests when they are
created, and in existing guests on the next run.
If the provisioner is down for longer than a certificate is valid, certificates expire: the services keep running, clients warn. Guests not in NetBox get no certificate automatically – place it by hand or add them to NetBox.
Create your CA
The root is created once, offline, and stays offline (password manager, USB stick). It signs only the intermediate. Give the root name constraints – only your internal domain and private networks – then even a stolen intermediate can’t issue certificates for other sites, although your devices trust the root.
| Root | Intermediate | |
|---|---|---|
| Lives | offline | in the provisioner (0600, sandboxed service) – or with you, if you sign by hand |
| Validity | long (e.g. 10 years) | shorter (e.g. 1–2 years); replace it if the provisioner is compromised, the root stays |
| Name constraints | e.g. intra.example.org, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 | inherits them |
Finally, import the root once on your computers and phones.
For app developers
Apps that serve TLS themselves (not behind a reverse proxy) use the helper role iac_tls of
iac-core instead of creating a self-signed certificate – see the
app reference.
Planned uses
- Web interfaces opened directly (AI-Workstation first).
- Central logs: every guest sends its journal (
systemd-journal-uploadfrom Debian) with its client certificate to a log server.
Zweck
Für Weboberflächen übernimmt meist ein Reverse Proxy mit Let’s Encrypt TLS. Direkt erreichbare Apps wie AI-Workstation sowie Verbindungen zwischen Diensten, etwa Logs oder Metriken mit Clientzertifikaten, benötigen ein eigenes Vertrauensmodell. Eine interne CA bietet dafür Stammzertifikate, denen deine Geräte einmal vertrauen, und signiert die Zertifikate der Gäste.
Diese Seite beschreibt eine geplante Funktion. Die nachfolgenden Befehle sind noch keine allgemeine Verfügbarkeitszusage.
Drei Betriebsarten
| Umgebung | Verhalten |
|---|---|
| Ohne CA | App erzeugt weiterhin ein selbst signiertes Zertifikat |
| Eigene CA ohne Provisioner | Stamm- und Gastzertifikat manuell ablegen, danach update |
| Eigene CA mit NetBox | Provisioner verteilt und erneuert Zertifikate |
Der Gast kennt nur feste Dateipfade und bleibt vom Provisioner unabhängig.
Pfade im Gast
| Pfad | Inhalt |
|---|---|
/etc/iac/ca/*.crt | Vertrauenswürdige Stammzertifikate. update-ca-certificates übernimmt sie beim Update; entfernte Dateien verschwinden beim nächsten Lauf aus dem Vertrauensspeicher |
/etc/iac/tls/key.pem | Im Gast erzeugter privater Schlüssel, der den Gast nie verlässt. Gruppe ssl-cert, Modus 0640; benötigende Dienste gehören zur Gruppe |
/etc/iac/tls/cert.pem | Gastzertifikat einschließlich Zertifikatskette |
Apps mit eigenem TLS verwenden diese Dateien. Ohne CA-Zertifikat wird zunächst ein selbst signiertes Zertifikat mit demselben Schlüssel erzeugt. Später wird nur cert.pem ersetzt; betroffene Dienste laden neu.
Manuelle Einrichtung
Stammzertifikat im PEM-Format nach
/etc/iac/ca/my-root.crtkopieren.Im Gast Schlüssel und Zertifikatsanfrage erzeugen; der Schlüssel bleibt dort:
iac-tls csr myhost.intra.example.org 192.168.40.20 > myhost.csrAnfrage mit deiner CA signieren und Zertifikat samt Kette installieren:
iac-tls install < myhost.crt update
iac-tls install prüft Gültigkeit und Übereinstimmung mit dem Schlüssel vor dem Austausch. Zur Verlängerung rechtzeitig wiederholen. update übernimmt einmalig das Stammzertifikat in den Vertrauensspeicher.
Mit Provisioner
Der Provisioner hält eine Zwischen-CA und signiert selbst, ohne CA-Server, ACME oder DNS-Challenge:
- Anfrage aus dem Gast über den Knoten abrufen, mit Namen und IPs aus NetBox.
- Nur signieren, wenn Namen und IPs exakt zur NetBox-VM passen.
- Zertifikat über
iac-tls installzurückgeben, etwa mit 30 Tagen Gültigkeit für Server- und Clientauthentifizierung. - Nach zwei Dritteln der Gültigkeit im normalen Fünf-Minuten-Lauf erneuern.
Das Stammzertifikat stammt aus dem Konfigurationskontext iac in NetBox. Neue Gäste erhalten es bei Erstellung, bestehende im nächsten Lauf. Bei längerem Provisioner-Ausfall laufen Dienste weiter, Zertifikate können jedoch ablaufen und Clients warnen. Gäste außerhalb NetBox erhalten kein automatisches Zertifikat; sie brauchen manuelle Einrichtung oder Aufnahme in NetBox.
Eigene CA erstellen
Die Root-CA einmal offline erzeugen und offline aufbewahren, etwa im Passwortmanager oder auf einem USB-Datenträger. Sie signiert ausschließlich die Zwischen-CA. Namensbeschränkungen sollten auf interne Domänen und private Netze begrenzen, damit auch eine gestohlene Zwischen-CA keine fremden Websites zertifizieren kann.
| Root-CA | Zwischen-CA | |
|---|---|---|
| Aufbewahrung | Offline | Im Provisioner mit Modus 0600 und Dienst-Sandbox oder bei manueller Signatur bei dir |
| Gültigkeit | Lang, etwa zehn Jahre | Kürzer, etwa ein bis zwei Jahre; bei kompromittiertem Provisioner ersetzen |
| Namensbeschränkung | Etwa intra.example.org, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 | Übernimmt die Beschränkungen |
Das Stammzertifikat einmal auf Computern und Smartphones importieren.
Für App-Entwickler
Direkt TLS anbietende Apps verwenden die Hilfsrolle iac_tls, statt selbst Zertifikate zu erzeugen. Siehe App-Manifest.
Geplante Nutzung
- Direkt erreichbare Weboberflächen, zunächst AI-Workstation.
- Zentrale Logs: Gäste senden ihr Journal mit
systemd-journal-uploadund Clientzertifikat an einen Logserver.