fix(security): move maintainer GitHub tokens behind capability files - #311
Closed
seonghobae wants to merge 13 commits into
Closed
fix(security): move maintainer GitHub tokens behind capability files#311seonghobae wants to merge 13 commits into
seonghobae wants to merge 13 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose
Advance #111 with a bounded test-first security slice that removes direct Maintainer App bearer-token reads from both Noema GitHub automation scripts covered by this lane.
scripts/main-governance-audit.mjsandscripts/hourly-commercial-readiness.mjsnow receive only a non-secretNOEMA_MAINTAINER_TOKEN_PATH; the short-lived bearer token is staged by trusted workflow bootstrap shell into an ephemeral runner-temp capability file and passed only to the minimalghsubprocess environment.Fresh source identity
mainimmediately before this metadata update:1f4964fb3102cc1b0a9bcf19acae461904ecc672;fix/github-token-capability-ingress-1f4964;cd4288300e3753b9ae635d8d3b67b0f663c0544d;Test-first construction
0223c6291a9161c428b46275eb93187520238a4eintroduced the initial RED credential-ingress contract while protected source still readprocess.env.GH_TOKENand workflow callers injectedGH_TOKENdirectly.scripts/lib/delegated-github-token.mjscentralizes fail-closed capability-file loading and rejects missing, unreadable, empty, or control-bearing token bytes.scripts/main-governance-audit.mjsresolvesNOEMA_MAINTAINER_TOKEN_PATH, reads the token through that capability, and passes it only to the boundedghsubprocess environment.3d1c2e0d8b5c076170208aec1b39e6c412b632bdextended the contract toscripts/hourly-commercial-readiness.mjs; production source then removed itsprocess.env.GH_TOKENread and uses the same capability reader..github/workflows/hourly-commercial-readiness.ymlbootstraps capability files for both the governance pre-write audit and the exact-head commercial loop..github/workflows/maintainer-app-readiness.ymldoes the same for the governance audit and no-write commercial-loop preflight, while retaining the existing capability-file boundary for the Maintainer App readiness evaluator.process.env.GH_TOKEN, bounded subprocess-environment construction, and the workflow credential-consumer contract.GH_TOKENinjection were updated to assert the new delegated capability contract instead of weakening or deleting those checks.One Contents API test update initially returned GitHub
409 Timed out validating rule; a fresh refetch proved the branch had not moved, and the same bounded update succeeded on retry. That transient control-plane failure remains execution evidence and is not treated as validation proof.Security boundary
This PR does not claim the runner-temp capability file is an organization-wide KV or long-term secret store. The GitHub App action necessarily yields the short-lived token to trusted bootstrap shell; the Node automation scripts no longer source that bearer token directly from their ambient process environment. The helper rejects malformed capability contents and only the minimal
ghchild environment receivesGH_TOKEN.No central
.github, naruon, contextual-orchestrator, branch protection, reviewer authority, release, deployment, outbound license, or external secret state is modified. Issue #111 may still contain broader credential-registry/KV work outside these two Noema automation scripts and should not be closed merely because this slice integrates.Acceptance boundary
Keep Draft until the unchanged exact head has fresh terminal-success application
ci,reviewer-ci, protected-base-eligible centralSecurity Scan, exact 100% owned production statement/branch/function/line coverage, and zero valid unresolved findings. Pending/queued/skipped/absent/neutral/failed/cancelled/stale/predecessor/status-only/model-only/rate-limited evidence is non-passing. No predecessor evidence transfers.