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
Draft
Fix Token-Permissions: scope security-events:write to job level in cicd.yml and codeql.yml#5474Alan Jowett (Alan-Jowett) with Copilot wants to merge 2 commits into
Alan Jowett (Alan-Jowett) with Copilot wants to merge 2 commits into
Conversation
…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
Contributor
Dave Thaler (dthaler)
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes Scorecard alert #572 (Token-Permissions, High):
security-events: writewas set at the top-levelpermissionsblock incicd.ymlandcodeql.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: Removedsecurity-events: writefrom top-level. Added a scopedpermissionsblock to theossarjob only — the sole job that callsossar-scan.ymland uploads SARIF.codeql.yml: Removedsecurity-events: writefrom top-level. Added a scopedpermissionsblock to thecodeqljob with all required permissions preserved.Testing
No behavioral change — only permission scoping. No new tests needed.
Documentation
No documentation impact.
Installation
No installer impact.