Summary
checkoutMustNotPersistCredentials (rule artipacked, ISSUE-307, severity
high) is implemented in policies/artipacked.rego but benched in
configuration/registry.go — its findings are dropped before scoring and
output. This issue tracks promoting it to a shipping GitHub control.
Defends against: credential exfiltration through .git/config. See
docs/EXPLOIT_PATH_COVERAGE.md (path E6, Tier 1).
What to detect
A job with an actions/checkout step that does not set
with.persist-credentials: false.
By default actions/checkout writes the GITHUB_TOKEN into the cloned repo's
.git/config, where it survives for the lifetime of the job. Any later step
that uploads .git as part of an artefact, or that runs fork-controlled code,
can exfiltrate the token. The check accepts both the boolean false and the
quoted "false" form.
# vulnerable — token persisted in .git/config
- uses: actions/checkout@v4
Remediation (for docs/GITHUB_ISSUES.md)
Disable credential persistence unless a later step genuinely needs to push with
the token. It is a one-line change.
# fixed
- uses: actions/checkout@v4
with:
persist-credentials: false
Acceptance criteria
Example workflow: lab-plumber-advisories/.github/workflows/artipacked.yml (VULN + SAFE cases).
Summary
checkoutMustNotPersistCredentials(ruleartipacked,ISSUE-307, severityhigh) is implemented in
policies/artipacked.regobut benched inconfiguration/registry.go— its findings are dropped before scoring andoutput. This issue tracks promoting it to a shipping GitHub control.
Defends against: credential exfiltration through
.git/config. Seedocs/EXPLOIT_PATH_COVERAGE.md(path E6, Tier 1).What to detect
A job with an
actions/checkoutstep that does not setwith.persist-credentials: false.By default
actions/checkoutwrites theGITHUB_TOKENinto the cloned repo's.git/config, where it survives for the lifetime of the job. Any later stepthat uploads
.gitas part of an artefact, or that runs fork-controlled code,can exfiltrate the token. The check accepts both the boolean
falseand thequoted
"false"form.Remediation (for
docs/GITHUB_ISSUES.md)Disable credential persistence unless a later step genuinely needs to push with
the token. It is a one-line change.
Acceptance criteria
checkoutMustNotPersistCredentialsfrombenchedControls[ProviderGitHub]inconfiguration/registry.go.policies/rules_test.gowithpolicies/testdata/fixtures: checkout with nowith:(flag),with:block withoutpersist-credentials(flag),persist-credentials: false(silent).checkoutMustNotPersistCredentialsto the GitHubcontrols:block of.plumber.yamlwithenabled: true.ISSUE-307entry indocs/GITHUB_ISSUES.md.make build && make test && make lintgreen.Example workflow:
lab-plumber-advisories/.github/workflows/artipacked.yml(VULN + SAFE cases).