Skip to content

ci: declare workflow-level contents: read on frontend-lint#4118

Open
arpitjain099 wants to merge 1 commit into
linuxfoundation:mainfrom
arpitjain099:chore/declare-workflow-perms-readonly
Open

ci: declare workflow-level contents: read on frontend-lint#4118
arpitjain099 wants to merge 1 commit into
linuxfoundation:mainfrom
arpitjain099:chore/declare-workflow-perms-readonly

Conversation

@arpitjain099
Copy link
Copy Markdown

@arpitjain099 arpitjain099 commented May 15, 2026

Pins the default GITHUB_TOKEN to contents: read on 2 workflows in .github/workflows/ that don't call a GitHub API beyond the initial checkout.

The following files were left implicit because they reference GITHUB_TOKEN / use a write-scope action / trigger on pull_request_target. Those scopes are best declared by maintainers: tinybird-ci.yml.

Why

CVE-2025-30066 (March 2025 tj-actions/changed-files supply-chain compromise) exfiltrated GITHUB_TOKEN from workflow logs. Pinning per workflow caps runtime authority irrespective of the repo or org default, gives drift protection if the default ever widens, and is credited per-file by the OpenSSF Scorecard Token-Permissions check.

YAML validated locally with yaml.safe_load on each touched file.


Note

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

Overview
Adds an explicit workflow-level permissions: contents: read block to the Frontend Lint GitHub Actions workflow so the job’s GITHUB_TOKEN is limited to read-only repository content (enough for checkout and lint), instead of inheriting broader default scopes.

This is a supply-chain / least-privilege hardening step aligned with OpenSSF Scorecard Token-Permissions and post–changed-files incident practice; it does not change lint steps or triggers.

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

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 15, 2026

CLA assistant check
All committers have signed the CLA.

@joanagmaia joanagmaia self-requested a review June 2, 2026 15:36
joanagmaia
joanagmaia previously approved these changes Jun 2, 2026
@joanagmaia
Copy link
Copy Markdown
Contributor

@arpitjain099 can you please sign ALL your commits? You will need both -S -s

@arpitjain099 arpitjain099 force-pushed the chore/declare-workflow-perms-readonly branch from 7d0fdae to 7f45550 Compare June 2, 2026 15:42
@arpitjain099
Copy link
Copy Markdown
Author

Done. I rebased the branch onto current main as a single commit that is both SSH-signed (shows as Verified) and DCO signed-off, which also drops the two earlier unsigned merge commits. All commits on the PR now carry both signatures. Thanks for the review.

@joanagmaia joanagmaia changed the title ci: declare workflow-level contents: read on 2 workflows chore: declare workflow-level contents: read on 2 workflows Jun 2, 2026
@joanagmaia joanagmaia changed the title chore: declare workflow-level contents: read on 2 workflows ci: declare workflow-level contents: read on 2 workflows Jun 2, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 3471d3d. Configure here.

Comment thread .github/workflows/pr-title-lint.yml Outdated
frontend-lint only checks out the repo and lints, so contents: read is sufficient. Dropped the pr-title-lint change: it calls the lfx-ui _pr-title-lint reusable workflow which needs pull-requests access to read PR metadata, so capping the caller to contents: read would break it (per the Bugbot review).

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099 arpitjain099 force-pushed the chore/declare-workflow-perms-readonly branch from 3471d3d to be67523 Compare June 2, 2026 23:15
@arpitjain099
Copy link
Copy Markdown
Author

Good catch by Bugbot, fixed. I dropped the pr-title-lint.yml change: it calls the lfx-ui/_pr-title-lint reusable workflow, which needs pull-requests: read to read PR metadata, so capping the caller to contents: read would have broken it with a 403. The PR now only hardens frontend-lint.yml, which is a plain checkout-and-lint workflow that genuinely needs nothing beyond read.

@arpitjain099 arpitjain099 changed the title ci: declare workflow-level contents: read on 2 workflows ci: declare workflow-level contents: read on frontend-lint Jun 2, 2026
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.

3 participants