WIP: ci: prevent checkout credential persistence #2

Closed
clawlter wants to merge 2 commits from audit/ci-credential-hardening into main
Owner

Summary

  • Explicitly sets persist-credentials: false on the Forgejo checkout v6 step.
  • Adds a fail-closed post-checkout guard that rejects local credential helpers, HTTP auth headers, conditional credential includes, custom SSH commands, and user-info in the origin URL. The guard only checks command status/key names and never logs remote or Git-config values.

Verification

  • actionlint 1.7.12 passed (the known external Forgejo action-URL format diagnostic was explicitly ignored).
  • Exact guard green case passed on the current clone.
  • A safe red-capable probe passed: clean state accepted; each of credential helper, HTTP extraheader, conditional include, custom SSH command, and user-info URL state was rejected.
  • git diff --check passed; commit 3858e2db83893a65a19b4abc787dc51d9f58d204 is GPG-signed.
  • make validate could not complete because its pre-existing generation step could not resolve/download bentrumanforcongress.com (DNS error / curl exit 6), not because of the workflow-only change.

Supported-permissions limitation

The current server's matching Forgejo v15.0.4 source assigns same-repository Action PR tasks write access by default and only assigns read access for fork PRs: GetActionRepoPermission. This release does not enforce a GitHub-style workflow permissions: contents: read declaration for the automatic token. I intentionally did not add an unenforced declaration or represent it as a security control. A server/operator-side token-scope policy or upgrade is needed to constrain same-repository PR token capability; this PR prevents checkout from persisting that token in Git configuration/helper state after checkout.

Rollback

Revert 3858e2d (only .forgejo/workflows/booklet.yml changes).

## Summary - Explicitly sets `persist-credentials: false` on the Forgejo checkout v6 step. - Adds a fail-closed post-checkout guard that rejects local credential helpers, HTTP auth headers, conditional credential includes, custom SSH commands, and user-info in the `origin` URL. The guard only checks command status/key names and never logs remote or Git-config values. ## Verification - `actionlint 1.7.12` passed (the known external Forgejo action-URL format diagnostic was explicitly ignored). - Exact guard green case passed on the current clone. - A safe red-capable probe passed: clean state accepted; each of credential helper, HTTP extraheader, conditional include, custom SSH command, and user-info URL state was rejected. - `git diff --check` passed; commit `3858e2db83893a65a19b4abc787dc51d9f58d204` is GPG-signed. - `make validate` could not complete because its pre-existing generation step could not resolve/download `bentrumanforcongress.com` (DNS error / curl exit 6), not because of the workflow-only change. ## Supported-permissions limitation The current server's matching Forgejo v15.0.4 source assigns same-repository Action PR tasks write access by default and only assigns read access for fork PRs: [`GetActionRepoPermission`](https://codeberg.org/forgejo/forgejo/src/tag/v15.0.4/models/perm/access/repo_permission.go#L143-L164). This release does not enforce a GitHub-style workflow `permissions: contents: read` declaration for the automatic token. I intentionally did not add an unenforced declaration or represent it as a security control. A server/operator-side token-scope policy or upgrade is needed to constrain same-repository PR token capability; this PR prevents checkout from persisting that token in Git configuration/helper state after checkout. ## Rollback Revert `3858e2d` (only `.forgejo/workflows/booklet.yml` changes).
ci: prevent checkout credential persistence
Some checks failed
Booklet CI / Validate and build booklet PDFs (pull_request) Failing after 10m7s
3858e2db83
clawlter changed title from ci: prevent checkout credential persistence to WIP: ci: prevent checkout credential persistence 2026-07-12 13:16:17 -04:00
ci: reject scoped credential helpers
Some checks failed
Booklet CI / Validate and build booklet PDFs (pull_request) Failing after 15m23s
5201a4c3b4
Author
Owner

Closing without merge because the owner cancelled the code-security-audit-2026-07 campaign. This does not revert previously merged work.

Closing without merge because the owner cancelled the `code-security-audit-2026-07` campaign. This does not revert previously merged work.
clawlter closed this pull request 2026-07-14 08:16:27 -04:00
Some checks failed
Booklet CI / Validate and build booklet PDFs (pull_request) Failing after 15m23s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
clawlter/chamblee-2026-booklet!2
No description provided.