Skip to content

ci: declare contents:read on test-codex-build workflow#156

Merged
reakaleek merged 2 commits into
elastic:mainfrom
arpitjain099:chore/declare-workflow-perms
May 18, 2026
Merged

ci: declare contents:read on test-codex-build workflow#156
reakaleek merged 2 commits into
elastic:mainfrom
arpitjain099:chore/declare-workflow-perms

Conversation

@arpitjain099
Copy link
Copy Markdown
Contributor

Adds a workflow-level permissions: contents: read block. The job here only checks out the repository and runs its tests / validation; no GitHub API call beyond the initial checkout is needed.

CVE-2025-30066 (the March 2025 tj-actions/changed-files supply-chain compromise) is the canonical motivation: a tampered third-party action exfiltrated GITHUB_TOKEN from workflow logs and the leaked token retained whatever scope was issued at the workflow level. Per-workflow caps bound that runtime authority irrespective of repo or org default, give drift protection if the default ever widens, and register with OpenSSF Scorecard's Token-Permissions check (which only credits explicit per-workflow declarations).

YAML validated locally with yaml.safe_load.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099 arpitjain099 requested a review from a team as a code owner May 14, 2026 16:18
@arpitjain099 arpitjain099 requested a review from technige May 14, 2026 16:18
@cla-checker-service
Copy link
Copy Markdown

cla-checker-service Bot commented May 14, 2026

💚 CLA has been signed

@arpitjain099
Copy link
Copy Markdown
Contributor Author

The check-labels job is failing because the PR is missing one of the required labels and external contributors can't apply labels themselves. Could a maintainer apply chore (or whichever of automation, changelog:skip, ci fits your conventions better)? CLA is now signed. Happy to amend the title or body if a particular label needs that first.

cc @cotti / @reakaleek / @theletterf, looks like you've been on the recent merge flow here.

@reakaleek
Copy link
Copy Markdown
Member

Thank you @arpitjain099 for making our workflows safer.

@reakaleek reakaleek merged commit 6b22452 into elastic:main May 18, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants