A shared private key ships inside the layer #8
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/keel-core#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
turnkey-sslpackage ships a private key inside the .deb, identical onevery image built from this layer.
Verified on the
wordpress-democontainer, 2026-09-28:The key and the certificate match (same modulus digest), the file is
world-readable, and the certificate expired over a year ago.
Not currently exploited on this appliance.
15regen-sslcertdid run andthe key in service is a different one:
/etc/ssl/private/cert.key, mode0400,CN=wordpress-demo, valid to 2036. The shipped key is dead weighthere.
Why it is still a defect.
docs/traps.mdrecords15regen-sslcertas oneof the hooks that fails when a container blocks on its own console, alongside
95secupdates. So there is a plausible path to an appliance serving TLS with aprivate key that is published in a package and a certificate that expired in
2025 — and nothing detects it. The failure is silent: the service starts, the
port answers, and only the certificate tells you.
What closes this
it does not exist.
must say so, loudly. A first-boot hook that failed is exactly the case where
nobody is reading the log.
turnkey-ssl. Keel-Linux/tracker#15 recommendsrebuilding it as ours rather than upstreaming it, and this is the reason why:
a package that ships a private key cannot go to Debian.
/usr/share/turnkey-ssl/cert.keyshould not survive on disk afterregeneration.
Org-wide context: Keel-Linux/tracker#15.
Measured on the build host on 2026-09-29, read only, across all twelve layer rootfs trees in
/mnt/builds/layers: the shared TLS key is not the only one, and it is not only in/usr/share./etc/ssl/private/cert.key,cert.pemturnkey-sslpostinst copies the shipped key here when none exists139a0fd7.../usr/share/turnkey-ssl/cert.key,cert.pem/etc/ssh/ssh_host_{rsa,ecdsa,ed25519}_keySHA256:co8r09MoEC8FVPxSBL5ltte5n7uA3dvi8FeWS05+mUQ/etc/webmin/miniserv.pemminiserv.confpoints atcert.pem/etc/ssl/private/ssl-cert-snakeoil.keylappandpostgresqlonlySo every image built from any published template starts with the same SSH host keys and the same TLS key in the place services read, until
10regen-sshkeysand15regen-sslcertreplace them. If either hook does not run, the machine serves a key anyone can download.The one public appliance is not affected:
forumserves its own key on 443 and 12321 (0ce6f58b...) and has its own SSH host key.The fix, in two parts:
common/removelists-final/turnkeyremoves all of the above as the last step of every layer build, and a dpkgpath-excludestopsturnkey-sslfrom putting its key back on upgrade.The code is merged: Keel-Linux/inithooks#19 (
keel-host-keys: every machine makes its own keys before a service reads one, and replaces any key that was published in an image), Keel-Linux/common#14 (the build removes them), Keel-Linux/buildtasks#14 (bt-layerrefuses a layer that carries one). The security review's findings were fixed in the same PRs; the notable one was dropping the dpkgpath-exclude, which would have broken turnkey-ssl's postinst.Open until the published images are clean, which takes three attended steps in this order: publish
inithooks 2.3.6+keel6; update/turnkey/fab-keel/commonand/turnkey/buildtasks-keelon the build host together; rebuild the chain and publish. Rebuilding turnkey-ssl without its key stays with tracker#15.