Skip to content

ci: declare contents:read on slack-lite workflow#5075

Merged
trentm merged 1 commit into
elastic:mainfrom
arpitjain099:chore/declare-workflow-perms-1778777857-39
May 20, 2026
Merged

ci: declare contents:read on slack-lite workflow#5075
trentm merged 1 commit into
elastic:mainfrom
arpitjain099:chore/declare-workflow-perms-1778777857-39

Conversation

@arpitjain099
Copy link
Copy Markdown
Contributor

Pins this scheduled workflow to permissions: contents: read at the workflow level. The job checks out the repo, runs the data-gathering scripts, and posts the result to an external endpoint (Slack, internal dashboard, etc) using a separately-stored bot token. GITHUB_TOKEN itself is only used by the initial checkout, which is a read operation.

The reason to declare this explicitly even on a cron-style workflow that already routes writes through a different token is CVE-2025-30066 (the March 2025 tj-actions/changed-files supply-chain compromise). A tampered third-party action exfiltrates GITHUB_TOKEN from workflow logs and the leaked token carries whatever scope was issued at the workflow level. Without a per-workflow declaration, that scope defaults to the org or repo default, which is often broader than what the workflow actually uses. Capping at contents: read bounds the runtime authority irrespective of that default, gives drift protection if it ever widens, and registers with OpenSSF Scorecard's Token-Permissions check.

YAML validated locally with yaml.safe_load.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099 arpitjain099 requested review from a team as code owners May 14, 2026 16:57
@github-actions
Copy link
Copy Markdown

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Copy Markdown
Member

@trentm trentm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@trentm trentm enabled auto-merge (squash) May 20, 2026 17:54
@trentm trentm merged commit c23cb08 into elastic:main May 20, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants