Refuse to export a layer that carries a private key #14
No reviewers
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/buildtasks!14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/refuse-private-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: all twelve layers exported so far carry the same private keys, and nothing in the build noticed. A list of files to remove only holds while someone remembers every package that makes a key.
Fix
layer_check_buildrunslayer_audit_keyson the built tree before anything is packed: a PEM private key header on a line of its own, text files only (grep -I), symlinks not followed. Every key found is named by its path in the image, and the layer is refused. A grep that fails is a failed audit, not a clean one. The exceptions are four inert examples shipped by packages, inconf/layer-inert-keyswith a reason each, accepted only at their path and digest.Evidence
tests/layer: every key format, a key after a certificate, the quoted marker, a binary, a symlink out of the tree, the inert list by path and digest, grep failing or missing, and abt-layerrun whose build leaks a host key: refused, no tarball, no manifest. Five mutations each turn it red.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.