Skip to content

Add SLSA build provenance attestation#277

Merged
JE-Chen merged 1 commit into
devfrom
feat/provenance
Jun 21, 2026
Merged

Add SLSA build provenance attestation#277
JE-Chen merged 1 commit into
devfrom
feat/provenance

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 21, 2026

Copy link
Copy Markdown
Member

Summary

The framework can sign action files (HMAC) and inventory dependencies (SBOM), but it could not attest what was produced by which build — the SLSA provenance attestation binding artifact digests to build metadata. This adds it.

  • subject_for(path) / subject_for_bytes(name, data) — in-toto subjects (sha256).
  • build_provenance(subjects, *, build_type, builder_id, external_parameters, metadata) — in-toto v1 Statement + SLSA v1 provenance predicate (buildDefinition + runDetails).
  • write_provenance(stmt, path) / verify_provenance(stmt, files) — persist / re-hash and report mismatches.

Pure stdlib (hashlib+json), fully offline. Complements action_signing and sbom. DSSE signing left as an optional later layer.

Five-layer wiring

  • Headless core: je_auto_control/utils/provenance/
  • Facade: re-exported from __init__.py + __all__
  • Executor: AC_build_provenance, AC_verify_provenance
  • MCP: ac_build_provenance, ac_verify_provenance
  • Script Builder: "Provenance: Build (SLSA)" / "Provenance: Verify" under Security

Tests & docs

  • test/unit_test/headless/test_provenance_batch.py (8 tests: digest, statement structure, verify clean/tamper, write round-trip)
  • v69 feature docs (EN + Zh) + toctree
  • What's-new in all three READMEs

Lint clean: ruff / pylint / bandit / radon.

The framework signs action files and inventories dependencies (SBOM) but
could not attest what was produced by which build. Add an in-toto v1
statement carrying a SLSA v1 provenance predicate over file sha256
digests, plus a verifier that re-hashes the artifacts. Pure stdlib and
fully offline. Wired through the facade, AC_build_provenance/
AC_verify_provenance executor commands, MCP tools and the Script Builder.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 31 complexity · 0 duplication

Metric Results
Complexity 31
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 3184798 into dev Jun 21, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/provenance branch June 21, 2026 01:23
@sonarqubecloud

Copy link
Copy Markdown

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