Skip to content

ci: declare contents:read on license + yarn-audit workflows#5054

Merged
lukaszgryglicki merged 1 commit into
linuxfoundation:devfrom
arpitjain099:chore/audit-and-license-permissions
May 28, 2026
Merged

ci: declare contents:read on license + yarn-audit workflows#5054
lukaszgryglicki merged 1 commit into
linuxfoundation:devfrom
arpitjain099:chore/audit-and-license-permissions

Conversation

@arpitjain099
Copy link
Copy Markdown
Contributor

Pins three workflows to contents: read at workflow scope. license-header-check.yml runs ./check-headers.sh against the cla-backend, cla-backend-legacy, cla-backend-go and cla-frontend trees. The two yarn-scan workflows run yarn install + yarn audit on cla-backend-go and cla-backend respectively. None of them write to the repo or post comments.

Defense-in-depth motivation is the CVE-2025-30066 tj-actions/changed-files precedent: a compromised third-party action runs inside the existing job context and exfiltrates the workflow GITHUB_TOKEN via build logs. The blast radius equals the token's issued scope; the explicit cap bounds it.

Style matches the per-job blocks already in build-pr.yml, go-audit.yml, license-compliance-go.yml, security-scan-go.yml, and the rest of the hardened set. YAML validated locally with yaml.safe_load.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ad8c0793-4824-42ae-8d0a-09c351c137a1

📥 Commits

Reviewing files that changed from the base of the PR and between a6a55a9 and 648f16c.

📒 Files selected for processing (3)
  • .github/workflows/license-header-check.yml
  • .github/workflows/yarn-scan-backend-go-pr.yml
  • .github/workflows/yarn-scan-backend-pr.yml
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/license-header-check.yml
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/yarn-scan-backend-pr.yml
  • .github/workflows/yarn-scan-backend-go-pr.yml

Walkthrough

Three GitHub Actions workflows now declare explicit permissions restricting the GITHUB_TOKEN to contents: read at the workflow level for License Header Check, Yarn Golang Backend Dependency Audit, and Yarn Python Backend Dependency Audit.

Changes

Workflow Permissions Hardening

Layer / File(s) Summary
Restrict permissions across workflows
.github/workflows/license-header-check.yml, .github/workflows/yarn-scan-backend-go-pr.yml, .github/workflows/yarn-scan-backend-pr.yml
License Header Check, Yarn Golang Backend Dependency Audit, and Yarn Python Backend Dependency Audit workflows each add a top-level permissions block setting contents: read, limiting default GITHUB_TOKEN scope.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: declaring contents:read permissions on three GitHub Actions workflows for license and yarn-audit jobs.
Description check ✅ Passed The description directly relates to the changeset, explaining why the permissions are being added (CVE-2025-30066 defense-in-depth), which workflows are affected, and the security rationale behind limiting GITHUB_TOKEN scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Member

@lukaszgryglicki lukaszgryglicki left a comment

Choose a reason for hiding this comment

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

CI build fails.

@lukaszgryglicki
Copy link
Copy Markdown
Member

Actually might be unrelated to this PR - will get to this later - possibly tomorrow.

@lukaszgryglicki
Copy link
Copy Markdown
Member

I have fixed CI with my other PRs, so once they are merged I will focus on merging yours, example: #5066 - ETA is tomorrow. Once my PRs and your PRs are merged I'll create a prod release PR candidate for this.

cc @mlehotskylf

Copy link
Copy Markdown
Member

@lukaszgryglicki lukaszgryglicki left a comment

Choose a reason for hiding this comment

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

/lgtm - will need rebase because I've fixed some failing CI in another PR. Once that PR is fixed this should became green.

@lukaszgryglicki
Copy link
Copy Markdown
Member

Please rebase to newest dev - my PRs were just mered.

@lukaszgryglicki
Copy link
Copy Markdown
Member

CI still fails, was it rebased?

Please LMK when it is ready for another review.

Thanks.

@lukaszgryglicki
Copy link
Copy Markdown
Member

I've created another PR: #5071 where the exact same "Build and test Pull Request" passes with the same lfx-kit reference, so I'm not sure what's going on there. Is this rebased to dev.

@lukaszgryglicki
Copy link
Copy Markdown
Member

Looks like I know why CI fails - it is because the PR is from fork and forks don't get GitHub repo's secrets populated and some of repos used by go dependencies are private, so build/fetching fails and CI is red. Investigating/Researching this.

@lukaszgryglicki
Copy link
Copy Markdown
Member

Once this is merged #5073 - CI should be green for forks after rebasing.

License-header-check runs ./check-headers.sh against the cla-backend
trees. The two yarn-scan workflows run yarn install + yarn audit on
cla-backend-go and cla-backend after checkout. No GitHub API write,
no comment-on-PR.

contents:read at workflow scope matches the per-job style used by
build-pr.yml (id-token:write + contents:read + pull-requests:write),
go-audit.yml, license-compliance-go.yml, and security-scan-go.yml.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099
Copy link
Copy Markdown
Contributor Author

@mlehotskylf @lukaszgryglicki Pushed the commit again with verified commit signature

@lukaszgryglicki
Copy link
Copy Markdown
Member

Checking why CI fails as you only added permissions read.

@lukaszgryglicki
Copy link
Copy Markdown
Member

OK, I now think we should go with it, and I will address in another PR - probably just a new vuln.

@lukaszgryglicki lukaszgryglicki merged commit 3b2eccb into linuxfoundation:dev May 28, 2026
10 of 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.

3 participants