Repository navigation
iam: codify the expected OIDC trusts and spored signers; add a checker (#1601) - #1628
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
scttfrdmn
marked this pull request as ready for review
November 14, 2026 20:07
scttfrdmn
force-pushed
the
hardening/oidc-trust
branch
from
November 14, 2026 20:07
622d15f to
c3bb15a
Compare
Merged
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.
Fixes #1601
I can't read live IAM or KMS, so this PR records what the release role's trust and the signing key's policy are expected to say, gates the workflows against that record, and adds a read-only comparison for you to run against the live account.
Added
infra/iam/github-oidc/trusts.json: the expected trust of the two roles spawn's workflows assume. It uses the same schema as spore-host'sinfra/iam/github-oidc/trusts.json(feat(launch): warn when an instance is too small to enforce its own TTL (#682) #709), and the trusts are identical to the ones there:GitHubActions-spore-host-release:audStringEqualssts.amazonaws.com;subStringLikerepo:spore-host/spawn:ref:refs/tags/v*.GitHubActions-spawn-lambda-deploy:subrepo:spore-host/spawn:environment:production, matchingscripts/setup-lambda-deploy-ci-role.sh.infra/iam/github-oidc/signing-key.json: the spored signing key (alias/spored-signing,key/7b28df72-…). Its only signer is the release role. It also holdsrequired_deny: Denykms:Signunlessaws:PrincipalArnis the release role. That Deny is needed whenever the key policy delegates to IAM through the account root.scripts/oidctrust:checkruns in CI and makes no network call. It applies umbrella feat(launch): warn when an instance is too small to enforce its own TTL (#682) #709's rules: one Allow statement; a Federated provider in the role's own account;audpinned;subeither an exact ref or environment, or a tag-only StringLike; no 942542972736. It also requires that the signers are listed roles and that the Deny exempts exactly those signers.livecomparesaws iam get-role,aws kms get-key-policyand spawn's rulesets against the files and reports each difference.oidc_trust_test.gofails when a workflow assumes an unlisted role, when a tag-subrole is assumed outside a push-tags-only workflow or in a job with an environment, when an environment-subrole is assumed outside its environment, when a role is assumed in apull_requestworkflow, whenaws kms signruns without a signer assumed first, or when aused_byentry is stale.oidc_trust_sync_test.go(CI step) fails if spore-host's copy of either trust drifts from this one.I watched the gates fail on these mutations:
workflow_dispatchadded torelease.yaml,environment: productiondropped fromdeploy-lambdas, a broadsub, the default key policy without the Deny, and a renamed environment in the sync test.Compare live (read-only, in 966362334030)
infra/iam/github-oidc/README.mdhas the exact commands. In short:aws iam get-rolefor both roles,aws kms get-key-policyfor the key, andgh apifor the rulesets, thengo -C scripts run ./oidctrust live ....Found from the GitHub side (read today)
gh api repos/spore-host/spawn/rulesetsreturns[], andmainis unprotected. So anyone with write access can push av*tag, and with it obtainkms:Sign. The README gives the ruleset to create. It also describes a stronger alternative: areleaseenvironment with a required reviewer.use_default: true.make checkpasses locally apart from the path-with-a-space failures inlambda/dashboard-api. actionlint reports only the existing SC2001, and semgrep is clean.