Skip to content

tune: credit env-reviewer gate, read-only token, and pre-checkout-staged sibling actions#30

Open
north-echo wants to merge 1 commit into
mainfrom
tune/env-gate-readonly-staged-sibling
Open

tune: credit env-reviewer gate, read-only token, and pre-checkout-staged sibling actions#30
north-echo wants to merge 1 commit into
mainfrom
tune/env-gate-readonly-staged-sibling

Conversation

@north-echo

Copy link
Copy Markdown
Owner

Summary

Three mitigation-aware tuning fixes that eliminate a class of false-positive critical findings on properly-hardened pull_request_target / workflow_run pipelines. All emerged from a deep triage of a heavily-hardened flagship repo where 15 raw criticals were confirmed (statically + at runtime via environment-protection and run-history APIs) to be false positives.

Changes

  • FG-016 read-only token — now credits a read-only (read-all) or empty token with no secrets in scope, mirroring FG-001's ReadOnlyToken/NoCredentialExec handling. Fork code running under plain pull_request with a read-only token is normal CI, not a secret-exfil pwn request → downgrade to info.
  • FG-016 staged sibling dir — new localActionStagedBeforeForkCheckout: a uses: ./../<dir>/... action that escapes the workspace and is staged by a run step before the untrusted checkout is trusted by construction (actions/checkout cannot write to a ..-escaping sibling dir). This is GitHub's recommended "copy trusted scripts out of the checkout" hardening idiom.
  • FG-008 + FG-001 environment gate — one-level downgrade (critical→high) when the executing job declares an environment:, which may carry required-reviewer protection that pauses fork PRs for manual approval. Protection rules aren't visible in the workflow YAML, so this is a conservative downgrade, not a suppression — the finding is still surfaced for a triager to verify reviewers.

Testing

  • 3 new synthetic fixtures + 4 test functions (TestCheckLocalActionUntrustedCheckout_ReadOnlyToken, _StagedSiblingDir, TestCheckOIDC_EnvironmentGated, TestCheckPwnRequest_EnvironmentGated).
  • CGO_ENABLED=0 go test ./... green; fluxgate scan . self-scan clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NsA3oSPb5utBAKAjRVas6R

…ged sibling actions

Three mitigation-aware tuning fixes that eliminate a class of false-positive
criticals on properly-hardened pull_request_target/workflow_run pipelines:

- FG-016 now credits a read-only (read-all) or empty token with no secrets in
  scope, mirroring FG-001's ReadOnlyToken/NoCredentialExec handling. Fork code
  running under plain `pull_request` with a read-only token is normal CI, not a
  secret-exfil pwn request.
- FG-016 gains localActionStagedBeforeForkCheckout: a `uses: ./../<dir>/...`
  action that escapes the workspace and is staged by a run step BEFORE the
  untrusted checkout is trusted by construction (actions/checkout cannot write to
  a `..`-escaping sibling dir). This is GitHub's recommended "copy trusted
  scripts out of the checkout" hardening idiom.
- FG-008 and FG-001 apply a one-level downgrade (critical->high) when the
  executing job declares an `environment:`, which may carry required-reviewer
  protection that pauses fork PRs for manual approval. Protection rules aren't
  visible in the workflow YAML, so this is a conservative downgrade, not a
  suppression.

Adds 3 synthetic fixtures and 4 test functions. Full suite + self-scan green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NsA3oSPb5utBAKAjRVas6R
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.

1 participant