Skip to content

fix(ci): do not persist the job token in .git/config in the public-repo guard - #21

Closed
yakimoto wants to merge 1 commit into
mainfrom
fix/1870-persist-credentials-false
Closed

fix(ci): do not persist the job token in .git/config in the public-repo guard#21
yakimoto wants to merge 1 commit into
mainfrom
fix/1870-persist-credentials-false

Conversation

@yakimoto

@yakimoto yakimoto commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Why

actions/checkout without persist-credentials: false writes the job's GITHUB_TOKEN into
.git/config, where any later step — or anything those steps execute — can read it. This is the
security 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, runs content-policy.sh. permissions: contents: read. Nothing pushes, calls gh, or reads GITHUB_TOKEN/GH_TOKEN, so the token was never needed
in .git/config in the first place.

Refs wave-av/claude-workstation#1870.


Open in Devin Review

Note

Cursor Bugbot is generating a summary for commit e81e668. Configure here.

Review in cubic

…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.
@cursor

cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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_dedcb77e-133e-4cd6-a013-32a046d649e8)

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

CI: prevent GITHUB_TOKEN persistence in public-repo guard checkout

🐞 Bug fix ⚙️ Configuration changes 🕐 Less than 10 minutes

Grey Divider

AI Description

• Disable credential persistence during checkout in the public-repo guard workflow.
• Prevent later steps from reading GITHUB_TOKEN from ".git/config".
• Align the workflow with its existing “tamper-resistant execution” threat model.
Diagram

graph TD
  A["public-repo-guard job"] --> B["actions/checkout (no creds)"] --> D["Install gitleaks (verified)"] --> E["gitleaks scan (--no-git)"] --> F["content policy scan"]
  B -.-> C[".git/config"]
Loading
High-Level Assessment

Using actions/checkout with persist-credentials: false is the most direct and standard mitigation for preventing GITHUB_TOKEN from being written to .git/config in jobs that don’t need it. Alternatives like setting an explicit token or restructuring steps don’t improve safety meaningfully here given contents:read and no push/gh usage.

Files changed (1) +2 / -0

Other (1) +2 / -0
public-repo-guard.ymlDisable checkout credential persistence for the guard job +2/-0

Disable checkout credential persistence for the guard job

• Configures actions/checkout to use persist-credentials: false so the job’s GITHUB_TOKEN is not stored in .git/config. This reduces token exposure to subsequent steps, including the step that downloads and executes the gitleaks binary.

.github/workflows/public-repo-guard.yml

@macroscopeapp

macroscopeapp Bot commented Aug 6, 2026

Copy link
Copy Markdown

Approvability

Verdict: Approved e81e668

This is a minor CI security hardening change that adds persist-credentials: false to a checkout action, following GitHub Actions best practices. The change is made by the designated code owner and has no runtime impact.

You can customize Macroscope's approvability policy. Learn more.

@devin-ai-integration devin-ai-integration 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

Qodo Fixer

No findings are available for this PR yet. Findings appear here once Qodo has reviewed the PR.

@yakimoto

yakimoto commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

This PR is redundant with #16 (chore/guard-canonical-sync), which is already open and already contains this exact change.

Evidence — #16's diff to .github/workflows/public-repo-guard.yml includes:

+          # 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

#16 is also broader than this PR: it syncs the whole vendored public-repo-guard trio to
the canonical source (wave-foundation/scaffolder/public-repo-guard) byte-for-byte, verified by
git blob SHA, rather than adding this one line in isolation.

Closing as redundant. This duplicate exists because the fan-out that opened this PR
(refs claude-workstation#1870) did not check for in-flight PRs touching the same file before
going out — #16 was already open. Merge #16 instead.

@yakimoto yakimoto closed this Aug 6, 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.

1 participant