Skip to content

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Nov 14, 2025

Summary

Add explicit permissions blocks to all GitHub Actions workflow jobs to follow security best practices and fix CodeQL security scanning alerts.

Changes

  • ci.yml: Added permissions blocks to 8 jobs (check, security, test, coverage, msrv, benchmark, release, ci-success)
  • release.yml: Added permissions block to build job

Security Impact

This change implements the principle of least privilege for GITHUB_TOKEN by explicitly limiting permissions to minimum required for each job:

  • contents: read - for jobs that only need to read repository content
  • actions: write - for jobs that upload artifacts (coverage, build)
  • contents: write - for release job that creates GitHub releases

This prevents potential privilege escalation and improves overall workflow security posture.

Fixes

Resolves 9 CodeQL security scanning alerts:

  • 8 alerts in .github/workflows/ci.yml
  • 1 alert in .github/workflows/release.yml

Testing

  • All workflow jobs have been reviewed for required permissions
  • No functional changes to workflow behavior
  • Permissions follow GitHub security best practices

References

Add permissions blocks to all jobs in CI and release workflows
to follow security best practices. This limits GITHUB_TOKEN
permissions to minimum required for each job:

- contents: read - for jobs that only need to read repository
- actions: write - for jobs that upload artifacts (coverage, build)
- contents: write - for release job that creates GitHub releases

This prevents potential privilege escalation and follows the
principle of least privilege for GitHub Actions.

Fixes 9 CodeQL security scanning alerts.
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##           master       #4   +/-   ##
=======================================
  Coverage   91.27%   91.27%           
=======================================
  Files          25       25           
  Lines        3887     3887           
=======================================
  Hits         3548     3548           
  Misses        339      339           
Flag Coverage Δ
unittests 91.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d755679...89571b9. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bug-ops bug-ops merged commit 1db99b7 into master Nov 14, 2025
14 checks passed
@bug-ops bug-ops deleted the fix/workflow-permissions-security branch November 14, 2025 12:39
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