Skip to content

Support multiple predicates when using cosign attest #4142

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
crispysipper opened this issue Apr 3, 2025 · 0 comments
Open

Support multiple predicates when using cosign attest #4142

crispysipper opened this issue Apr 3, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@crispysipper
Copy link

Description

Support multiple predicates when creating container image attestation. For instance, if a user wanted to attest to an sbom and an image scan within the same image attestation. This could be done by using the --predicate flag multiple times or some sort of stringArray as an input value

Example from my use case:

cosign attest --tlog-upload=false --yes --type https://cyclonedx.org/bom/v1.6 --predicate example-cyclonedx-scan.json --predicate example-cyclonedx-sbom.json --key <aws_cmk_key> ${image}@${DIGEST}

Current behavior:
It appears the second --predicate flag overwrites the first and in the above instance, there is no data embedded within the attestation for the example-cyclonedx-scan.json predicate, however the data for example-cyclonedx-sbom.json is present.

Creating more than one attestation is not really a viable workaround and it is really clunky.

This is especially important for automated image building pipelines that use cosign in conjunction with declarative policy engines like kyverno - especially since this issue remains unresolved: #2307

Honestly before deprecating things like cosign attach sbom, cosign attest should be matured out a bit first to support flexible needs. However, if someone knows of an existing way to do this, please let me know. But I couldn't find anything in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant