fix: the root CA is created by the server, an offline CA or a Simple CA service, chosen at setup; the shell can stay open in a tab of its own, the Docker page is offered only with Docker, and the test scripts are in bin/.
Release / release (push) Failing after 14m20s

This commit is contained in:
slawek committed 2026-11-23 06:45:23 +01:00
1 parent ff0c93ed73
commit a649331aa2
49 files changed
+1597 -637

No files matched your search

+60 -23
View File
@@ -259,9 +259,9 @@ P2S CA; with the VPN off a VPN user is created without a certificate, which it g
is switched on (ADR-57). Only the OpenVPN client profile needs OpenVPN to be enabled.
Consequences: slapd always holds the directory and the CAs exist on a configured router, even
when no P2S system uses them; with an offline root the P2S CA, and so the users' certificates,
wait for its certificate. An operator who wants a root CA of their own must place it before
choosing the platform.
when no P2S system uses them; with an offline or a Simple CA root the P2S CA, and so the users'
certificates, wait for its certificate. The source of the root, `pki.root`, is chosen with the
platform, before the root exists (ADR-27).
## ADR-11: Groups are groupOfNames entries that never become empty
@@ -752,19 +752,25 @@ timer's schedules are systemd's shorthands, so all backups of one schedule start
moment. A change of the users between the end of the copy and the next backup is in no backup
until then.
## ADR-27: A two-level CA with dedicated issuing CAs, whose root may be offline
## ADR-27: Dedicated issuing CAs under a root the server creates, an offline root, or a Simple CA root
Status: Accepted
Context: One self-signed CA signed every certificate of the server with the same server and
client purposes, so a certificate for any use was also a VPN client certificate, and the key
that signed everything had to stay on the server. The server needs CAs for the VPN clients, for
site-to-site certificates and for the administrator's own uses, and a root whose key can be kept
elsewhere. The `simple-ca` script handled one level and ran as a separate process with its own
state file.
site-to-site certificates and for the administrator's own uses. Its root is its own, a CA the
organisation keeps offline, or the root of the organisation's Simple CA service. Moving the key of a
root the server created off the server later protects nothing that was not exposed while it was
there. The `simple-ca` script handled one level and ran as a separate process with its own state
file.
Decision: The root signs only issuing CAs, path length 1; the issuing CAs, path length 0, sign
the certificates. `p2s` signs the server's VPN server certificate and the users' certificates,
Decision: `pki.root` chooses the root at setup, fixed once the root exists, as the directory
shows it: `local`, a root the server creates and keeps the key of, which signs only issuing CAs,
path length 1; `offline`, whose certificate and the certificates of the issuing CAs, signed
offline from the CSRs the server makes, are imported with `linux-manager-ca` or `/ca`, the root
first; `simple-ca`, a Simple CA service (ADR-59). The issuing CAs, path length 0, sign the
certificates. `p2s` signs the server's VPN server certificate and the users' certificates,
`s2s` the site-to-site certificates, and the CAs of `pki.issuing_cas` what their templates
allow. A template fixes the key, the lifetime, the key usages, the extended key usages, the kind
of common name and the subject alternative names a certificate may have; `vpn-server` and
@@ -772,10 +778,9 @@ of common name and the subject alternative names a certificate may have; `vpn-se
CA. The module `linuxmanager_pki.py`, with `python3-cryptography` from the Ubuntu archive, builds
the keys, certificates, CSRs and CRLs in the processes that need them, as the user module does
(ADR-6); the settings are the `pki` section of `linux-manager.json`, and the CAs and the
certificates are kept in the server's directory (ADR-32). Keeping the root key off the server is recommended, not required: while it is
on the server a new issuing CA is signed at once, and while it is not the CA gets its key and a
CSR, signed offline and imported with `linux-manager-ca` or `/ca`. The root key itself crosses
neither the API nor the Manager. For a certificate of something other than the server, the server
certificates are kept in the server's directory (ADR-32). A root the server creates keeps its key
there, with no command that exports or removes it; the key crosses neither the API nor the
Manager. For a certificate of something other than the server, the server
signs the requester's CSR, or makes the key and returns it once in a PKCS#12 file, keeping only
the certificate, so a key it gave away cannot leak from it later. The PKCS#12 file uses 3DES and
SHA-1 MACs, the encryption the key stores of Windows and macOS import. strongSwan reads only the
@@ -783,8 +788,10 @@ first certificate of a PEM file, so each CA has a file of its own in `/etc/swanc
IKEv2 access and site-to-site name their CA in `cacerts`, which restricts the trust chain to it.
Consequences: The P2S CA's certificates are accepted by IKEv2 and OpenVPN only, the site-to-site CA's by
site-to-site only. With an offline root, new issuing CAs and the root CRL need the offline step,
and a router whose P2S CA waits has no VPN server certificate and so no P2S access. The server
site-to-site only. With an offline root, the root certificate, new issuing CAs and the root CRL
need the offline step, and a router whose P2S CA waits has no VPN server certificate and so no
P2S access. A server whose root should be elsewhere is set up with that source from the start;
the source of an existing root is not changed. The server
keeps the users' keys, as the OpenVPN profile embeds them.
## ADR-28: CA certificates and CRLs are published at configurable endpoints, and CRLs are short-lived
@@ -850,7 +857,7 @@ Decision: An issuing CA of `pki.issuing_cas` with `acme` makes Caddy serve an AC
at `/acme/<name>/` of the HTTPS status port, each in a `handle` block of its own. The issuing CA's
certificate and key are given to Caddy as both the root and the intermediate of a `pki` CA, copied
to `/etc/caddy/linux-manager-pki/<name>/` for Caddy's group, so that the server's root key never
reaches Caddy and may be offline.
reaches Caddy.
Consequences: The certificates Caddy issues chain to the server's root through the issuing CA, are
not in the server's inventory, follow no template and are not revoked; their short lifetime takes
@@ -1582,17 +1589,47 @@ checks for and installs its updates through apt (ADR-24, ADR-53). A package copi
server and installed from a file tests none of that, and a rebuild of an unreleased changelog
entry keeps the same version, so apt sees no update.
Decision: `tests/remote/lxd-project.py` makes an LXD project for manual tests with networks of its
Decision: `bin/lm-dev-lxd-project.py` makes an LXD project for manual tests with networks of its
own (`features.networks`), a WAN and two LANs, and a container `repo` that serves a signed apt
repository, `resolute main`, built with `apt-ftparchive` and signed by its own key. The networks
are OVN networks on an uplink bridge of the remote, as OVN is the only network type LXD creates
inside a project; they belong to the project and go with it. `tests/remote/dev-build.py` builds the newest
changelog entry as `<upstream>~dev<N>-<revision>`, `N` counted in `tmp/test-number`, by passing
`DEB_VERSION` to the build, which rewrites the version in the image only, and publishes the build
in that repository. `tests/remote/vm.py` gives a VM of the project that repository as its apt
source. The automated tests (`run.py`) keep their own project for one run and install from a
file.
inside a project; they belong to the project and go with it. `bin/lm-dev-build.py` builds the newest
changelog entry as `<upstream>~dev<N>-<revision>`, `N` counted in `.dev-build.serial`, which a
release sets to 0, by passing `DEB_VERSION` to the build, which rewrites the version in the image
only, and publishes the build in that repository. `bin/lm-dev-vm.py` gives a VM of the project
that repository as its apt source. The automated tests (`lm-dev-run.py`) keep their own project
for one run and install from a file.
Consequences: Every dev build is an apt update of the one before, and the release of the entry,
which sorts above all of its `~dev` builds, is an update of them all. The changelog is not
changed by a dev build. Dev builds go to `out/dev/`, so `out/` holds only release builds.
## ADR-59: A Simple CA root signs the issuing CAs through a sign-ca token of its issuing CA
Status: Accepted
Context: An organisation with a Simple CA service wants its servers' issuing CAs under that root,
signed without a person carrying CSRs and certificates. Simple CA's tokens are JWTs signed by the
key of their CA; a one-time setup code is exchanged once for a token, so the token itself is never
handed over. A Simple CA root that signs the issuing CAs of every server directly would give each
server's token the power of the root.
Decision: Simple CA keeps a three-level hierarchy: its root, path length 2, signs an issuing CA,
path length 1, the upstream CA, which signs the server's issuing CAs, path length 0. The server
gets the setup code of a `sign-ca` token of the upstream CA at setup (debconf, written to
`/etc/linux-manager/pki-setup-code` and removed once used) or with `linux-manager-ca root
setup-code`, exchanges it at `/api/token-setup` over `https://` only, checked against the system's
trust store, where the administrator installs the CA of the service's certificate before setup,
and keeps the token and the
upstream CA's name on `cn=root` of the directory, unreadable to every account but root's socket,
as the keys are. Each issuing CA's CSR is signed at `/<upstream>/api/sign-ca`. The root and the
upstream CA are taken from the first chain Simple CA answers with, once the token's signature
verifies with the upstream CA's key, which ties the chain to the service that issued the token;
every later chain must match them. The upstream CA is `cn=upstream`, in every chain the server
gives; the root alone is the trust anchor. Their CRLs are fetched from the distribution points
of the certificates they signed, as Simple CA publishes them.
Consequences: A stolen token signs CAs under the upstream CA only, until it expires or is revoked
in Simple CA. An issuing CA waits while Simple CA cannot be reached or the token has expired, and
a new setup code renews the token. The server cannot revoke a retired issuing CA in Simple CA;
its notice says to. Clients see a chain one CA longer than with the other sources.