-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ci): do not persist the job token in .git/config in the public-repo guard #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,8 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
Comment on lines
45
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔍 Same hardening missing on other org workflows using checkout A repo-wide grep shows Was this helpful? React with 👍 or 👎 to provide feedback.
Comment on lines
+46
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟨 Distributed guard workflow template still persists the job credential in .git/config The hardening ( Was this helpful? React with 👍 or 👎 to provide feedback. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The credential-persistence fix (persist-credentials: false) was added here but the vendored template at workflow-templates/public-repo-guard.yml, which other repositories copy when installing this guard, still has a bare Prompt for AI agents |
||
|
|
||
| # gitleaks' GitHub Action requires a paid license for organizations; the CLI | ||
| # itself is MIT-licensed and free. Pin the version AND verify the release | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Shared copy of the security-gate workflow still leaves the job credential on disk
The hardening step that stops the job's credential from being written to disk (
persist-credentials: falseat.github/workflows/public-repo-guard.yml:46-47) was added only to this repo's own copy and not to the shared template other repositories install from, so every repo that copies the gate keeps the old, unhardened behavior.Impact: Repos adopting the published guard template continue to expose the build credential to later steps, so the fix does not actually reach the repos it was meant to protect.
Divergence between the live workflow and the vendored workflow template
workflow-templates/public-repo-guard.ymlis the copy the org's "install on a new repo" flow uses (the header at.github/workflows/public-repo-guard.yml:16-19instructs copying the workflow file alongside.gitleaks.tomlandscripts/public-repo-guard/content-policy.sh). A diff of the two files shows the only difference is the two newly added lines;workflow-templates/public-repo-guard.yml:45still has a bare- uses: actions/checkout@...with nowith:block.Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.