Skip to content

Fix Scorecard Token-Permissions alert: move security-events:write to job level - #5475

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

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

Conversation

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Description

The Scorecard Token-Permissions check (alert #573) flagged that security-events: write was set at the top-level workflow permissions in reusable-build.yml, violating least-privilege principles.

Change: Added explicit permissions block at the build job level:

jobs:
  build:
    permissions:
      contents: read
      security-events: write  # required by github/codeql-action/analyze

Top-level permissions remain contents: read. The security-events: write permission is now scoped only to the job that actually uses github/codeql-action/analyze.

Testing

No new tests needed — this is a CI workflow permission change only. The existing CodeQL build path (build_codeql: true) exercises the affected step.

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

Documentation

No documentation impact.

Installation

No installer impact.

…uild.yml

The Scorecard Token-Permissions check flagged that security-events permission
was set at the top level. Following least-privilege principles, move the
security-events: write permission to the job level, where it is needed by
the github/codeql-action/analyze step.

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
Copilot AI changed the title [WIP] Fix code scanning alert #573 Fix Scorecard Token-Permissions alert: move security-events:write to job level 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.

2 participants