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

feat: image verification policy CRD #70

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vishal-chdhry
Copy link
Member

This document proposes the new design for image verification policies.

proposals/imageverificationpolicy.md Outdated Show resolved Hide resolved
proposals/imageverificationpolicy.md Outdated Show resolved Hide resolved
proposals/imageverificationpolicy.md Outdated Show resolved Hide resolved
proposals/imageverificationpolicy.md Outdated Show resolved Hide resolved
proposals/imageverificationpolicy.md Outdated Show resolved Hide resolved
) object map[string]interface{}
```

### ParseImageReference
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide examples of its usage?

proposals/imageverificationpolicy.md Show resolved Hide resolved
#### VerifyImageSignatures
```go
verifyImageSignatures(
image string, # must be a valid image,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be a list?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if the user wants to use a list, they can do it using CEL's map function

```yaml
verifications:
- expression: >-
verifyImageSignatures(images.initContainers[0], attestors.kms)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically users will want to verify all images in a pod are signed with an attestor and may want to exclude a certain references e.g. docker.io/istio*.

How would they do that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they can run the map CEL function on images.all, and define docker.io/istio* in the matchRules. The policy skips all the images that do not match the matchImages block.

All the images in the images.all array, that do not match the glob docker.io/istio* will be skipped

- expression: >-
payload(images.initContainers[0], attestations.sbom).builderId == "foo"
&&
payload(images.initContainers[0], attestations.slsa).version == "0.2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide a more detailed example? Something similar to:

https://github.com/kyverno/demos/blob/main/image_verification/check_attestations.yaml

proposals/imageverificationpolicy.md Outdated Show resolved Hide resolved
proposals/imageverificationpolicy.md Show resolved Hide resolved
proposals/imageverificationpolicy.md Outdated Show resolved Hide resolved
proposals/imageverificationpolicy.md Outdated Show resolved Hide resolved
proposals/imageverificationpolicy.md Show resolved Hide resolved
Signed-off-by: Vishal Choudhary <[email protected]>
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.

3 participants