Skip to content

fix(NoTicket): harden CI checkouts and workflow permissions - #541

Merged
lorenzhs merged 2 commits into
mainfrom
lorenz/harden-ci-checkouts
Oct 7, 2026
Merged

lorenzhs merged 2 commits into
mainfrom
lorenz/harden-ci-checkouts

Conversation

@lorenzhs

@lorenzhs lorenzhs commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Remove unused branch inputs and checkout ref overrides from code checks, unit tests, and security scans so each workflow checks out its triggering commit. Disable persisted checkout credentials and deny Actions cache access for code checks to address the cache-poisoning finding.

Declare explicit read-only token defaults across all workflows, retaining job-specific permissions for documentation and release publishing, integration-test status reporting, and SonarCloud PR reads. Include the necessary permissions on reusable-workflow callers.

Two commits address the two alert families separately:

Validation: pre-commit and reusable-workflow permission-chain checks passed. Actionlint passed with the documented cache-mode key excluded because actionlint does not support it yet, and four pre-existing undeclared Core secret references excluded.


Note

Low Risk
Changes are limited to GitHub Actions YAML; they reduce token scope and checkout risk without modifying SDK runtime code.

Overview
Hardens GitHub Actions in response to code-scanning findings on cache poisoning and missing workflow permissions.

Reusable workflows (code-check, unit-tests, security-scan) no longer accept a branch input or override checkout ref, so jobs always build the triggering commit. Checkouts in those paths set persist-credentials: false, and the code-quality job sets cache-mode: none to limit cache-related exposure.

Workflows now declare a default permissions: contents: read, with narrower job-level grants where needed (e.g. contents: write for docs build and release publish, statuses: write for integration-test reporting, pull-requests: read for security scans). Caller workflows pass explicit permissions into reusable security-scan and integration-test jobs so the permission chain stays valid.

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

@lorenzhs
lorenzhs marked this pull request as ready for review October 7, 2026 12:13
@lorenzhs
lorenzhs requested a review from a team as a code owner October 7, 2026 12:13
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

@lorenzhs

lorenzhs commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@lorenzhs

lorenzhs commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@lorenzhs
lorenzhs merged commit 1b2b39a into main Oct 7, 2026
27 of 37 checks passed
@lorenzhs
lorenzhs deleted the lorenz/harden-ci-checkouts branch October 7, 2026 12:29
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