Commit bdd9eb6
authored
feat(python): add GitHub provenance verification for prebuilt binaries (#8820)
## Problem
Precompiled Python binaries from `astral-sh/python-build-standalone`
lack provenance verification. Unlike Ruby (which already supports GitHub
Artifact Attestations), Python installs have no mechanism to verify that
downloaded binaries were actually produced by the expected CI workflow
in the expected repository.
Additionally, there is no downgrade protection: if a lockfile records
that provenance was previously verified, nothing prevents an attacker
from stripping that metadata and serving unverified binaries.
## Solution
Add GitHub Artifact Attestations support for precompiled Python
binaries, following the same pattern already established for Ruby:
1. **New setting**: `python.github_attestations` (env:
`MISE_PYTHON_GITHUB_ATTESTATIONS`) overrides the global
`github_attestations` setting specifically for Python. Defaults to the
global value (which is `true`).
2. **Lockfile provenance recording**: `mise lock` now records
`provenance = "github-attestations"` in Python platform entries when the
setting is enabled.
3. **Install-time verification**: `mise install` verifies downloaded
tarballs against GitHub Artifact Attestations using the sigstore
verification crate, with owner/repo hardcoded to
`astral-sh/python-build-standalone`.
4. **Downgrade protection**: If the lockfile records provenance but
verification is disabled at install time, the install fails with a
"downgrade attack" error, preventing provenance stripping attacks.
## Test plan
- [x] `mise run test:e2e test_lockfile_python` — all tests pass
- [x] Tests verify: provenance recorded when enabled, not recorded when
disabled, downgrade attack detected when lockfile has provenance but
verification is off
- [x] `mise run build` and `mise run lint` pass
🤖 Generated with the assistance of OpenCode (claude-opus-4.6).1 parent 0fafcaf commit bdd9eb6
File tree
19 files changed
+259
-11
lines changed- docs/dev-tools
- e2e-win
- e2e
- backend
- core
- lockfile
- sync
- schema
- src/plugins/core
19 files changed
+259
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
0 commit comments