No private key leaves the build #14
No reviewers
Labels
No labels
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/common!14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/no-shared-keys"
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?
Problem
keel-core#8: every published layer carries the SSH host keys openssh-server makes at install, the turnkey-ssl certificate and key (in
/usr/share/turnkey-ssland, through its postinst, in/etc/ssl/privatewhere the services read them) and Webmin's unusedminiserv.pem; lapp and postgresql add ssl-cert's snakeoil pair. Every machine built from a layer shares them. BRIEF section 5.3.Fix
removelists-final/turnkeyremoves all of them as the last step of every build, after units and product conf scripts, so a child layer that installs a key generating package loses it too.~globs, so a layer without Webmin or ssl-cert passes over those lines.overlays/turnkey.d/no-shared-keys: a dpkgpath-excludekeeps a turnkey-ssl upgrade or reinstall from putting its key back. Measured with dpkg 1.22 in a scratch root: the file stays absent across a reinstall anddpkg --verifyreports itmissingwith status 0, as it does for what localepurge removes.Evidence
The test of this list is Keel-Linux/buildtasks' new
layer_audit_keys, which scans the real tree at the end of every build and refuses a layer with any private key not in its inert list.Deploying the three together
This is one of three pull requests for keel-core#8: Keel-Linux/inithooks (generate on the machine), Keel-Linux/common (remove from the build), Keel-Linux/buildtasks (refuse at export). Merging deploys nothing: the build host checkouts are updated by hand. The order that matters is deployment:
inithooks 2.3.6+keel6to the archive (attended, signing). Until then a layer without keys would boot with no TLS certificate until15regen-sslcert, which only restarts services already running./turnkey/fab-keel/commonand/turnkey/buildtasks-keelon the build host in the same sitting: the audit without the removals refuses every layer.keel-host-keysreplaces them on any machine made from one.