Skip to content

Commit b6047d2

Browse files
authored
security: pin third-party GitHub Actions to commit SHAs + least-privilege permissions (#177)
* security: pin third-party GitHub Actions to commit SHAs + least-privilege permissions Pin all third-party actions to full 40-char commit SHAs (version comments retained) and add a top-level least-privilege 'permissions: contents: read' block to pure-CI workflows. dtolnay/rust-toolchain gains an explicit 'toolchain: stable' input so the SHA pin preserves channel selection. From the 2026-06-22 workspace GitHub Actions security audit. Assisted-With: Claude Opus 4.8 <noreply@anthropic.com> * security: bump msgpack-python to clear pip-audit Pin msgpack-python>=1.2.1 (GHSA-6v7p-g79w-8964) in the pip-audit security block and regenerate pixi.lock. pip-audit now reports no known vulnerabilities. Assisted-With: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 011e36c commit b6047d2

5 files changed

Lines changed: 33 additions & 27 deletions

File tree

‎.github/workflows/copilot-setup-steps.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
paths:
1212
- .github/workflows/copilot-setup-steps.yml
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
1619
copilot-setup-steps:

‎.github/workflows/test_and_deploy.yaml‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
fetch-tags: true
2929

3030
- name: Setup pixi
31-
uses: prefix-dev/setup-pixi@v0.9.6
31+
uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
3232
with:
3333
manifest-path: pyproject.toml
3434
# Workaround: Dynamic versioning (versioningit) causes lock file version mismatch.
@@ -46,7 +46,7 @@ jobs:
4646
run: pixi run test
4747

4848
- name: Upload coverage to codecov
49-
uses: codecov/codecov-action@v7
49+
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7
5050
if: github.actor != 'dependabot[bot]'
5151
with:
5252
token: ${{ secrets.CODECOV_TOKEN }}
@@ -70,7 +70,7 @@ jobs:
7070
fetch-tags: true
7171

7272
- name: Setup pixi
73-
uses: prefix-dev/setup-pixi@v0.9.6
73+
uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
7474
with:
7575
manifest-path: pyproject.toml
7676
# Workaround: Dynamic versioning (versioningit) causes lock file version mismatch.
@@ -94,13 +94,13 @@ jobs:
9494
# installed (and micromamba on PATH); pkg-install sets both up.
9595
- name: Install built conda package
9696
id: install
97-
uses: neutrons/conda-actions/pkg-install@v2
97+
uses: neutrons/conda-actions/pkg-install@bba9ca89d48d9ae846db9650cc63fde736340b3d # v2
9898
with:
9999
package-name: ${{ env.PKG_NAME }}
100100
local-channel: /tmp/local-channel
101101

102102
- name: Verify conda package
103-
uses: neutrons/conda-actions/pkg-verify@v2
103+
uses: neutrons/conda-actions/pkg-verify@bba9ca89d48d9ae846db9650cc63fde736340b3d # v2
104104
with:
105105
package-name: ${{ env.PKG_NAME }}
106106
module-name: ${{ env.MODULE_NAME }}
@@ -109,7 +109,7 @@ jobs:
109109
# Audit the dependencies of the conda package we just installed. SARIF
110110
# results are uploaded to GitHub code scanning by the grype action.
111111
- name: Scan installed environment with Grype
112-
uses: neutrons/conda-actions/grype@v2
112+
uses: neutrons/conda-actions/grype@bba9ca89d48d9ae846db9650cc63fde736340b3d # v2
113113
with:
114114
path: ${{ steps.install.outputs.conda_install_dir }}
115115

@@ -132,7 +132,7 @@ jobs:
132132
fetch-tags: true
133133

134134
- name: Setup Pixi
135-
uses: prefix-dev/setup-pixi@v0.9.6
135+
uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
136136
with:
137137
manifest-path: pyproject.toml
138138
# Workaround: Dynamic versioning (versioningit) causes lock file version mismatch.
@@ -149,15 +149,15 @@ jobs:
149149
name: artifact-conda-package
150150

151151
- name: Upload package to anaconda
152-
uses: neutrons/conda-actions/publish@v2
152+
uses: neutrons/conda-actions/publish@bba9ca89d48d9ae846db9650cc63fde736340b3d # v2
153153
with:
154154
anaconda-token: ${{ secrets.ANACONDA_TOKEN }}
155155
organization: neutrons
156156
package-path: ${{ env.PKG_NAME }}-*.conda
157157

158158
- name: Remove old packages
159159
if: github.ref == 'refs/heads/next'
160-
uses: neutrons/conda-actions/pkg-remove@v2
160+
uses: neutrons/conda-actions/pkg-remove@bba9ca89d48d9ae846db9650cc63fde736340b3d # v2
161161
with:
162162
anaconda_token: ${{ secrets.ANACONDA_TOKEN }}
163163
organization: neutrons
@@ -180,7 +180,7 @@ jobs:
180180
fetch-tags: true
181181

182182
- name: Setup pixi
183-
uses: prefix-dev/setup-pixi@v0.9.6
183+
uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
184184
with:
185185
manifest-path: pyproject.toml
186186
# Workaround: Dynamic versioning (versioningit) causes lock file version mismatch.
@@ -202,4 +202,4 @@ jobs:
202202
# publish your distributions here (need to setup on PyPI first)
203203
- name: Publish package distributions to PyPI
204204
if: startsWith(github.ref, 'refs/tags/v')
205-
uses: pypa/gh-action-pypi-publish@release/v1
205+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0

‎.github/workflows/update-lockfiles.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
# checks out refspec that triggered or the default branch
1919

2020
- name: Setup pixi
21-
uses: prefix-dev/setup-pixi@v0.9.6
21+
uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
2222
with:
2323
run-install: false
2424

@@ -28,7 +28,7 @@ jobs:
2828
pixi update --json | pixi exec pixi-diff-to-markdown >> diff.md
2929
3030
- name: Create pull request
31-
uses: peter-evans/create-pull-request@v8
31+
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8
3232
# PR will target the branch checked out in the workflow
3333
with:
3434
token: ${{ secrets.GITHUB_TOKEN }}

‎pixi.lock‎

Lines changed: 16 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ virtualenv = ">=20.36.1,<21" # Known vulnerability in <20.36.1; capped due to ht
116116
cryptography = ">=48.0.1" # CVE-2026-26007, CVE-2026-39892, GHSA-537c-gmf6-5ccf
117117
requests = ">=2.33.0" # CVE-2026-25645
118118
pillow = ">=12.2.0" # CVE-2026-25990, CVE-2026-40192
119+
msgpack-python = ">=1.2.1" # GHSA-6v7p-g79w-8964
119120

120121
[tool.pixi.pypi-dependencies]
121122
# PyPI dependencies, including this package to allow local editable installs

0 commit comments

Comments
 (0)