Skip to content

ci: run EV signing jobs in the code-signing environment - #8170

Merged
deansheather merged 3 commits into
mainfrom
code-signing-environment
Nov 16, 2026
Merged

deansheather merged 3 commits into
mainfrom
code-signing-environment

Conversation

@deansheather

@deansheather deansheather commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Generated by Coder Agents on behalf of @deansheather.

This repository's EV signing service account in coder-ci trusts every workflow in the repository, so any branch can sign with Coder's EV certificate. This PR runs the signing jobs in a code-signing environment. Only main and v* tags may deploy to that environment, so coder/gcp can bind the account to the environment instead of the whole repository.

  • _desktop-release.yml build-windows (release and nightly builds) runs in code-signing.
  • pr.yml build-windows uses code-signing only on pushes to main. Its signing step already ran only on those pushes. Merge queue builds run the queued PR's code, so they get no environment and stay unsigned, which is how they already behaved.
  • release.yml dispatched with a tag input now has to be dispatched from main. Preflight also requires the input to be a release tag whose commit is on main, and every build checks out that commit's SHA. Before, the input was used unchecked as the checkout ref, so a dispatch from main could sign any branch or SHA. Codex flagged this too.
  • xum uses immutable OIDC subjects, so coder/gcp#347 binds repo:coder@95932066/xum@1058825816:environment:code-signing.
  • xum has no v* tag ruleset because its nightly workflow creates its own tags. A dispatch can now only build a tag on main, but a release event runs the workflow file from the tagged commit, so anyone with write access can still push a v* tag with an edited workflow and sign.

Merge order (all 8 PRs)

coder/gcp applies on merge, so the order matters.

  1. coder/github-org-terraform#56: the code-signing environments, tag rulesets, and coder/coder release and release-publish allowing main. This must be applied before an RC can be dispatched from main.
  2. coder/gcp#343, then ci: build and sign main and releases with a shared build-coder action coder#32229 right after. Signed ci.yaml builds on main fail between those two. release/2.37 to 2.39 keep signing through ci.yaml under 🤖 Review tab search highlighting and performance #343's temporary rule until 2027-02-16.
  3. ci: run EV signing jobs in the code-signing environment coder-desktop-windows#192, ci: run EV signing jobs in the code-signing environment mutagen#19, ci: run EV signing jobs in the code-signing environment pr-buddy#69 and ci: run EV signing jobs in the code-signing environment #8170.
  4. coder/gcp#347. Windows signing in those 4 repos breaks if this lands before step 3.

Repository-level secrets and variables (EV_*, GCP_*) still work from an environment job, so nothing needs to move.

The EV signing service account in coder-ci will only trust jobs in this
repository's code-signing environment, which only main and v* tags may
use (coder/github-org-terraform). Today it trusts every workflow in the
repository, so any branch can sign with Coder's EV certificate.
@deansheather

Copy link
Copy Markdown
Collaborator Author

@codex review

@deansheather

Copy link
Copy Markdown
Collaborator Author

@codex security 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-16T08:43:22.318497Z 5ec03a3 Manual request
🔒 Security Review ✅ Completed 2026-11-16T08:51:43.135583Z 5ec03a3 Manual request

Security findings

Advisory findings (1)

ℹ️ 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 Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 60d63ff4ca

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@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: 60d63ff4ca

ℹ️ 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 .github/workflows/_desktop-release.yml Resolved
Comment thread .github/workflows/pr.yml Resolved
desktop-builds signs in the code-signing environment, which is granted
from the dispatch ref, but checked out the unvalidated tag input, so a
dispatch from main could sign any branch or SHA. Preflight now requires
the input to be an existing release tag and every build checks out
refs/tags/<tag>.
@deansheather

Copy link
Copy Markdown
Collaborator Author

@codex review

@deansheather

Copy link
Copy Markdown
Collaborator Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 1ab9ce48bd

ℹ️ 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".

@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 Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: 1ab9ce48bd

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread .github/workflows/release.yml Resolved
@deansheather
deansheather marked this pull request as ready for review November 16, 2026 08:02
@github-actions

Copy link
Copy Markdown
Contributor

No job left output: make test-stories stopped before its first job. See the run log.

release.yml's preflight now resolves the release tag to its commit, rejects
it unless that commit is on main, and passes the SHA to every build. v* tags
are not protected here, so a tag on an unmerged commit could otherwise be
built and EV-signed from a dispatch on main.
@deansheather

Copy link
Copy Markdown
Collaborator Author

@codex review

@deansheather

Copy link
Copy Markdown
Collaborator Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 5ec03a3ca6

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 5ec03a3ca6

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

deansheather added a commit to coder/coder-desktop-windows that referenced this pull request Nov 16, 2026
> [!NOTE]
> Generated by Coder Agents on behalf of @deansheather.

This repository's EV signing service account in `coder-ci` trusts every
workflow in the repository, so any branch can sign with Coder's EV
certificate. This PR runs the signing jobs in a `code-signing`
environment. Only `main` and `v*` tags may deploy to that environment,
so coder/gcp can bind the account to the environment instead of the
whole repository.

- `release.yaml` `release` runs in `code-signing`.
- Manual dispatches must be run from `main`.
- Pushing `v*` tags now needs admin, maintain,
`coder-desktop-release-managers` or `release-managers`
(coder/github-org-terraform#56).

## Merge order (all 8 PRs)

coder/gcp applies on merge, so the order matters.

1. coder/github-org-terraform#56: the `code-signing` environments, tag
rulesets, and coder/coder `release` and `release-publish` allowing
`main`. This must be applied before an RC can be dispatched from `main`.
2. coder/gcp#343, then coder/coder#32229 right after. Signed `ci.yaml`
builds on `main` fail between those two. `release/2.37` to `2.39` keep
signing through `ci.yaml` under #343's temporary rule until 2027-02-16.
3. #192, coder/mutagen#19, coder/pr-buddy#69
and coder/xum#8170.
4. coder/gcp#347. Windows signing in those 4 repos breaks if this lands
before step 3.

Repository-level secrets and variables (`EV_*`, `GCP_*`) still work from
an environment job, so nothing needs to move.
@deansheather
deansheather merged commit 31c14d5 into main Nov 16, 2026
74 of 81 checks passed
@deansheather
deansheather deleted the code-signing-environment branch November 16, 2026 08:59
deansheather added a commit to coder/coder that referenced this pull request Nov 16, 2026
…#32229)

> [!NOTE]
> Generated by Coder Agents on behalf of @deansheather.

Main builds and releases now build and sign through one shared composite
action, so they can't drift apart. PR builds use the same action
unsigned, in a job with no environment, so they can't reach signing
secrets or identities.

Depends on coder/gcp#343, which must merge first. The `release-signer`
identity provider only accepts tag-dispatched releases and `ci.yaml`.
Since #32211 made that login unconditional, releases and non-push main
runs already fail today.

## Changes

- **`.github/actions/build-coder` (new):** tool setup, then `make` for
the given targets. With `sign: true` it signs darwin binaries with the
Apple key in Cloud KMS, Windows binaries with EV, and everything with
GPG (the legacy key plus the optional KMS key). With `notarize: true` it
also notarizes. Composite actions can't read secrets, so callers pass
them in.
- Signing material goes in a `$RUNNER_TEMP/coder-signing` directory with
mode 700 and is removed with `if: always()`.
  - Signing builds disable the mise, pnpm and rcodesign caches.
- KMS signing no longer checks the event or ref. If the provider rejects
a run, the build fails loudly.
- **`.github/workflows/build.yaml` (new):** the signed main and
`release/*` build, moved out of `ci.yaml`.
- Triggers: `push` to `main` and `release/*` (ignoring the same
docs-only paths as `ci.yaml`'s `changes` filter), plus `create` for
`release/*`. No `pull_request` or `workflow_dispatch`. Top-level
`permissions: {}`.
- The `build` job runs in `ci-signing`. It builds and signs, pushes
`coder-preview` tags, then runs SBOM, image attestations and binary
attestations (new), and uploads artifacts.
- `prune` runs `action-ghcr-prune` in its own job, away from the signing
credentials.
- `deploy` calls `deploy.yaml`. `notify-slack-on-failure` covers build,
prune and deploy failures on main.
- **`ci.yaml`:**
  - The `build` and `deploy` jobs are removed.
- `check-build` now runs `make build-slim` through the action, unsigned.
That compile-checks all 7 OS/arch targets without the frontend and fat
builds.
  - `check-build` also runs when CI files change.
- **`release.yaml`:**
- Builds and signs through the action with `notarize: true`. Tagging,
base image, images, attestations and publishing are unchanged.
  - The `refs/tags/*` KMS gate is removed.
- The publish step now reads the `release-signer` credentials from the
action's output.
- **Hardening on top of #32211:**
- `install-rcodesign` gains a `use-cache` input, which signing jobs set
to `false`. Depot caches are shared across branches, so a PR could
otherwise plant a binary under the cache key that a signing job would
run with signing credentials.
- `cargo install --locked` pins rcodesign's dependency tree. I verified
the lockfile resolves with the patch at the pinned revision.
- `sign_darwin.sh` takes `AC_PKCS11_CREDENTIALS_FILE` and sets
`GOOGLE_APPLICATION_CREDENTIALS` only for `rcodesign`. The
`release-signer` credentials no longer reach the whole `make` step.
  - The jsign jar is now verified against a pinned sha256.

## Validation

- `make lint/actions/actionlint` passes. zizmor (offline, strict
collection) reports no findings. shellcheck passes on every `run` block
in the composite actions.
- I dry-ran the signing-material and target-parsing logic locally. The
kmsp11 config renders correctly and files are mode 600. Multi-line
targets parse correctly.
- Not run: a real signed build. The first main run after merge should
show `.asc` and `.v2.asc` files, rcodesign and jsign output,
`coder-preview:main` pushed and dogfood deployed. A release dry run from
`main` covers `release.yaml` once #56 lets the `release` environment run
on `main`; release branches still carry the old `release.yaml`.

## Follow-ups (manual)

- After the first successful signed main build and release, delete
`AC_CERTIFICATE_P12_BASE64` and `AC_CERTIFICATE_PASSWORD`.
- The Rust toolchain is still whatever `stable` the runner has.
Rebuilding rcodesign without the cache adds a few minutes to each signed
build.

The `release` environment changes and the release-branch `ci.yaml`
signing are handled in coder/github-org-terraform#56 and coder/gcp#343.

## Merge order (all 8 PRs)

coder/gcp applies on merge, so the order matters.

1. coder/github-org-terraform#56: the `code-signing` environments, tag
rulesets, and coder/coder `release` and `release-publish` allowing
`main`. This must be applied before an RC can be dispatched from `main`.
2. coder/gcp#343, then #32229 right after. Signed `ci.yaml`
builds on `main` fail between those two. `release/2.37` to `2.39` keep
signing through `ci.yaml` under #343's temporary rule until 2027-02-16.
3. coder/coder-desktop-windows#192, coder/mutagen#19, coder/pr-buddy#69
and coder/xum#8170.
4. coder/gcp#347. Windows signing in those 4 repos breaks if this lands
before step 3.

<details>
<summary>Plan and decision log</summary>

**Goal:** main and `release/*` pushes build coderd fully, sign
everything (EV, Apple, GPG and KMS GPG) the same way releases do, push
`coder-preview`, and deploy dogfood. PRs get a compile check with no
signing access.

**Verified constraints:**

- Signing secrets exist only in the `ci-signing` and `release`
environments. There are none at the repo or org level.
- `ci-signing` allows `main` and `release/*`. `release` requires
`release-managers` with self-review prevented, and admins can't bypass.
- `ev-code-signing` (coder-ci) and `release-signer`
(coder-release-signing) are bound only to the `environment:ci-signing`
and `environment:release` subjects.
- The `release-signer` provider condition checks `job_workflow_ref`. A
reusable workflow would change that claim, so the shared code is a
composite action that runs inside the caller's job. This also keeps the
release job as a single job, with no artifact handoff between build and
publish.

**Decisions:**

- The new workflow is named `build.yaml`.
- There is no cutover period, so the provider names only `build.yaml`.
- Main builds are signed identically to releases. Only notarization and
publishing differ, because main doesn't build darwin archives.
- `release/*` still gets `coder-preview:release-X.Y` images.
- PR `check-build` builds slim binaries only, which keeps the
cross-compile coverage at a fraction of the cost.

</details>
@linear-code

linear-code Bot commented Nov 16, 2026

Copy link
Copy Markdown

SEC-1305

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.

2 participants