Skip to content

ci: do not persist GITHUB_TOKEN in test checkouts [SEC-2544] - #152

Merged
oliverlaz merged 6 commits into
mainfrom
oliverlazoroski/sec-2544-workflow-sweep
Nov 27, 2026
Merged

oliverlaz merged 6 commits into
mainfrom
oliverlazoroski/sec-2544-workflow-sweep

Conversation

@oliverlaz

@oliverlaz oliverlaz commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Follow-up to SEC-2544 (CI-12). The audit of this repo's workflows found it already hardened: read-only top-level permissions, per-job grants, event data passed through env:, and a release-only guard that checks head repo, author and branch. One gap remained.

Change

  • run_tests.yml and run_integration.yml: actions/checkout now sets persist-credentials: false. Both lanes check out the repository and run its code without ever pushing. Leaving GITHUB_TOKEN in .git/config let that code, or a dependency it installs, reuse the token.

regen.yml keeps its credentials because it pushes, and SEC-2541 owns that file.

Verification

actionlint is clean apart from the known client-id false positive on create-github-app-token@v3. zizmor --offline --persona=auditor no longer reports artipacked for these files.

Left to other PRs: release publish secrets outside an environment (#149, SEC-2515).


Note

Low Risk
CI-only security tightening with no application or runtime behavior changes.

Overview
Hardens read-only CI lanes by setting persist-credentials: false on actions/checkout in run_tests.yml and run_integration.yml.

Those jobs only check out code and run Gradle; they never push. Without this, the default checkout behavior leaves GITHUB_TOKEN in .git/config, so job code or installed dependencies could reuse it. Workflows that still need credentials for push (e.g. regen.yml) are unchanged.

Reviewed by Cursor Bugbot for commit b2376bb. Bugbot is set up for automated code reviews on this repo. Configure here.

The unit and integration lanes check out the repository and then run its
code, but never push. Leaving the token in .git/config lets that code, or
anything it pulls in, reuse it.

SEC-2544
@oliverlaz
oliverlaz requested a review from mogita November 25, 2026 11:37
@oliverlaz
oliverlaz marked this pull request as ready for review November 25, 2026 12:39
@oliverlaz
oliverlaz merged commit 6325a0b into main Nov 27, 2026
11 checks passed
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.

2 participants