GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — chore: switch to official `release-keys` repo to verify Node.js artefacts by aduh95 · Pull Request #2415 · nodejs/docker-node Conversation
|
| { 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.
The reason will be displayed to describe this comment to others. Learn more.
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
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I've added a step that checks the pubring only contains the expected keys, PTAL
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I think you might be referring to #1509 (comment) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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) 😅 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Is there any unadressed objections? If I don't hear any, I plan to land this before 26.0.0 is released |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@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
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| 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.
The reason will be displayed to describe this comment to others. Learn more.
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
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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
| && [ "$(gpg --no-default-keyring --keyring "$GNUPGHOME/pubring.kbx" --list-keys --with-colons | awk -F: '{ if (print_next_line) { print $10; print_next_line=0; } else if ($1=="pub") print_next_line=1; }')" = "$(printf '5BE8A3F6C8A5C01D106C0AD820B1A390B168D356\nDD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7\nCC68F5A3106FF448322E48ED27F5E38D5B0A215F\n8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600\n890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4\nC82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C\n108F52B48DB57BB0CC439B2997B01419BD92F80A\nA363A499291CBBC940DD62E41F10027AF002F8B0\n')" ] \ |
I don't think dropping the node.keys is desirable, but maybe I misunderstand what you mean.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The keyservers are still needed to install Yarn v1 Classic until Node.js 24 EOL in Apr 2028, for example
docker-node/Dockerfile-debian.template
Lines 49 to 50 in 5735045
| { gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" && gpg --batch --fingerprint "$key"; } || \ | |
| { gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" && gpg --batch --fingerprint "$key"; } ; \ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Should I bother to fix conflicts here? FWIW I still think this is valuable and an improvement over the status quo, and that I have addressed all the concern that was raised, but if it's not going to land, so be it and let's close the PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Should I bother to fix conflicts here?
To avoid the conflicts and also avoid unnecessarily triggering a release when only the method of updating the keys is being changed, remove the Dockerfile changes from this PR. (see also #2564). Dockerfile updates are done automatically with each release, so it's redundant to also put them in this PR.
FWIW I still think this is valuable and an improvement over the status quo, and that I have addressed all the concern that was raised, but if it's not going to land, so be it and let's close the PR.
The previous gating factor was getting approval from the representatives of https://github.com/docker-library. They would need to review the latest changes.
Automating the key updates would replace a manual process and save effort in that sense. So that would be a benefit. In practice, the keys don't change very often, so the current manual effort is minimal though.
The change does not however remove the dependency on the key servers (hkps://keys.openpgp.org & https://keyserver.ubuntu.com). They remain essential for building Node.js 22 & 24 because Yarn install uses them. If they're not available, the build fails. That will remain the case until Node.js 24.x EOL on 2028-04-30.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
To clarify this is not a goal, not only the effort is minimal, keeping manual steps helps catch mistakes and mischiefs. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I suggest to close this PR. update-keys.sh now pulls from https://github.com/nodejs/release-keys/raw/refs/heads/main/gpg-only-active-keys/pubring.kbx It's not possible to remove the dependency on keyservers hkps://keys.openpgp.org & keyserver.ubuntu.com Short-term the keyervers are needed for Yarn v1 Classic installation. That need continues until Node.js 24 EOL on 2028-04-30. After that date the lowest active release is Node.js 26 and that does not bundle Yarn v1. Long-term there is no agreement from the Docker representatives in the team. They want the signer key in the Docker file, and the check to run through the keyservers. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
That seems like conjecture, unless I've missed a communication from their end they haven't commented on this implementation.
This is IMO off-topic since we obviously have no control over Yarn verification methods. My concern is with verifying Node.js releases with a method the project has no control over. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
https://github.com/docker-library/official-images#security was the reference document. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
In https://github.com/docker-library/faq/#how-can-i-use-a-keys-file-for-verifying-pgp-signatures, they give an example of exactly what I'm trying to achieve |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Could you explain again the need for this PR? You said you see a problem because the Node.js organization does not control the key servers. What aspect of lack of control concerns you? Is it availability of the servers? The risk of key servers being compromised? Or something else? What is the impact of this PR not being merged? At the moment we have a working solution, so I'm trying to understand what is missing. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The issue is that Node.js releases are signed with the releaser's private key, so if the releaser removes their key for those servers, it results on Node.js releases no longer being verifiable. It happen somewhat recently when I lost access to my private key, when I uploaded my new key it, the previous one was no longer trusted, and verification was failing. It's uncomfortable for the releaser, which are kinda bound forever to keep the same key, and uncomfortable for the project as the build are not reproducible. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you for the explanation! I am beginning to understand your concerns. The restrictions on e-mail re-use only affect hkps://keys.openpgp.org and these were already mitigated by PR #2252 from @tianon on Jul 7, 2025. Keys from the Node.js release team are not affected because this repo only builds the latest versions of Node.js and it only uses keys from nodejs/release-keys > gpg-only-active-keys/pubring.kbx. The repo doesn't support old releases. Your problematic old key As an additional example of how the mitigation currently works for the only non-Node.js key in use: the key |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Requested changes must be addressed to merge this pull request.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Migrate to Node.js verification using keyring source
There was an error while loading. Please reload this page.