Provenance (where it came from, how it was built).
The context usually implies a CI/CD pipeline (like GitHub Actions, GitLab CI, or Jenkins) using tools like Sigstore/Cosign, SLSA, and Syft/Trivy.
Since the user didn't specify a platform, I should provide a generic but practical example, likely using GitHub Actions as it's the most common standard for this kind of request today, especially with built-in attestation features and Sigstore integration.
Key components to include in the workflow:
Build Stage:
Checkout code.
Build the container image (or binary).
Generate the SBOM (e.g., using syft).
Attestation/Signing Stage:
Provenance: Generate SLSA provenance. This records the build environment, inputs (commit hash), and build steps. GitHub Actions has actions/attest-build-provenance.
SBOM: Attest the SBOM to the image. GitHub Actions has actions/attest-sbom.
Signatures: Sign the image using a keyless method (like Sigstore/Cosign) or a private key.
Verification/Logging Stage:
Verify the attestations.
"Logging" usually means pushing these attestations to a transparency log (like Rekor) or an OCI registry.
Step 5: Sign Image (Signature). Use sigstore/cosign-installer and cosign sign.
Step 6: Attest Provenance. Use actions/attest-build-provenance.
Step 7: Attest SBOM. Use actions/attest-sbom.
Step 8: Verify. Show how to verify everything at the end.
Refining the "Logging" aspect:
The prompt asks for "logging signatures, SBOMs, and provenance."
In the Sigstore ecosystem, cosign sign uploads to the Rekor transparency log automatically.
The GitHub Attestations API stores attestations in the registry or GitHub's attestation store.
Structure of the output:
Overview: Briefly explain the security model (SLSA, SBOM, Sigstore).
The Workflow (Code): A complete, copy-pasteable GitHub Actions YAML file.
Explanation of Steps: detailed breakdown of what each section does (Build, SBOM, Provenance, Signing).
Verification: How to check the logs/attestations.
Self-Correction/Alternative thought:
Should I use a generic abstract workflow or specific code? Code is better.
Should I use ko or docker build? docker build is more universally understood.
What about slsa-github-generator? It's powerful but sometimes complex to explain. The newer actions/attest-build-provenance is the modern standard. I will use that.
SBOM Generation:anchore/sbom-action is easy to use.
Attestations:actions/attest-sbom links the SBOM to the artifact.
actions/attest-build-provenance links the build details.
Let's construct the response.
This solution implements a Secure Software Development Lifecycle (SSDLC) workflow using GitHub Actions.
This workflow follows the SLSA (Supply-chain Levels for Software Artifacts) standard. It generates three specific attestations for a container image:
SBOM: Software Bill of Materials (using syft).
Provenance: verifiable information about where, when, and how the image was built (using SLSA).
Signature: A cryptographic signature verifying the integrity of the image (using cosign and Keyless/Fulcio).
The Workflow Architecture
Trigger: Runs on release or push to main.
Build: Builds a container image (e.g., nginx placeholder) using Docker Buildx.
Attestation:
Generates an SPDX SBOM and attaches it to the image.
Generates SLSA Provenance and pushes it to the image registry.
Signing:
Uses Sigstore Cosign to sign the image "keyless" (using the GitHub OIDC token).
Uploads the signature to the Rekor transparency log.
Verification: A final step to prove the logs and attestations are valid.
The Deployment Artifact Attestation Workflow
Save this file as .github/workflows/attestation-pipeline.yml:
yaml
How to Read the Logs
When this workflow runs, you will see specific output in the GitHub Actions logs confirming the security state:
Signature Log:
The cosign sign command will output a receipt from the Rekor transparency log. This is a timestamped, immutable proof that the signature exists.
text
tlog entry created with index: 12345678
Pushing signature to: [REGISTRY]/[IMAGE]/sha256:...
SBOM Log:
The anchore/sbom-action will parse the image layers. If you look at the step output, you will see the packages discovered. The subsequent attest-sbom step will confirm the attachment:
text
Attestation written to OCI registry.
Provenance Log:
The attest-build-provenance action generates a JSON blob describing the build environment (GitHub Actions runner, commit SHA, trigger event). It pushes this as a referrer to the image tag.
Verification
To inspect these artifacts locally after the run, you can use cosign:
bash
# Download and view the SBOM
cosign download attestation <IMAGE_URI> | jq -r .payload | base64 -d | jq
# Verify the signature matches the GitHub Action identity
cosign verify \
--certificate-identity=<YOUR_GITHUB_WORKFLOW_URL> \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
<IMAGE_URI>