-
Notifications
You must be signed in to change notification settings - Fork 82
docs: add pipeline attestation verification gates #1373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
catcherintheroad-hub
wants to merge
1
commit into
UnitOneAI:main
Choose a base branch
from
catcherintheroad-hub:improve/pipeline-attestation-verification
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+123
−1
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
skills/devsecops/pipeline-security/tests/attestation-verification-edge-cases.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| # Attestation Verification Edge Cases | ||
|
|
||
| These fixtures validate CICD-SEC-9 review behavior for pipelines that generate signatures or provenance but may not enforce that evidence during release. | ||
|
|
||
| ## Case 1: Build Attests Digest, Deploy Uses Mutable Tag | ||
|
|
||
| ```yaml | ||
| build: | ||
| steps: | ||
| - uses: actions/attest-build-provenance@v2 | ||
| with: | ||
| subject-name: registry.example.com/api | ||
| subject-digest: sha256:abc123 | ||
| - run: cosign sign registry.example.com/api@sha256:abc123 | ||
|
|
||
| deploy: | ||
| steps: | ||
| - run: kubectl set image deploy/api api=registry.example.com/api:latest | ||
| ``` | ||
|
|
||
| **Expected result:** Fail for production CICD-SEC-9. | ||
|
|
||
| **Reason:** The attested subject digest is not the artifact reference used by deployment. A mutable tag can resolve to a different image after the attestation is produced. | ||
|
|
||
| ## Case 2: Signature Verification Without Identity Constraints | ||
|
|
||
| ```yaml | ||
| release: | ||
| steps: | ||
| - run: cosign verify registry.example.com/api@sha256:abc123 | ||
| - run: kubectl set image deploy/api api=registry.example.com/api@sha256:abc123 | ||
| ``` | ||
|
|
||
| **Expected result:** Partial, or Fail when identity trust is required for production. | ||
|
|
||
| **Reason:** The command verifies that a signature exists, but does not constrain the OIDC issuer, certificate identity, source repository, workflow ref, or builder identity. | ||
|
|
||
| ## Case 3: Production Admission Policy Enforces Provenance | ||
|
|
||
| ```yaml | ||
| apiVersion: policy.sigstore.dev/v1beta1 | ||
| kind: ClusterImagePolicy | ||
| metadata: | ||
| name: require-api-provenance | ||
| spec: | ||
| images: | ||
| - glob: registry.example.com/api@sha256:* | ||
| authorities: | ||
| - keyless: | ||
| identities: | ||
| - issuer: https://token.actions.githubusercontent.com | ||
| subject: https://github.com/example/api/.github/workflows/release.yml@refs/heads/main | ||
| attestations: | ||
| - name: slsa-provenance | ||
| predicateType: https://slsa.dev/provenance/v1 | ||
| ``` | ||
|
|
||
| **Expected result:** Pass for the attestation verification portion of CICD-SEC-9 when paired with digest-based deployment. | ||
|
|
||
| **Reason:** The production admission policy verifies provenance and constrains the trusted identity before admitting the workload. | ||
|
|
||
| ## Case 4: Multi-Arch Manifest Without Platform Attestation Clarity | ||
|
|
||
| ```yaml | ||
| build: | ||
| steps: | ||
| - run: docker buildx build --platform linux/amd64,linux/arm64 --push -t registry.example.com/api:1.2.3 . | ||
| - run: cosign attest --predicate provenance.json registry.example.com/api@sha256:manifest | ||
|
|
||
| deploy: | ||
| steps: | ||
| - run: kubectl set image deploy/api api=registry.example.com/api@sha256:manifest | ||
| ``` | ||
|
|
||
| **Expected result:** Partial / Not Evaluable until the review confirms how per-platform image digests are covered. | ||
|
|
||
| **Reason:** Multi-arch manifests can point to platform-specific images. The reviewer must confirm whether the attestation covers the deployed manifest, the per-platform images, or both. | ||
|
|
||
| ## Review Assertions | ||
|
|
||
| - Do not credit build-time attestation as deployment enforcement. | ||
| - Require digest binding between the attested subject and deployed artifact. | ||
| - Require issuer and identity constraints for keyless signature or attestation verification. | ||
| - Distinguish enforce mode from warn-only mode and record exception owner/expiry. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For policy-controller configurations like this fixture, the
attestationsblock only requires a matching SLSA predicate type; without an attestationpolicyit does not check the SLSA predicate's source repository, workflow ref/commit, or builder identity that the skill now requires. Marking this as a Pass can train reviewers to credit production admission policies that still allow provenance from the wrong source or builder, so this case should remain Partial unless those predicate checks are added.Useful? React with 👍 / 👎.