Repository navigation
The build verifies the staging archive instead of reading it unverified - #11
Merged
Merged
Conversation
…erified
The staging distribution was given its own signing key so that a nightly could
sign itself and so recipes could stop reading it through [trusted=yes], which
switches verification off. Signing landed; verification did not. A layer build
printed
W: OpenPGP signature verification failed: file:/srv/keel-apt/repo
trixie-staging InRelease: Missing key
8CFD1A4841448B2227341CEB202CACBD0E97090A
and carried on, so it installed the project own packages unverified, which is
where it was before, only now it said so (tracker#7).
The public half of the staging key is installed into the build tree as
/etc/apt/keyrings/keel-staging-keyring.asc, from /srv/keel-apt/keys where
bin/publish of keel-linux/apt leaves it; the source entry names it through
signed-by; and apt-get update runs with --error-on=any. Measured against the
real archive: with signed-by named and no key, apt exits 100 and says the
repository is not signed, where before it warned and exited 0. A warning
nobody fails on is how this shipped.
bin/keel-archive-check makes the same checks itself rather than trusting apt to
have complained, because the tree that is about to be configured is checked at
a step where no apt-get update runs: the copied index is the live one, the
entry names the keyring and this distribution, no apt source in the tree says
trusted=yes, and the signature on the copied InRelease verifies against the
named key with gpgv. The keyring leaves the image with the source entry and the
copy of the archive, and common/removelists-final/turnkey takes all three out
as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes part of Keel-Linux/tracker#7 for this recipe.
The defect
The staging distribution was given its own signing key so that a nightly could
sign itself and so appliance recipes could stop reading it through
[trusted=yes], which switches verification off. Signing landed; verificationdid not, so a layer build printed
and carried on, installing the project's own packages unverified.
How the build verifies now
/etc/apt/keyrings/keel-staging-keyring.asc, taken from/srv/keel-apt/keys/keel-staging-keyring.asc, wherebin/publishofKeel-Linux/apt now leaves the keyring of whichever distribution it signed;
signed-byand no longer saystrusted=yes, which no file in any of the four recipes does any more;apt-get updateruns with--error-on=any, so a warning is an error;bin/keel-archive-checkmakes the same checks itself, withgpgv, becausethe tree that is about to be configured is checked at a step where no
apt-get updateruns: the copied index is the live one, the entry names thekeyring and the distribution, nothing in the tree says
trusted=yes, and thesignature on the copied
InReleaseverifies against the named fingerprint.How it fails
Measured against the real archive on the build host, in a scratch apt root:
[trusted=yes], no keyringW: ... Missing key, exit 0, packages installedsigned-by, no keyringE: The repository ... is not signed, exit 100signed-by, the wrong keyE: The repository ... is not signed, exit 100signed-by, the staging keyGet:1 ... InRelease, exit 0bin/keel-archive-checkexits 1 with aFATAL [archive-check <step>]line ineach of those failures, before a package is installed.
The keyring does not reach the image
The conf script removes it with the source entry and the copy of the archive,
and Keel-Linux/common#4 adds all three to
common/removelists-final/turnkey,which is the arrangement that holds whether or not a recipe remembers.
Also here
The tests workflow gains the
packagejob.package / changelogis a requiredstatus on
mainin this repository, and no job produced it: a check that isrequired and never reported leaves every pull request blocked for good,
including this one. The job is the one keel-mariadb, keel-postgresql and
keel-wordpress already carry.
Test plan
COVERAGE_THRESHOLD=95 tests/coverage.sh: 99.66 percent (295/296) over132 bats tests, 100 percent bar the one line of the dialog loop that
needs a terminal.
bin/keel-archive-check100 (52/52),zz-project-packages100 (31/31)shellcheck -S warning bin/keel-archive-checkcleanappliance / build-and-bootagainst a rebuilt layer