Skip to content

Fix Token-Permissions: scope security-events:write to job level in cicd.yml and codeql.yml - #5474

Draft
Alan Jowett (Alan-Jowett) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-code-scanning-alert-572
Draft

Fix Token-Permissions: scope security-events:write to job level in cicd.yml and codeql.yml#5474
Alan Jowett (Alan-Jowett) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-code-scanning-alert-572

Conversation

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes Scorecard alert #572 (Token-Permissions, High): security-events: write was set at the top-level permissions block in cicd.yml and codeql.yml, granting this permission to every job in those workflows rather than only the jobs that upload SARIF results.

The specific file referenced in the alert (.github/workflows/perf.yml) no longer exists, but the same over-permissioned pattern remained in two other workflows.

cicd.yml: Removed security-events: write from top-level. Added a scoped permissions block to the ossar job only — the sole job that calls ossar-scan.yml and uploads SARIF.

codeql.yml: Removed security-events: write from top-level. Added a scoped permissions block to the codeql job with all required permissions preserved.

Testing

No behavioral change — only permission scoping. No new tests needed.

  • Unit tests are added.
  • Driver tests are added.
  • Fuzz tests are added.

Documentation

No documentation impact.

Installation

No installer impact.

…in cicd.yml and codeql.yml

The Scorecard alert #572 flagged top-level 'security-events: write' permissions in workflow files.
Following the principle of least privilege:
- cicd.yml: removed security-events:write from top-level, added it only to the 'ossar' job that uploads SARIF
- codeql.yml: removed security-events:write from top-level, added it only to the 'codeql' job that runs CodeQL analysis

Note: .github/workflows/perf.yml (the specific file referenced in the alert) no longer exists in the repository.
Copilot AI changed the title [WIP] Fix code scanning alert #572 Fix Token-Permissions: scope security-events:write to job level in cicd.yml and codeql.yml Jul 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request isn't linked to any GitHub issue. Please reference an issue with a keyword such as Fixes #123, Closes #456, etc., so the work can be tracked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants