Harden GitHub workflows by pinning action SHAs and defining explicit permissions#795
Harden GitHub workflows by pinning action SHAs and defining explicit permissions#795Copilot wants to merge 2 commits into
Conversation
Updated in commit I added top-level |
There was a problem hiding this comment.
Pull request overview
This PR hardens the repository’s GitHub Actions workflows by pinning all third-party actions to immutable commit SHAs, adding explicit permissions blocks where missing, and fixing workflow trigger key typos to satisfy CodeQL workflow security findings.
Changes:
- Replaced floating action refs (e.g.,
@v*,@release/v1) with full commit SHAs across workflows. - Added explicit workflow-level
permissions(and preserved existing job-level overrides where needed). - Corrected
pull_request.type→pull_request.typesin affected workflows.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/verify_install.yaml | Pins actions/checkout to a commit SHA in install-test jobs (note: Alpine-vs-latest checkout split needs correction). |
| .github/workflows/verify_install_windows.yaml | Pins actions/checkout / actions/setup-python to commit SHAs. |
| .github/workflows/verify_install_macos.yaml | Pins actions/checkout / actions/setup-python to commit SHAs. |
| .github/workflows/run_tox_tests.yaml | Fixes PR trigger key (types), adds explicit permissions, pins checkout/setup-python SHAs. |
| .github/workflows/run_tox_ruff_format.yaml | Adds explicit permissions; pins checkout/setup-python SHAs. |
| .github/workflows/run_tox_lint_format.yaml | Fixes PR trigger key (types), adds explicit permissions, pins checkout/setup-python SHAs. |
| .github/workflows/reversinglabs_scan.yaml | Pins download-artifact and ReversingLabs scanner actions to commit SHAs. |
| .github/workflows/publish_lambda_layer.yaml | Pins download-artifact and AWS credentials action to commit SHAs. |
| .github/workflows/get_apm_python_version.yaml | Adds explicit permissions; pins checkout SHA. |
| .github/workflows/create_testrelease_pr.yaml | Adds explicit permissions; pins checkout SHA. |
| .github/workflows/create_release_pr.yaml | Adds explicit permissions; pins checkout SHA. |
| .github/workflows/codeql_analysis.yml | Adds explicit permissions; pins checkout and CodeQL action SHAs. |
| .github/workflows/build_sdist_and_wheel.yaml | Adds explicit permissions; pins checkout and upload-artifact SHAs. |
| .github/workflows/build_publish_testpypi.yaml | Pins download-artifact and PyPI publish action SHAs. |
| .github/workflows/build_publish_pypi_and_draft_release.yaml | Pins checkout, download-artifact, PyPI publish, and GitHub App token action SHAs. |
| .github/workflows/build_publish_lambda_layer.yaml | Adds explicit permissions; pins checkout/setup-python/upload-artifact SHAs. |
| .github/workflows/build_publish_image_autoinstrumentation.yaml | Pins docker/* actions and CodeQL upload-sarif to commit SHAs. |
| .github/workflows/build_publish_image_autoinstrumentation_beta.yaml | Pins docker/* actions and CodeQL upload-sarif to commit SHAs. |
| - if: contains(matrix.hostname, 'alpine3.13') || contains(matrix.hostname, 'alpine3.14') || contains(matrix.hostname, 'alpine3.15') || contains(matrix.hostname, 'alpine3.16') | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 | ||
| # Else use latest checkout | ||
| - if: ${{ !(contains(matrix.hostname, 'alpine3.13') || contains(matrix.hostname, 'alpine3.14') || contains(matrix.hostname, 'alpine3.15') || contains(matrix.hostname, 'alpine3.16') || contains(matrix.hostname, 'amazon2-')) }} | ||
| uses: actions/checkout@v7 | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 |
This PR addresses open CodeQL findings in
.github/workflowsby removing floating action tags, pinning each external action to a specific commit SHA, and adding explicit workflow permissions. Scope is workflow-only hardening with no functional application-code changes.What changed
uses:references (for example@v4,@v6,@release/v1) with full commit SHAs across all workflow files.permissionsblocks to workflows flagged by CodeQL for missing permissions../.github/...) unchanged.pull_request.typetopull_request.types.Security impact
Representative diff pattern