Skip to content

feat: verify the CLI with the new release key, and bundle signatures for past releases - #1194

Open
kylecarbs wants to merge 11 commits into
mainfrom
cli-signature-kms-key
Open

kylecarbs wants to merge 11 commits into
mainfrom
cli-signature-kms-key

Conversation

@kylecarbs

@kylecarbs kylecarbs commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Relates to SEC-1419

How the downloaded CLI is now checked

  1. If a signature for the server version and platform ships with the extension, the CLI is verified with it and the new key (bundled in pgp-public.key), before any signature is downloaded:
    • a valid signature is accepted without a prompt;
    • an invalid one gets the existing "Signature does not match" prompt;
    • a genuine binary from another version or platform doesn't verify, as each signature covers exactly one binary.
  2. Otherwise, <binary>.v2.asc from the deployment, verified with the new key. If it's valid, the CLI is accepted. If it's invalid, the existing "Signature does not match" prompt appears.
  3. If the deployment has no .v2.asc, the existing prompts: try releases.coder.com's .v2.asc, or run without verification.

Bundled signatures

Deployments released before the new key don't serve a .v2.asc. Coder has since signed the 2.29.0 to 2.39.4 releases with the new key, and release-signatures.json holds those signatures: 1,036 of them, for the 7 CLI binaries of each of the 148 releases, keyed by version and then binary name. They're the same signatures releases.coder.com serves for those releases.

ReleaseSignatures reads the file only when a downloaded CLI is verified, so it costs nothing at activation. It adds about 0.6 MB to the extension.

The file needs no generation script or CI check: the bundled key is what's trusted, so a wrong entry can only fail verification and show the prompt. A unit test checks that every release has all 7 binaries and that each signature was made by the bundled key.

This replaces the release digests from the earlier commits. release-digests.json, its script and its workflow are removed.

Status

Unit tests, typecheck, lint and format pass. Real 2.29.0, 2.29.28 and 2.39.4 binaries verify with their bundled signatures, and a binary from another release is rejected.

🤖 Generated with Claude Code

@kylecarbs
kylecarbs force-pushed the cli-signature-kms-key branch 2 times, most recently from 18c5391 to 026ece4 Compare November 16, 2026 06:17
@kylecarbs
kylecarbs marked this pull request as ready for review November 16, 2026 06:26
@ethanndickson ethanndickson self-assigned this Nov 16, 2026

@ethanndickson ethanndickson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handoff notes for whoever picks this up.

Checked by hand, all fine:

  • The bundled key verifies the real .v2.asc of 2.39.4 (linux-amd64 and darwin-arm64) with openpgp 6.3.2 and the same call as src/pgp.ts.
  • The digests of 2.39.4 and 2.29.28 (linux-amd64 and darwin-arm64) match the binaries on releases.coder.com.
  • A server built before .v2.asc existed answers 404 for it, so the digest check runs (checked on one deployment).
  • The .vsix from CI contains release-digests.json and the new key.

Two smaller points:

  • The rollout text in coder/coder#32209 describes a fallback to .asc with the old key. This PR removes the old key and uses digests instead, so the two disagree.
  • src/instrumentation/EVENTS.md does not list the new release_digest outcome.

Generated by an agent on behalf of the user

Comment thread src/cli/cliManager.ts Resolved
Comment thread src/cli/cliManager.ts Resolved
Comment thread scripts/generate-release-digests.sh Resolved
Comment thread scripts/generate-release-digests.sh Resolved
Comment thread src/cli/cliManager.ts Resolved
Comment thread src/releaseDigests.ts Resolved
Comment thread src/releaseDigests.ts Resolved
Comment thread test/unit/cli/cliManager.test.ts Resolved
@linear-code

linear-code Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

SEC-1419

SEC-1490

@jdomeracki-coder
jdomeracki-coder self-requested a review November 16, 2026 10:13
@EhabY
EhabY requested a review from ethanndickson November 16, 2026 11:10
@ethanndickson

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T00:33:30.570133Z 77d2666 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 2f49184ce0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@EhabY
EhabY force-pushed the cli-signature-kms-key branch 2 times, most recently from 4b77219 to 7227351 Compare November 16, 2026 13:55
@ethanndickson ethanndickson changed the title feat: verify the CLI with the new release key, or past release digests feat: verify the CLI with the new release key, and bundle signatures for past releases Nov 17, 2026
@ethanndickson

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 319a155eca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tsconfig.json Resolved
Comment thread release-signatures.json Resolved
Comment thread CHANGELOG.md Resolved
Comment thread src/cli/releaseSignatures.ts Resolved
Comment thread src/cli/cliManager.ts Resolved
@ethanndickson
ethanndickson requested a review from EhabY November 18, 2026 00:20
@ethanndickson

Copy link
Copy Markdown
Member

@codex review

kylecarbs and others added 2 commits November 18, 2026 11:21
Coder releases are now signed with a new release key, in a .v2.asc next
to each binary. The extension downloads <binary>.v2.asc from the
deployment and verifies it.

Deployments released before the new key have no .v2.asc, so their
binary is instead accepted if its SHA-256 digest is the one Coder
released for that version and platform (release-digests.json, generated
from the GitHub attestations of each release by
scripts/generate-release-digests.sh). Anything else falls back to the
existing prompts: try releases.coder.com, or run without verification.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fingerprint 0F68 5EFE 0AE5 A818 2A47 3DD8 6E3A 8E56 1370 7520, which
signs the .v2.asc signatures of Coder releases from v2.39.4, v2.38.10,
v2.37.14, v2.34.21 and v2.29.29 on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kylecarbs and others added 8 commits November 18, 2026 11:21
Generated with ./scripts/generate-release-digests.sh 2.29.0: 686 CLI
binaries from 98 releases, 85 checked against build provenance from
coder/coder release.yaml and 13 against GitHub release attestations.
Releases without either (v2.29.0-v2.29.17, v2.30, v2.31 and
v2.32.0-v2.32.7) are not listed. The script now only lists the CLI
binaries, not other files the server embeds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A listed release whose digest does not match now gets the same "Run
anyway" prompt as an invalid signature instead of "Signature not found".
ReleaseDigests is built once in ServiceContainer with the digests already
read, and check() reports match, mismatch or unlisted.
The script runs with Node instead of bash and its parsing checks are unit
tested. The releases with no attestation (2.29.0 to 2.29.17, 2.30.x,
2.31.x and 2.32.0 to 2.32.7) are verified with Coder's Authenticode
signature and Go build info instead.
Regenerated with scripts/generate-release-digests.mts. The 98 attested
releases are unchanged; 2.29.0 to 2.29.17, 2.30.x, 2.31.x and 2.32.0 to
2.32.7 are added from Coder's Authenticode signature. Versions are now in
semver order. A workflow regenerates the file when it or the script
changes and fails on any diff.
Move ReleaseDigests next to the CLI code it serves, and pass
verifyBinarySignatures one binary instead of signature URLs plus the
version and name they were built from. confirmRunAnyway only throws when
declined, so callers return their own result. Reword the mismatch detail
and the changelog entry, and test the releases.coder.com fallback URL.
A listed release's digest pins its exact bytes, so it decides before any
signature is downloaded: a match runs without one, and a mismatch warns
even when a valid signature exists.
…gests

Coder signed the 2.29.0 to 2.39.4 releases with the new release key. Ship
those signatures in release-signatures.json and verify the CLI with the one
for its version and platform. This replaces the release digest list, the
script that generated it and its workflow.
Keep the parsed release-signatures.json after the first read. Also shorten
the changelog entry and keep scripts/**/*.mts in the tsconfig include.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 399f61911a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/releaseSignatures.ts Resolved
A development build or a release candidate shares its major.minor.patch
with a release but not its bytes, so the bundled signature of that release
can only fail. Let those versions use the downloaded signature instead.
@ethanndickson

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 77d2666f7d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants