Skip to content

SRE-924: Mint the release token from a Vault-held key - #1597

Merged
TimDiekmann merged 5 commits into
mainfrom
t/sre-924-sign-the-github-app-jwt-with-vault-transit-instead-of
Aug 7, 2026
Merged

SRE-924: Mint the release token from a Vault-held key#1597
TimDiekmann merged 5 commits into
mainfrom
t/sre-924-sign-the-github-app-jwt-with-vault-transit-instead-of

Conversation

@TimDiekmann

Copy link
Copy Markdown
Member

The release job authenticated as a GitHub App whose private key was a plain
repository secret, and minted an installation token with no repository scope. It
now signs the App JWT in Vault with a key that is not exportable, and the token it
exchanges that for reaches only this repository.

environment: main is what resolves the Vault address and the Cloudflare Access
credentials, and it puts the environment claim in the OIDC token so the Vault role
can bind it alongside the owner, repository, ref and workflow file.

Before this merges

After a green run

BLOCK_PROTOCOL_GITHUB_WORKER_PRIVATE_KEY should be deleted from this
repository's secrets — this workflow was its only consumer, and leaving it in
place keeps the key reachable and defeats the change.
BLOCK_PROTOCOL_GITHUB_WORKER_APP_ID can go with it; App ids are not secret.

The App's private key was a plain repository secret, so any job in this
repository could read it and mint an installation token for the whole
installation. Vault now signs the App JWT with a non-exportable key and the token
is scoped to this repository.

Declaring `environment: main` is what resolves the Vault address and the
Cloudflare Access credentials, and it puts the environment claim in the OIDC token
for the Vault role to bind.
Copilot AI lite review requested due to automatic review settings August 5, 2026 17:17
@cursor

cursor Bot commented Aug 5, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes how release automation authenticates to GitHub (OIDC, Vault, CF Access, and a pinned external action); misconfiguration could block releases or widen token scope until old secrets are removed.

Overview
The Release workflow no longer mints the GitHub App installation token with actions/create-github-app-token and BLOCK_PROTOCOL_GITHUB_WORKER_* repository secrets.

It now runs under the main GitHub environment, requests id-token: write, and calls hashintel/.github’s github-app-token action with Vault (VAULT_ADDR, role ci-blockprotocol-release, transit key github-app-block-protocol-release) and Cloudflare Access credentials so the App JWT is signed with a non-exportable key and the resulting token is limited to this repository.

The checkout and changesets steps still use steps.app-token.outputs.token as before.

Reviewed by Cursor Bugbot for commit 0bcde21. Bugbot is set up for automated code reviews on this repo. Configure here.

Copilot AI 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.

Pull request overview

This PR updates the Release GitHub Actions workflow to mint the GitHub App installation token via Vault (non-exportable key signing) instead of using a repository-stored App private key secret, and scopes the resulting token to this repository.

Changes:

  • Switches token minting from actions/create-github-app-token with repo secrets to a Vault-backed custom action (hashintel/.github/.../github-app-token).
  • Adds environment: main and enables OIDC (permissions: id-token: write) to support Vault auth and environment-bound claims.
  • Passes Vault/Cloudflare Access configuration and repository scope into the token-minting step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml Outdated
Copilot AI review requested due to automatic review settings August 5, 2026 18:49

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

The release shared an App with other automation. It now signs as
block-protocol-release, whose key is the only one its Vault role can reach.
Copilot AI review requested due to automatic review settings August 6, 2026 10:33

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (1)

.github/workflows/release.yml:21

  • This workflow pins a custom action to an unmerged commit SHA in hashintel/.github. If that commit is rebased/force-pushed away before it lands on a protected branch/tag, GitHub Actions may become unable to resolve it, breaking releases. Consider repinning to the merged commit SHA (or a version tag) before merging this PR, if available.
        uses: hashintel/.github/.github/actions/github-app-token@6235da521f7054945cf1ff9967708d40c745c6b4 # unmerged — re-pin to the merged SHA, not @main

Copilot AI review requested due to automatic review settings August 6, 2026 10:47

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (1)

.github/workflows/release.yml:21

  • The inline reference comment says # main, but the PR description notes this is pinned to an unmerged commit from hashintel/.github#95. Keeping # main here is likely to mislead future readers about what’s actually pinned and when it should be updated.
        uses: hashintel/.github/.github/actions/github-app-token@89ff06bc761f0c0491d87a766eccce5aae6190ea # main

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3934aea. Configure here.

Comment thread .github/workflows/release.yml Outdated
@TimDiekmann
TimDiekmann requested review from CiaranMn and Copilot August 6, 2026 15:33
@TimDiekmann
TimDiekmann enabled auto-merge August 6, 2026 15:33

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@TimDiekmann
TimDiekmann added this pull request to the merge queue Aug 7, 2026
Merged via the queue into main with commit 7acf45e Aug 7, 2026
7 of 9 checks passed
@TimDiekmann
TimDiekmann deleted the t/sre-924-sign-the-github-app-jwt-with-vault-transit-instead-of branch August 7, 2026 20:12
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