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

Request to add security vulnerability scan for the kyverno images #1557

Closed
imrajdas opened this issue Feb 8, 2021 · 14 comments · Fixed by #2472
Closed

Request to add security vulnerability scan for the kyverno images #1557

imrajdas opened this issue Feb 8, 2021 · 14 comments · Fixed by #2472
Assignees
Labels
enhancement New feature or request security

Comments

@imrajdas
Copy link
Contributor

imrajdas commented Feb 8, 2021

Is your feature request related to a problem? Please describe.

  • It is important to have an image scanning step in the CI pipeline to check the vulnerabilities.

  • Most of the enterprise Kubernetes cluster has a lot of security restrictions which won’t allow any application which has security vulnerabilities.

Describe the solution you'd like
Use of any opensource image scan tool like aquasecurity/trivy, clair and add it in the CI pipeline.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@imrajdas imrajdas added the enhancement New feature or request label Feb 8, 2021
@imrajdas imrajdas changed the title Request to add image security vulnerability scan for the kyverno images Request to add security vulnerability scan for the kyverno images Feb 8, 2021
@chipzoller
Copy link
Member

Agree, we need to provide this step and an output report that can be displayed for each release. Should probably use Trivy as that is what the ecosystem is standardizing on, by in large.

@imrajdas
Copy link
Contributor Author

imrajdas commented Feb 8, 2021

I have used trivy, it is good to generate reports but not sure about other tools.

@yashvardhan-kukreja
Copy link
Contributor

yashvardhan-kukreja commented Feb 8, 2021

Totally agreed with this issue Raj.

I have worked with trivy before as well as a part of implementing it as a CI stage and for vulnerability-report-generation as well.
If it's fine, I can pick this up and quickly implement this. Thanks :)

PS: speaking of other tools like Anchor engine, clair, etc. , trivy outperforms them in majority of the areas, so, I'd strongly suggest trivy for this. But yeah, suggestions are most welcome

cc: @chipzoller / @JimBugwadia / @realshuting

@imrajdas
Copy link
Contributor Author

imrajdas commented Feb 8, 2021 via email

@yashvardhan-kukreja
Copy link
Contributor

Sure. Will be good to see this being implemented :)

@imrajdas
Copy link
Contributor Author

@chipzoller @realshuting Trivy doesn't scan scratch images
Issue Ref- aquasecurity/trivy#173 (comment)

Selection_152

@chipzoller
Copy link
Member

That's right, forgot about that. Since we are using scratch images, I wonder how ultimately valuable such a security scan would be. Probably between none and very little.

@imrajdas
Copy link
Contributor Author

imrajdas commented Feb 13, 2021

One thing we can do

  1. Replace scratch with alpine in the Dockerfile using sed command
  2. Build that docker image
  3. Use Trivy to scan this local image

But this will increase the pipeline time.
Or we can run these steps parallel in GitHub workflows to reduce the time

@chipzoller
Copy link
Member

I don't think it really makes sense to swap the base image with something larger than what we need (and create unnecessary security vectors) for the purposes of then being able to scan it.

@imrajdas
Copy link
Contributor Author

@chipzoller Is there any benefits of using scratch image?. In terms of image size, alpine is around 5MB.

@imrajdas
Copy link
Contributor Author

One problem with scratch images, if someone wants to debug the kyverno container by kubectl exec, then it is not possible.

@JimBugwadia
Copy link
Member

@chipzoller
Copy link
Member

The benefit of using a scratch image is not only its size but also the minimal attack surface it creates as well as reduced variables (not in the programmatic sense but in the complexity sense). I don't know of the modern development practices with regard to Golang and debugging inside container images, but I've often seen there being a separate Makefile for a debug image which can be created by a user on-demand to use for such debugging purposes.

@ShubhamPalriwala
Copy link
Contributor

Trivy scans scratch images too now 😄
Added my views and ideas on this here at #2432

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

Successfully merging a pull request may close this issue.

6 participants