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

Allow exclusion of cosign objects from the image repository database #167

Closed
stefanprodan opened this issue Aug 24, 2021 · 2 comments · Fixed by #256
Closed

Allow exclusion of cosign objects from the image repository database #167

stefanprodan opened this issue Aug 24, 2021 · 2 comments · Fixed by #256
Assignees
Labels
enhancement New feature or request

Comments

@stefanprodan
Copy link
Member

stefanprodan commented Aug 24, 2021

When using cosign to sign container images, a standalone object is push to the registry. Our image scanner thinks this is a valid container image tag (GHCR thinks that too) and could potentially crash live system if an image policy matches the cosign object.

For example I've signed flagger-loadtester, GHCR shows the signature object as a container image tag:

Screenshot 2021-08-24 at 16 38 27

As expected Flux adds this tag to its database:

$ flux create image repository flagger-loadtester --image ghcr.io/fluxcd/flagger-loadtester --interval 20m

$ flux get images all
NAME                              	READY	MESSAGE                      	LAST SCAN                	SUSPENDED 
imagerepository/flagger-loadtester	True 	successful scan, found 2 tags	2021-08-24T16:08:15+03:00	False 

To avoid deploying cosign signatures as container images onto clusters, I propose we add a field to the ImageRepository API to allow people to exclude tags based on regex expression, e.g.:

apiVersion: image.toolkit.fluxcd.io/v1beta1
kind: ImageRepository
metadata:
  name: flagger-loadtester
  namespace: flux-system
spec:
  image: ghcr.io/fluxcd/flagger-loadtester
  interval: 20m0s
  exclusionList:
    - ".*sig$"
@stefanprodan stefanprodan added the enhancement New feature or request label Aug 24, 2021
@aryan9600
Copy link
Member

We could have a default to ignore all tags ending with .sig in case exclusionList is unspecified.

@aryan9600 aryan9600 self-assigned this May 9, 2022
@aryan9600
Copy link
Member

aryan9600 commented May 10, 2022

A better name for this field could be IgnoreSuffix? @stefanprodan
This would not suit the regex approach.

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

Successfully merging a pull request may close this issue.

2 participants