Move PyPI releases to Trusted Publishing with attestations; add SBOM generation
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 30/100
调研方向
Start by reviewing the release workflows in qBraid and the referenced pyqasm, qbraid-qir, and qbraid-algorithms repositories; the issue’s status table and remaining-items list describe the current gaps. Check the workflow runs and PyPI provenance for the next qbraid release, then scope SBOM generation and release-environment protections across all four repositories. Done means the remaining listed items are implemented and verified.
由索引模型根据 Issue 内容生成。
描述
Status update (2026-09-15): Trusted Publishing is now live on all four repos. SBOM is the only item with no progress anywhere.
Trusted Publishing Attestations Gated env + reviewers SBOM Scorecard qBraid✅ (#1346) ◐ unverified ❌ ❌ ✅ 8.0 pyqasm✅ ✅ ◐ ❌ ✅ 6.9 qbraid-qir✅ ✅ ❌ ❌ ✅ 6.8 qbraid-algorithms✅ ✅ ◐ ❌ ✅ 6.3
- Attestations — confirmed emitted, not just assumed.
pyqasm1.2.0,qbraid-qir0.6.1 andqbraid-algorithms0.1.3 (all released 2026-08-27, after their switch) return PEP 740 provenance fromhttps://pypi.org/integrity/<pkg>/<version>/<file>/provenance.qbraid404s there only because 0.12.2 predates the switch — uploaded 2026-07-11, #1346 merged 2026-08-24 — so the next release should carry it. Still worth settingattestations: trueexplicitly rather than relying on the action's default.- Gated environment — the half that matters is still missing.
pyqasm(both release workflows) andqbraid-algorithms(publish.ymlonly) now declareenvironment: release;qBraidandqbraid-qirdeclare none. But everyreleaseenvironment has empty protection rules — no required reviewers, no wait timer — so the key currently scopes the environment without gating anything. Publishing is still guarded by theif: github.actor == ...check alone.- SBOM — no movement. No CycloneDX or SPDX step in any workflow in any of the four repos.
- Scorecard — the closing line below is now outdated. All four publish results (
qBraidadded the workflow in #1343); scores in the table are from 2026-09-14/15.- Hardening drift across repos. #1392 and #1393 put
qBraidat Token-Permissions 10 and Pinned-Dependencies 3; the other three sit at 0 and 0. Outside this issue's original scope, but the same rollout.Remaining: SBOM everywhere; required reviewers on the
releaseenvironments;environment:keys forqBraidandqbraid-qir; explicitattestations: true; and confirmingqbraidprovenance on its next release.
---## Problem
All four OSE packages publish to PyPI using a long-lived API token stored as a repository secret. None uses OIDC Trusted Publishing, and none attaches build attestations.
| Repo | Trusted Publishing (id-token) |
Build attestations | Artifact signing | SBOM |
|---|---|---|---|---|
qBraid |
❌ | ❌ | ❌ | ❌ |
pyqasm |
❌ | ❌ | ❌ | ❌ |
qbraid-qir |
❌ | ❌ | ❌ | ❌ |
qbraid-algorithms |
❌ | ❌ | ❌ | ❌ |
A standing token is the weakest link in the release path. If one leaks, an attacker publishes a release under our name, and nothing downstream can distinguish it from a genuine one. Combined package downloads are roughly 985,000 lifetime across the four, so the blast radius is not theoretical.
There is also currently no way to trace a published wheel back to the commit that produced it beyond trusting the workflow.
Suggested fix
1. OIDC Trusted Publishing. Configure each package as a trusted publisher on PyPI, then in the release workflow:
permissions:
id-token: write
steps:
- uses: pypa/gh-action-pypi-publish@release/v1 # no password: needed
Then delete the PYPI_API_TOKEN secret. Short-lived, workflow-scoped credentials replace the standing token.
2. Build attestations. pypa/gh-action-pypi-publish emits PEP 740 attestations when publishing via Trusted Publishing, which links each artifact to its workflow run and commit.
3. Publishing environment. Put releases behind a GitHub Environment with required reviewers, so publishing is a deliberate step.
4. SBOM. Generate a CycloneDX or SPDX bill of materials per release. Worth doing per installable extra combination as well, given 22 extras reach 37 third-party packages.
Why it matters beyond hygiene
This is a prerequisite for a meaningful OpenSSF Scorecard, which none of the four repositories currently publishes, and it is the concrete form of the "chain of custody" the PESOSE solicitation names.
- 主要语言
- Python
- 星标
- 117
- 派生
- 66
- 平均合并
- 1 天 4 小时
- 30 天内合并 PR
- 38
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
qBraid/qBraid 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
device.run() fails for QuantumCircuit subclasses (e.g. bound qiskit-nature UCCSD): "Alias 'qiskit' is already registered with a different type"可能已有人在做 @DBVamsi 于 4 天前认领。 未关闭bug 🐛
难度 2/5 1-3 小时 新手友好度 80/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 43/100
维护者通常 1 天内回复
-
OQCDevice: shots=0 silently runs the default 1,000 repeats instead of raising可能已有人在做 @danielgaskins 于 26 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 25/100
维护者通常 1 天内回复
-
qasm3→qasm2 transpile routes through Cirq and fragments classical registers, losing joint measurement counts (OQC)可能已有人在做 @danielgaskins 于 26 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
ansys/pyansys-common-mcp#213 ·
维护者通常 3 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 67/100
freedomofpress/dangerzone#1594 ·
维护者通常 3 天内回复
-
priority:P1 status:in-review type:bug
难度 2/5 1-3 小时 新手友好度 75/100
randomparity/kdive#3317 · 1 条评论 ·
维护者通常 1 天内回复
-
area:ci
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
mesonbuild/meson#16281 ·
维护者通常 1 天内回复