chore(ci): Cleanup permission settings#27689
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideScopes GitHub Actions workflow permissions from workflow-level to specific jobs that need contents: read access in the arrow-flight-tests and OWASP dependency check workflows, aligning with GitHub’s principle of least privilege. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
The reocmmendation is to set permissions at job level and not globally at the workflow level. The content: read permission is needed for the github checkout action.
be4fd4a to
3425ffe
Compare
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/owasp-dependency-check.yml" line_range="3-5" />
<code_context>
on: pull_request
-permissions:
- contents: read
-
env:
</code_context>
<issue_to_address>
**🚨 suggestion (security):** Consider keeping a top-level `permissions: {}` to avoid implicit default permissions for other jobs.
By dropping the workflow-level `permissions`, other jobs fall back to GitHub’s broader default token permissions. Keeping a minimal top-level `permissions: {}` and granting `contents: read` only where needed preserves least-privilege across the whole workflow while still scoping this job correctly.
```suggestion
on:
pull_request: {}
workflow_dispatch:
permissions: {}
dependency-check:
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| on: | ||
| pull_request: {} | ||
| workflow_dispatch: |
There was a problem hiding this comment.
🚨 suggestion (security): Consider keeping a top-level permissions: {} to avoid implicit default permissions for other jobs.
By dropping the workflow-level permissions, other jobs fall back to GitHub’s broader default token permissions. Keeping a minimal top-level permissions: {} and granting contents: read only where needed preserves least-privilege across the whole workflow while still scoping this job correctly.
| on: | |
| pull_request: {} | |
| workflow_dispatch: | |
| on: | |
| pull_request: {} | |
| workflow_dispatch: | |
| permissions: {} | |
| dependency-check: |
The reocmmendation is to set permissions at job level and not globally at the workflow level.
The content: read permission is needed for the
github checkout action.
Description
Motivation and Context
Impact
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.
If release note is NOT required, use:
Summary by Sourcery
Scope GitHub Actions permissions to individual jobs instead of the entire workflow for arrow flight and OWASP dependency check workflows.
CI: