Skip to content

Instantly share code, notes, and snippets.

@sethmlarson
Last active January 28, 2023 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sethmlarson/b933cbc6970b81e9069d2da4c16089ce to your computer and use it in GitHub Desktop.
Save sethmlarson/b933cbc6970b81e9069d2da4c16089ce to your computer and use it in GitHub Desktop.

SLSA + Python Notes

Created example project: https://github.com/sethmlarson/python-slsa-release-test

Python doesn't have a specific builder yet. Only have source attestation using the generic builder. Used: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml

Attestation "subject.name" is taken as input from sha256sum, so check the output of that to ensure it's what you want (ie package.tar.gz vs dist/package.tar.gz) For this I had to include a cd dist/ && before the sha256sum * call. Not sure where this matters though?

Success:

./slsa-verifier-linux-amd64 \
  -provenance artifacts.intoto.jsonl \
  -artifact-path secure_package_template-0.2.0.tar.gz \
  -tag 0.1.10 \
  -source github.com/sethmlarson/python-slsa-release-test

Verified signature against tlog entry index 3121002 at URL: https://rekor.sigstore.dev/api/v1/log/entries/609aec4886e378f2159ff9c30e01fb9499d34a4a21848175cdf4b7b491e10293
Verified build using builder https://github.com/slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@refs/tags/v1.2.0 at commit c8f8996e40ef7e0539d0b0ad405cf3abdbd20865
PASSED: Verified SLSA provenance

./slsa-verifier-linux-amd64 \
  -provenance artifacts.intoto.jsonl \
  -artifact-path secure_package_template-0.2.0-py3-none-any.whl \
  -tag 0.1.10 \
  -source github.com/sethmlarson/python-slsa-release-test

Verified signature against tlog entry index 3121002 at URL: https://rekor.sigstore.dev/api/v1/log/entries/609aec4886e378f2159ff9c30e01fb9499d34a4a21848175cdf4b7b491e10293
Verified build using builder https://github.com/slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@refs/tags/v1.2.0 at commit c8f8996e40ef7e0539d0b0ad405cf3abdbd20865
PASSED: Verified SLSA provenance

Issues found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment