Skip to content

harden(release): sterile publish job, no repo/dist code under OIDC - #186

Open
marcohost33-maker wants to merge 2 commits into
mainfrom
harden/publish-job-sterile
Open

marcohost33-maker wants to merge 2 commits into
mainfrom
harden/publish-job-sterile

Conversation

@marcohost33-maker

Copy link
Copy Markdown
Owner

Was

Der publish-Job haelt id-token: write, checkte aber das Repo aus, installierte das Wheel per pip und importierte es. Eine .pth-Datei im Wheel liefe so im OIDC-Kontext.

Neu: build (ohne OIDC) prueft Identitaet wie bisher und schreibt SHA256SUMS von dist/ als Job-Output (Actions-Steuerebene, nicht im Artefakt). publish laedt nur das Artefakt, prueft sha256sum -c --strict + exakte Dateimenge, attestiert, laedt hoch -- kein checkout, kein setup-python, kein Repo-Code.

Belege @ 579af7e

  • tests/test_pypi_workflow_contract.py + release-gate: 77 passed.
  • Diskriminierung: alter pypi.yml gegen den neuen Vertrag -> 2 failed.
  • check_release_pins.py exit 0.

Unabhaengig von #184-PR, beide beruehren aber den Release-Pfad; Merge-Reihenfolge egal (disjunkte Dateien). Release/Tag/PyPI-Konfiguration bleibt Marco-Gate. Merge erst nach unabhaengiger Pruefrunde.

Herkunft: 007acc2 Claude-Revision 2026-09-30 (REV 3.2).

🤖 Generated with Claude Code

… context

The publish job holds `id-token: write` but used to check out the repository,
set up Python, pip-install the wheel and import it. A wheel may ship a .pth
file whose import lines run at every later interpreter start, i.e. inside the
OIDC context (PyPI Trusted Publishing security model).

Now `build` (no OIDC) proves source/version/tag/commit identity as before and
records SHA256SUMS of dist/ as a job OUTPUT (Actions control plane, not inside
the artifact). `publish` only downloads the artifact, runs `sha256sum -c
--strict` against that output and checks the exact file set, then attests and
uploads -- no checkout, no setup-python, no repository code.

Base patch: 007acc2 Claude revision 2026-09-30 (REV 3.2). Tests: contract +
release-gate 77 passed; old pypi.yml against the new contract: 2 failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

…exact-set check (#186 review)

Aegis round on 579af7e (P2-3): removing the `diff <(ls -A ...)` exact-set
line, or adding `python3 -c`, `pip3 install`, `uv run --with dist/*.whl` to
the publish job all stayed green. The contract now rejects any interpreter or
package tool token in the publish block and pins the exact-set line.

Mutations (each alone): all four now fail 1 test; unmodified 6 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@marcohost33-maker

Copy link
Copy Markdown
Owner Author

Pruefrunde 1 (Aegis, unabhaengig) @579af7e: Workflow MERGE-REIF. 13 Manipulationsfaelle (Wheel, Extra-/Dot-Datei, Unterordner, Symlink-Extra, leere/kaputte Digests, Output-Injektion via Dateiname) -> alle BLOCK; Identitaetspruefungen in build identisch zu vorher.
P2-3 (Contract-Test bewachte die neuen Kontrollen nicht) behoben in 55f9e2c: 4 Mutationen (exact-set-Zeile entfernt, python3 -c, pip3 install, uv run) -> je 1 failed; unveraendert 6 passed.
Rest P3: awk '{print $2}' haengt am Textmodus (fail-closed); Digest-Bindung schuetzt Store/Transit, nicht einen kompromittierten build-Job.
Merge nach Pruefrunde 2 gegen 55f9e2c.

This branch has not been deployed

No deployments
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.

1 participant