Skip to content
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

Attestation validation #179

Closed
askkhan84 opened this issue Apr 11, 2024 · 2 comments · Fixed by #191
Closed

Attestation validation #179

askkhan84 opened this issue Apr 11, 2024 · 2 comments · Fixed by #191
Assignees
Labels
bug Something isn't working

Comments

@askkhan84
Copy link

If I have a Kyverno cluster policy for the admission controller that has for example the following attestation requirements:

- key: attestations
  value:
    - imageReference: "*"
      type: 
        - name: sbom/cyclone-dx
          conditions:
            all:
        - name: application/sarif+json
          conditions:
            all:
            - key: \{{ element.components[].licenses[].expression }}
              operator: AllNotIn
              value: ["GPL-2.0", "GPL-3.0"]

If the attestation exists in the OCI registry, it validates it and either allows or denies the admission. But if the attestation does not exist at all, it allows the pod admission. I would have thought it should reject the pod admission given it does not have the attestation. what is the explanation behind this design and any way to override it so if an attestation does not exist, pod admission should be rejected?

@JimBugwadia
Copy link
Contributor

This is a bug, which needs to be fixed. Thanks for reporting it!

@JimBugwadia JimBugwadia added the bug Something isn't working label May 1, 2024
@vishal-chdhry
Copy link
Contributor

looks like a missing if check when none of the attestations match, looking into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants