Skip to content

refactor: enforce least-privilege in GitHub Actions workflows - #1785

Merged
eloi010 merged 1 commit into
masterfrom
fix/least-privilege-workflow-permissions
Jun 23, 2026
Merged

refactor: enforce least-privilege in GitHub Actions workflows#1785
eloi010 merged 1 commit into
masterfrom
fix/least-privilege-workflow-permissions

Conversation

@eloi010

@eloi010 eloi010 commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Overview

This PR enforces least-privilege permissions across the repository GitHub Actions workflows.

Changes

  • Set permissions: {} at the workflow level in every workflow to lock permissions by default
  • Grant only the minimum job-level permissions required for each workflow to run:
    • staticcheck and test jobs: contents: read
    • security-scan job: actions: read, contents: read, security-events: write
    • Slack notification jobs: no GitHub permissions

Security Impact

This change addresses the following code scanning alerts:

It also reduces the GitHub Actions attack surface by ensuring jobs receive only the permissions they actually need.

Files Modified

  • .github/workflows/pr.yml
  • .github/workflows/push.yml
  • .github/workflows/security-code-scanner.yml
  • .github/workflows/slack-notifications.yml

Validation

These changes are configuration-only and preserve existing workflow behavior while tightening permissions.

- Set workflow-level permissions: {} as security default
- Explicitly grant only required permissions per job
- Fixes excessive-permissions alerts (security scanner #38-40)
- Implements GitHub security best practice (default-deny)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@eloi010 eloi010 changed the title refactor: enforce least-privilege RBAC in GitHub Actions workflows refactor: enforce least-privilege in GitHub Actions workflows Jun 23, 2026
@eloi010
eloi010 merged commit cb367d8 into master Jun 23, 2026
16 of 17 checks passed
@eloi010
eloi010 deleted the fix/least-privilege-workflow-permissions branch June 23, 2026 08:57
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