Mint read-only App token for zizmor audit - #29
Closed
Wenxin Jiang (Wenxin-Jiang) wants to merge 2 commits into
Closed
Wenxin Jiang (Wenxin-Jiang) wants to merge 2 commits into
Wenxin Jiang (Wenxin-Jiang) wants to merge 2 commits into
Conversation
Repositories that pin actions or reusable workflows from other private Socket repositories fail the audit: zizmor's online provenance checks cannot list refs with the repository GITHUB_TOKEN and abort the run. When a repository provides vars.SOCKET_PR_CLIENT_ID and secrets.SOCKET_PR_APP_PRIVATE_KEY, mint a contents:read installation token for the audit step; otherwise, on Dependabot PRs and on cross-repository PRs, fall back to GITHUB_TOKEN so behavior is unchanged. The secret access is suppressed inline for secrets-outside-env; this workflow runs without an environment by design. Assisted-by: Claude Code:claude-fable-5-1 Claude-Session: https://claude.ai/code/session_01FqKyQNqkiw7aakGFPCTg9t
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Wenxin Jiang (Wenxin-Jiang)
enabled auto-merge (squash)
September 14, 2026 18:05
Review feedback: an installation-wide token from the Socket PR App exposes every installed repository if leaked, and that App's private key can mint write tokens, so it is not a read-only credential. Mint from dedicated ZIZMOR_AUDIT_APP_* credentials instead, intended for an App whose installation only grants read access, and restrict the token to the repositories each consumer names in ZIZMOR_AUDIT_REPOSITORIES. Minting is skipped unless both are set. Assisted-by: Claude Code:claude-fable-5-1 Claude-Session: https://claude.ai/code/session_01FqKyQNqkiw7aakGFPCTg9t
Author
|
[agent] Closing: no longer needed. depscan PR SocketDev/depscan#26088 was reworked so depscan no longer calls Patchpedia reusable workflows (commit 125c280ba7). Patchpedia CI owns publication and depscan only reads the published release, so the audit has no private cross-repository |
auto-merge was automatically disabled
September 14, 2026 19:35
Pull request was closed
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.
LLM Description written by Claude Code:claude-fable-5-1
The required Audit GitHub Actions check aborts in any repository that pins an action or reusable workflow from another private Socket repository. zizmor's online
impostor-commitandref-confusionaudits list the target repository's refs; the repositoryGITHUB_TOKENcannot read another private repository, the error is fatal, and zizmor exits withfatal: no audit was performed. First instance: depscan#26088, which pinsSocketDev/patchpedia/.github/workflows/*-drop.yaml@<sha>(failing job). zizmor 1.23.1 has no per-file or per-repository escape (ignore rules filter findings after the audit; upstream zizmor#1350 recommends a token with access).Change
When the audited repository provides
vars.ZIZMOR_AUDIT_APP_CLIENT_ID,secrets.ZIZMOR_AUDIT_APP_PRIVATE_KEYandvars.ZIZMOR_AUDIT_REPOSITORIES, mint acontents: readinstallation token restricted to the repositories named inZIZMOR_AUDIT_REPOSITORIESand pass it to zizmor. Everything else falls back toGITHUB_TOKEN, so repositories without those values behave exactly as today.continue-on-error, so a failed mint still falls back instead of failing the audit.Report token sourcelogsmintedorfallback GITHUB_TOKENso the effective mode is visible in the job log.actions/create-github-app-tokenis pinned to the same SHA depscan uses (v3.2.0). The token is revoked in the action's post step.secrets-outside-envis suppressed inline for the one secret reference; this workflow intentionally runs without an environment. Negative check: removing the comment yields one Medium finding (exit 13).Provisioning (platform, before any repository opts in)
socket-zizmor-audit) with repository permissions Metadata: read and Contents: read only, no other permissions, no webhook.patchpedia) plus the consuming repositories.ZIZMOR_AUDIT_APP_CLIENT_IDand org secretZIZMOR_AUDIT_APP_PRIVATE_KEY, visible only to consuming repositories.ZIZMOR_AUDIT_REPOSITORIES(comma-separated) to exactly the private repositories its workflows pin. depscan:patchpedia.The first revision of this PR reused the Socket PR App credentials. Review feedback rejected that: its installation-wide token would expose every installed repository if leaked, and that App's private key can mint
contents: write,pull-requests: writeandactions: writetokens, so it is not a read-only credential. This revision keeps the key that this job can see limited to an App whose installation is itself read-only and repository-scoped.Trust boundary
Pre-existing: the audit reads
zizmor.yml, ignore comments and.gitignorefrom the PR checkout. New: the audit job holds a short-lived read-only token for the allowlisted repositories, used only for zizmor's API calls (zizmor does not execute workflows), and can reference the dedicated App's private key when the repository exposes it.Validation
zizmor==1.23.1 .github --min-severity mediumon this branch: no findings, exit 0.actionlint 1.7.12: clean, including the multi-lineif:.audit token: mintedonce provisioning is done.This replaces the closed #28, which scoped a depscan-specific
impostor-commitexception via a double scan; this change keeps provenance auditing enabled everywhere.🤖 Generated with Claude Code
https://claude.ai/code/session_01FqKyQNqkiw7aakGFPCTg9t