fix(ci): do not persist the job token in .git/config in the public-repo guard - #28
fix(ci): do not persist the job token in .git/config in the public-repo guard#28yakimoto wants to merge 1 commit into
Conversation
…po guard actions/checkout without persist-credentials:false leaves GITHUB_TOKEN readable in .git/config for every later step — including the one that downloads and executes the gitleaks binary. Nothing in this job uses the credential (contents:read, gitleaks runs --no-git, no gh/push steps). Refs #1870.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_95a2221e-a844-4add-af30-650510d2e165) |
ApprovabilityVerdict: Approved a925ae0 This is a minor CI security hardening change that prevents the job token from being persisted in git config - a standard best practice. The author is the designated code owner of this workflow file. You can customize Macroscope's approvability policy. Learn more. |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | ||
| with: | ||
| persist-credentials: false |
There was a problem hiding this comment.
🔍 Installation instructions unchanged but hardening is workflow-local
The header comment (lines 16-19) instructs copying the three guard files into other repos verbatim. This hardening change lives only in this repo's copy; sibling public repos that already vendored the workflow will keep persisting the job token unless the same edit is propagated. Consider syncing the change across the other repos that vendored this guard.
Was this helpful? React with 👍 or 👎 to provide feedback.
PR Summary by QodoCI: prevent GITHUB_TOKEN persistence in public-repo guard checkout
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTo customize comments, go to the Qodo configuration screen, or learn more in the docs. |
Qodo FixerNo findings are available for this PR yet. Findings appear here once Qodo has reviewed the PR. |
|
This PR is redundant with #25 ( Evidence — #25's diff to + # tree. Nothing here pushes -- the scan is `--no-git` over the working tree --
+ # so no step needs authenticated Git; drop it. (zizmor: artipacked)
+ persist-credentials: false#25 is also broader than this PR: it syncs the whole vendored Closing as redundant. This duplicate exists because the fan-out that opened this PR |
Why
actions/checkoutwithoutpersist-credentials: falsewrites the job's GITHUB_TOKEN into.git/config, where any later step — or anything those steps execute — can read it. This is thesecurity gate that DOWNLOADS AND EXECUTES the gitleaks binary, and the workflow's own comment
already reasons about tampered downloads ("so a tampered or MITM'd download can never execute
inside the security gate"), so the threat model is written down and only the credential half of
the mitigation is missing. Found by zizmor as
warning[artipacked]: credential persistence through GitHub Actions artifacts.Safety
Verified this job only: checks out, installs gitleaks (pinned + checksum), runs
gitleaks detect --no-git, installs ripgrep, runscontent-policy.sh.permissions: contents: read. Nothing pushes, callsgh, or reads GITHUB_TOKEN/GH_TOKEN, so the token was never neededin
.git/configin the first place.Refs wave-av/claude-workstation#1870.
Note
Cursor Bugbot is generating a summary for commit a925ae0. Configure here.
Note
Stop persisting the job token in
.git/configin the public-repo guard CI workflowSets
persist-credentials: falseon theactions/checkoutstep in public-repo-guard.yml so the GitHub job token is not written to the local git config during the workflow run.Macroscope summarized a925ae0.