Skip to content

feat(gha-audit): flag a static cloud key where OIDC would do (AWS, GCP, Azure) - #1128

Merged
sandstream merged 6 commits into
mainfrom
claude/web-kit-status-sync-p6fg9a-gha-static-cloud-keys
Nov 27, 2026
Merged

sandstream merged 6 commits into
mainfrom
claude/web-kit-status-sync-p6fg9a-gha-static-cloud-keys

Conversation

@sandstream

Copy link
Copy Markdown
Owner

What

kit had no row for a long-lived cloud key used where the provider accepts GitHub's OIDC token. The research note's deploy workflow passes aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} and the secret key to aws-actions/configure-aws-credentials. kit named the key pair only inside the install-scripts row.

A new rule, src/gha-static-cloud-keys.ts, wired into auditWorkflow, flags these per job:

Provider Static-key shape flagged OIDC fix named in the suggestion
AWS aws-actions/configure-aws-credentials given aws-access-key-id / aws-secret-access-key; or env: setting AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY from ${{ secrets.* }} role-to-assume
GCP google-github-actions/auth given credentials_json workload_identity_provider (+ service_account)
Azure azure/login given creds client-id, tenant-id, subscription-id, no creds

The row is static <cloud> key on job <id> (<file>). An AWS key in the workflow-level env: gives workflow-level static AWS key (<file>). Every suggestion says to grant id-token: write on that job only (not workflow-wide), to trust only this repository and branch on the provider side, to delete the stored key, and it links the provider's guide. Severity is medium, under OWASP CICD-SEC-6 (Insufficient Credential Hygiene).

It is the pair to the existing id-token rows. Those flag OIDC granted where nothing uses it. This one flags a stored key where OIDC would do. Once the fix is applied, src/gha-id-token.ts already counts all three actions as OIDC users, so the job-scoped id-token: write will not be flagged as unused.

Vendor docs, quoted in the fixture comments of src/gha-static-cloud-keys.test.ts:

Before / after

On the note's deploy.yml (configure-aws-credentials with the key pair, then aws s3 sync with the same keys in env):

Before (main): unpinned-action rows, workflow-level id-token: write, and install scripts run with credentials: job deploy … holds secrets AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY. Nothing about OIDC.

After: the same rows, plus

! static AWS key on job deploy (deploy.yml)  job "deploy" signs in to AWS with a long-lived key (aws-actions/configure-aws-credentials input aws-access-key-id, aws-actions/configure-aws-credentials input aws-secret-access-key, env AWS_ACCESS_KEY_ID from secrets, env AWS_SECRET_ACCESS_KEY from secrets) where OIDC would do: the key works from anywhere until it is rotated, and every later step and action in the job can read it
    use OIDC: give aws-actions/configure-aws-credentials `role-to-assume: <role ARN>`, grant `id-token: write` on this job only (not at workflow level), trust only this repository and branch on the AWS side, then delete the stored key. Guide: https://docs.github.com/…/configuring-openid-connect-in-amazon-web-services

The tests cover the AWS action input, AWS env at step and workflow level (quoted and unquoted), GCP credentials_json and Azure creds (with Azure/login in mixed case). They also cover what must not flag: each provider's OIDC form, a creds: input on an unrelated action, and a commented-out key. On main the test cannot load, because the module does not exist. The CLI output above is the behavioural before.

Limits (said here, not hidden)

  • This is a line scan. A key given in a flow mapping (with: { creds: … }) is not seen.
  • GCP and Azure are flagged by the action input only. An env such as GOOGLE_APPLICATION_CREDENTIALS or AZURE_CREDENTIALS used without the action is not flagged.
  • The rule does not check whether the cloud account actually trusts GitHub's OIDC issuer. It only says the provider supports it.

Docs

The kit gha-audit row in docs/COMMANDS.md describes the rule. Fragment: changes/gha-static-cloud-keys.md. No path in .github/kit-protected-paths.json is touched, because the fixtures are test strings and not .github/ files. The branch therefore has no protected- prefix.

Scope notes

  • Harnesses: this is a static workflow-file rule and does not depend on the harness. It gives the same result whether kit runs from Claude Code, Codex or any other harness kit supports.
  • This PR and the write-all PR both edit the same kit gha-audit line in docs/COMMANDS.md. Whichever merges second needs a rebase of that one line.
  • Tested on Linux, and Windows CI runs the tests. macOS is unverified. It is a pure text scan.

Found by kit-research#239 (docs/research/linkedin-batch-2026-11-27-vs-kit.md, GitHub hardening table: "OIDC instead of stored cloud secrets: No row").


Generated by Claude Code

A job that passes a stored AWS key pair to configure-aws-credentials,
sets AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY from secrets in env, gives
google-github-actions/auth credentials_json, or gives azure/login creds
now gets a row. The suggestion names the provider's OIDC inputs, asks
for id-token: write on that job only, and links the provider's guide.

Found by kit-research#239.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published.

@sandstream-kit-reviewer sandstream-kit-reviewer 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.

kit review gate at fafb8be1afd9: gates passed. All 33 checks passed on this commit, no file is in a protected class, 5 files and 283 lines changed. This approval is deterministic; it does not judge what the change is for.

…-sync-p6fg9a-gha-static-cloud-keys

# Conflicts:
#	docs/COMMANDS.md
@github-actions

Copy link
Copy Markdown

Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published.

@sandstream-kit-reviewer sandstream-kit-reviewer 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.

kit review gate at 98ffd7f866e9: gates passed. All 33 checks passed on this commit, no file is in a protected class, 5 files and 283 lines changed. This approval is deterministic; it does not judge what the change is for.

Keep both gha-audit rules: write-all (#1124) and static cloud keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published.

@sandstream-kit-reviewer sandstream-kit-reviewer 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.

kit review gate at a315563bfa75: not approved.

  • checks did not pass: windows shard 1/4, windows-native

Kit-Hook-Tree: 30d408e

# Conflicts:
#	docs/COMMANDS.md
Kit-Hook-Tree: 35b7cf9

# Conflicts:
#	docs/COMMANDS.md
@github-actions

Copy link
Copy Markdown

Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published.

@sandstream-kit-reviewer sandstream-kit-reviewer 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.

kit review gate at 3afdfbec8e66: gates passed. All 33 checks passed on this commit, no file is in a protected class, 5 files and 313 lines changed. This approval is deterministic; it does not judge what the change is for.

@github-actions

Copy link
Copy Markdown

Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published.

@sandstream-kit-reviewer sandstream-kit-reviewer 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.

kit review gate at 657849cb5322: gates passed. All 33 checks passed on this commit, no file is in a protected class, 5 files and 313 lines changed. This approval is deterministic; it does not judge what the change is for.

@sandstream
sandstream merged commit f915d43 into main Nov 27, 2026
33 checks passed
@sandstream
sandstream deleted the claude/web-kit-status-sync-p6fg9a-gha-static-cloud-keys branch November 27, 2026 15:29
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.

2 participants