Use
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.