Skip to content

iam: codify the expected OIDC trusts and spored signers; add a checker (#1601) - #1628

Merged
scttfrdmn merged 2 commits into
mainfrom
hardening/oidc-trust
Nov 14, 2026
Merged

scttfrdmn merged 2 commits into
mainfrom
hardening/oidc-trust

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

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's infra/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: aud StringEquals sts.amazonaws.com; sub StringLike repo:spore-host/spawn:ref:refs/tags/v*.
    • GitHubActions-spawn-lambda-deploy: sub repo:spore-host/spawn:environment:production, matching scripts/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 holds required_deny: Deny kms:Sign unless aws:PrincipalArn is the release role. That Deny is needed whenever the key policy delegates to IAM through the account root.
  • scripts/oidctrust:
    • check runs 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; aud pinned; sub either 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.
    • live compares aws iam get-role, aws kms get-key-policy and spawn's rulesets against the files and reports each difference.
  • oidc_trust_test.go fails when a workflow assumes an unlisted role, when a tag-sub role is assumed outside a push-tags-only workflow or in a job with an environment, when an environment-sub role is assumed outside its environment, when a role is assumed in a pull_request workflow, when aws kms sign runs without a signer assumed first, or when a used_by entry 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_dispatch added to release.yaml, environment: production dropped from deploy-lambdas, a broad sub, 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.md has the exact commands. In short: aws iam get-role for both roles, aws kms get-key-policy for the key, and gh api for the rulesets, then go -C scripts run ./oidctrust live ....

Found from the GitHub side (read today)

  • gh api repos/spore-host/spawn/rulesets returns [], and main is unprotected. So anyone with write access can push a v* tag, and with it obtain kms:Sign. The README gives the ruleset to create. It also describes a stronger alternative: a release environment with a required reviewer.
  • OIDC sub customization: use_default: true.

make check passes locally apart from the path-with-a-space failures in lambda/dashboard-api. actionlint reports only the existing SC2001, and semgrep is clean.

@codecov

codecov Bot commented Nov 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn marked this pull request as ready for review November 14, 2026 20:07
@scttfrdmn
scttfrdmn force-pushed the hardening/oidc-trust branch from 622d15f to c3bb15a Compare November 14, 2026 20:07
@scttfrdmn
scttfrdmn merged commit 2f518ee into main Nov 14, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the hardening/oidc-trust branch November 14, 2026 20:55
@scttfrdmn scttfrdmn mentioned this pull request Nov 15, 2026
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.

security: spored signing key (kms:Sign) depends on a hand-managed GitHub OIDC role whose trust scope isn't in code

1 participant