chore: switch to official release-keys repo to verify Node.js artefacts#2415
chore: switch to official release-keys repo to verify Node.js artefacts#2415
release-keys repo to verify Node.js artefacts#2415Conversation
release-keys repo to verify Node.jsrelease-keys repo to verify Node.js artefacts
Dockerfile-alpine.template
Outdated
| { gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" && gpg --batch --fingerprint "$key"; } ; \ | ||
| done \ | ||
| && export PUBRING="$(mktemp)" \ | ||
| && curl -fsSLo "$PUBRING" --compressed https://github.com/nodejs/release-keys/raw/HEAD/gpg-only-active-keys/pubring.kbx \ |
There was a problem hiding this comment.
Just like any file downloaded in the Dockerfile, this would need to be verified by a sha256sum embedded in the Dockerfile (at a minimum) in order to be acceptable to Docker Official Images. See https://github.com/docker-library/official-images/tree/3b4779967d1c2e369aeae1c8533d12f5a9b4df81#image-build.
In many instances, we also recommend checking that only the expected keys exist in the keyring (or maybe that was only when adding them to an apt keyring). cc @tianon
There was a problem hiding this comment.
The content of the keyring is validated in https://github.com/nodejs/release-keys/actions/runs/20075780501/workflow#L64, do you know if that's good enough?
There was a problem hiding this comment.
I've added a step that checks the pubring only contains the expected keys, PTAL
I think you might be referring to #1509 (comment) |
|
Maybe there is a way in the middle, where the script grabs and parses the keyring, but the image keeps the valid/current keys embedded in the Dockerfile we send upstream |
That's the one that's most directly pertinent to docker-node -- see also nodejs/node#58979 (comment), nodejs/node#58904 (comment), nodejs/node#39227 (comment) 😅 |
This comment was marked as outdated.
This comment was marked as outdated.
To quote nodejs/node#58979 (comment):
And nodejs/node#39227 (comment):
See also https://github.com/docker-library/faq#how-can-i-use-a-keys-file-for-verifying-pgp-signatures |
|
Is there any unadressed objections? If I don't hear any, I plan to land this before 26.0.0 is released |
nschonni
left a comment
There was a problem hiding this comment.
@aduh95 I'm just blocking this, because we need agreement from the Docker hub people (@yosifkit, @tianon, or @LaurentGoderre) otherwise we can't proceed. If one of them agrees, you can dismiss this review
| trap 'rm -r "$TMP_DIR"; trap - EXIT; exit' EXIT INT HUP | ||
| (cd "$TMP_DIR" && curl -fsSO "$KEYRING_URL" && sha256sum pubring.kbx) > keys/nodejs.shasum | ||
|
|
||
| gpg --no-default-keyring --keyring "$TMP_DIR/pubring.kbx" --list-keys --with-colons | |
There was a problem hiding this comment.
I kind of want to try to see if this could be used to keep the embedded fingerprints in the Dockerfiles by droping the node.keys and doing this each time as part of the bigger update.sh. I'll see if I can figure that out later
There was a problem hiding this comment.
keep the embedded fingerprints in the Dockerfiles by droping the
node.keysand doing this each time as part of the biggerupdate.sh
Hum I think that's already what's happening:
docker-node/25/bookworm/Dockerfile
Line 22 in fc4d9bd
I don't think dropping the node.keys is desirable, but maybe I misunderstand what you mean.
There was a problem hiding this comment.
Sorry, I didn't explain myself very well. I was thinking that maybe there is a way to use the keyring to be the definitive source (with or without a TXT copy here), but have no diff for the existing Dockerfiles by generating the same array/method that is used today and accpeted by the Docker Hub publishing.
EX: Take your new method of getting the keys from the keyring rather than scraping the README, but don't change how the fingerprints are consumed inside the Dockerfiles
There was a problem hiding this comment.
One goal of this PR is to remove the dependency on those public key servers – although there are no plans to stop publishing public keys there, moving to the keyring removes that dependency on something we have little control over, and is more stable over time (because it's now targeting a specific commit on the repo)
Description
Instead of maintaining a separate list of keys and expect to find them on public servers, let's switch to the official keyring and use the smaller
gpgvtool.Motivation and Context
https://github.com/nodejs/node?tab=readme-ov-file#verifying-binaries
nodejs/unofficial-builds#216
Testing Details
Example Output(if appropriate)
Types of changes
Checklist