-
Notifications
You must be signed in to change notification settings - Fork 0
fix(codeql): use owned app receipt and exact-run settlement authority #2444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+521
−53
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
02d9796
fix(codeql): require complete terminal proof
seonghobae dddc1be
docs(codeql): clarify successful-job proof path
seonghobae 72bcf3b
fix(codeql): bind terminal receipts to exact run
seonghobae 5a77a8c
fix(codeql): bind fallback run to merge source
seonghobae 1d07d46
docs(gap): record CodeQL terminal-proof repair
seonghobae 2fb6ec7
fix(docs): preserve complete gap baseline
seonghobae 6492128
fix(codeql): use separate owned app publication and settlement tokens
seonghobae 0538e10
merge: adopt complete CodeQL terminal proof foundation
seonghobae 6952dcc
fix(codeql): publish owned failure receipts after failed gates
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| ## Fixed | ||
|
|
||
| - Require a successful GHAS base/head configuration-identity proof and preserved | ||
| SARIF before a clean central CodeQL gate may settle or satisfy an exact required | ||
| run. A failed post-gate identity check can no longer be promoted to GREEN by a | ||
| wake-only fallback. | ||
| - Bind CodeQL terminal receipts to the live base, required run, head, and merge | ||
| source through the v2 dispatch protocol, preventing a trusted but stale commit | ||
| status from satisfying a retargeted or later required run. |
50 changes: 50 additions & 0 deletions
50
docs/adr/adr-0032-owned-codeql-status-and-settlement-authority.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| --- | ||
| title: "ADR-0032: Owned CodeQL status and settlement authority" | ||
| status: Proposed | ||
| date: "2026-09-27" | ||
| authors: "Codex" | ||
| tags: [architecture, ci, security] | ||
| supersedes: "" | ||
| superseded_by: "" | ||
| --- | ||
|
|
||
| # ADR-0032: Owned CodeQL status and settlement authority | ||
|
|
||
| ## Status | ||
|
|
||
| Proposed. Requires #2405 complete terminal-proof foundation, owned-app installation permission acceptance, and an unchanged-head live canary before protected deployment is accepted. | ||
|
|
||
| ## Context | ||
|
|
||
| DiskSage #473 dispatch 36305375849 encountered cross-repository HTTP403 during status publication and required-run settlement. Public app and organization installation metadata confirm opencode-agent is owned by anomalyco and has Actions/read and statuses/read. A consumer cannot change the external owner's app permissions. The organization-owned cwl-noema-review (app4291520) is already installed on all repositories with security_events/read; its private-key organization secret is available to central workflows. The existing target-scoped analysis-read token remains the GHAS reader. | ||
|
|
||
| ## Decision | ||
|
|
||
| Use the existing owned Noema app for separate target-repository tokens: statuses/write solely for authenticated CodeQL receipt publication, and Actions/write solely for exact required-run settlement. Keep security_events/read in its existing separate read token. The installation must authorize those two write permissions; credentials cannot mint permissions the installation lacks. Optional mint failures retain existing fallback credentials and never create validation success. | ||
|
|
||
| The owned status writer must publish as cwl-noema-review or cwl-noema-review[bot]; another returned creator is rejected. No arbitrary actor is added. Complete base/head/run/source/workflow receipt and terminal SARIF/GHAS proof from #2405 remain prerequisites; do not deploy the new receiver trust before that foundation. Preserve exact-run identity, supersession, rerun budget, SARIF preservation and Medium+ gates. | ||
|
|
||
| ## Consequences | ||
|
|
||
| - POS-001: Removes dependence on an external app owner's unavailable write grants. | ||
| - POS-002: Reuses an installed app and keeps analysis, publication and lifecycle tokens separate and target scoped. | ||
| - NEG-001: Expands the owned installation's capabilities and therefore the impact of its private-key compromise. Restrict key access and retain the trusted default-branch workflow boundary; never export keys into reviewed source or logs. | ||
| - NEG-002: Needs owner-authenticated app settings and installation acceptance plus live verification. Unit contracts do not prove deployment or permission availability. | ||
|
|
||
| ## Alternatives Considered | ||
|
|
||
| - ALT-001: Change the external OpenCode app. Rejected because anomalyco owns that app and its current grants cannot satisfy writes. | ||
| - ALT-002: Transfer a user's CLI token into CI. Rejected: broad personal credentials are unnecessary and not copied. | ||
| - ALT-003: Bypass identity/receipt checks or synthesize success. Rejected because that removes the security proof. | ||
| - ALT-004: Reuse the analysis-read token for mutations. Rejected because its read-only contract must remain unchanged. | ||
|
|
||
| ## Implementation Notes | ||
|
|
||
| - IMP-001: Pin the existing create-github-app-token action and request exactly one target repository and one write permission per writer token. | ||
| - IMP-002: Grant Actions/write and Commit statuses/write to the owned app and accept the installation update; do not add Code Scanning writes. | ||
| - IMP-003: Accept deployment only after real current-head scan, GHAS identity, receipt creator, one exact run-wide wake and terminal required verdict are verified. References: ContextualWisdomLab/.github#2276, #1929 and #2405. | ||
|
|
||
| ## References | ||
|
|
||
| GitHub. (n.d.). *Create GitHub App token*. https://github.com/actions/create-github-app-token | ||
| GitHub. (n.d.). *Choosing permissions for a GitHub App*. https://docs.github.com/en/apps/creating-github-apps/setting-up-a-github-app/choosing-permissions-for-a-github-app |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.