Repository navigation
fix(deploy): give apt only the pinned Docker and Caddy keys on servers - #312
Conversation
The server installer checked the first fingerprint of each downloaded key file, then installed the whole file. A download holding the expected key followed by another one passed, and apt then trusted both. The file is now imported into a temporary keyring that must hold exactly the pinned key, and only gpg's export of that key is installed, as the control plane installer does since #310. Reading the keys no longer creates /root/.gnupg. Signed-off-by: samuel mbabhazi <[email protected]>
Signed-off-by: samuel mbabhazi <[email protected]>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
What changed
deploy/install.sh(the server installer): the Docker and Caddy key files are imported into a temporary keyring that must hold exactly the pinned key, and apt is given gpg's export of that key (shipkeep-docker.gpg,shipkeep-caddy.gpg) instead of the downloaded file. Reading the keys no longer creates/root/.gnupg.deploy/install_test.sh: checks of that function with generated keys.docs/SPEC.md,docs/THREAT_MODEL.md: one sentence each.Why
The installer compared the first fingerprint of each downloaded key file with the pinned one, then installed the whole file. A download holding the expected key followed by another key passed the check, and
Signed-Bythen made apt trust both. CodeRabbit found this in the control plane installer (#310), where it was fixed; the server installer had the same code for two keys. It needs whoever serves the key file to be malicious, so it is hard to exploit, and it defeats the point of pinning.How it was tested
In CI (
deploy/install_test.sh): the expected key alone is accepted and the keyring written is gpg's binary export with one primary key; a second key after, before or inside the same armored block, a wrong fingerprint, a file that is not a key and a missing file are refused, and no keyring is written. Three mutations of the function are each caught. The two real key files, downloaded on 16 November 2026, pass with their pinned fingerprints.By hand, on 16 November 2026: a control plane installed from the published
v0.1.0-alpha.2in a test container, then this installer run on a fresh Ubuntu 24.04 container with systemd and without Docker, with the arguments the Servers page passes (gateway, CA fingerprint, origin, agent checksums from that control plane's manifest) and the join token on standard input:/etc/apt/keyringsholds two binary keyrings with one primary key each, the pinned ones;apt-get updatesucceeds; Docker 29.9 and Caddy 2.11 are installed from those repositories; no/root/.gnupg; the token does not appear in the output.ready; a deployment ofdocker.io/traefik/whoami:v1.10.3succeeds and answers through the server's Caddy.Not tested: the command copied from the Servers page with this installer, since that needs an image built from this branch (the command wrapper is unchanged and only verifies the installer's checksum before running it); arm64; a real server.
Security considerations
This narrows what apt trusts and changes nothing else in the installer's behaviour. Servers installed with earlier versions keep their
.asckey files: they hold the same single keys today, so nothing has to be done on them. The fix reaches users with the next release image, which serves the installer.Summary by CodeRabbit
Bug Fixes
Documentation