Skip to content

feat(lab8): cosign sign + SBOM/provenance attestations + blob signing - #8

Merged
Wilikson173 merged 1 commit into
mainfrom
feature/lab8
Jul 3, 2026
Merged

feat(lab8): cosign sign + SBOM/provenance attestations + blob signing#8
Wilikson173 merged 1 commit into
mainfrom
feature/lab8

Conversation

@Wilikson173

Copy link
Copy Markdown
Owner

Goal

Sign the Juice Shop image with Cosign, attach SBOM + provenance attestations, and demonstrate blob signing as a mitigation for tag-mutation and unsigned-artifact supply-chain attacks (Codecov 2021 class).

Changes

  • labs/lab8/keys/cosign.pub β€” public key used for all verify/verify-attestation/verify-blob operations
  • submissions/lab8.md β€” full writeup: sign + tamper demo, SBOM/provenance attestations, bonus blob signing

Testing

Registry + image push
docker run -d --name lab8-registry -p 127.0.0.1:5000:5000 registry:3
docker tag bkimminich/juice-shop:v20.0.0 localhost:5000/juice-shop:v20.0.0
docker push localhost:5000/juice-shop:v20.0.0
Sign + verify original digest
cosign sign --key labs/lab8/keys/cosign.key --yes "$DIGEST"
cosign verify --key labs/lab8/keys/cosign.pub --insecure-ignore-tlog "$DIGEST"

β†’ Verified OK, docker-manifest-digest matches sha256:8c76bce9...

Tamper demo (alpine re-tagged as juice-shop)
cosign verify --key labs/lab8/keys/cosign.pub --insecure-ignore-tlog "$TAMPERED_DIGEST"

β†’ Error: no signatures found (correctly rejected)

Sanity recheck β€” original still verifies after tamper attempt
cosign verify --key labs/lab8/keys/cosign.pub --insecure-ignore-tlog "$DIGEST"

β†’ Verified OK

SBOM attestation
cosign attest --key labs/lab8/keys/cosign.key --type cyclonedx --predicate labs/lab4/juice-shop.cdx.json --yes "$DIGEST"
cosign verify-attestation --key labs/lab8/keys/cosign.pub --insecure-ignore-tlog --type cyclonedx "$DIGEST"
diff <(jq -S '.components | length' labs/lab4/juice-shop.cdx.json)
<(jq -S '.components | length' labs/lab8/results/sbom-from-attestation.json)
β†’ empty diff, both 3069 components
Provenance attestation
cosign attest --key labs/lab8/keys/cosign.key --type slsaprovenance --predicate /tmp/predicate-only.json --tlog-upload=false --yes "$DIGEST"
cosign verify-attestation --key labs/lab8/keys/cosign.pub --insecure-ignore-tlog --type slsaprovenance "$DIGEST"
β†’ verified, builder.id = https://localhost/lab8-student
Bonus: blob signing
cosign sign-blob --key labs/lab8/keys/cosign.key --yes --bundle labs/lab8/results/my-tool.tar.gz.bundle labs/lab8/results/my-tool.tar.gz
cosign verify-blob --key cosign.pub --bundle my-tool.tar.gz.bundle --insecure-ignore-tlog my-tool.tar.gz

β†’ Verified OK

Tamper test on blob

echo "MALICIOUS PAYLOAD" >> my-tool.tar.gz
cosign verify-blob --key cosign.pub --bundle my-tool.tar.gz.bundle --insecure-ignore-tlog my-tool.tar.gz

β†’ Error: invalid signature when validating ASN.1 encoded signature (correctly rejected)

Artifacts & Screenshots

  • submissions/lab8.md β€” full task writeup with all verification outputs

Checklist

  • Title follows feat(labN): <topic> style
  • No secrets or large temp files committed
  • Submission file exists at submissions/lab8.md

@Wilikson173
Wilikson173 merged commit 95eef33 into main Jul 3, 2026
1 check passed
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