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

GH action: add SBOM + scanner for dockerfile and docker images #260

Closed
wants to merge 5 commits into from

Conversation

zdtsw
Copy link
Contributor

@zdtsw zdtsw commented Aug 18, 2022

GH action: add SBOM for linux docker images+ scanner for dockerfile
- use trivy to scan all Dockerfile.release.full
- use syft to generate sbom from images we build
- upload to codeql for trivy scan result from image
- windows is not working for sbom and trivy yet
sbom result artifacts: https://github.com/zdtsw/containers/actions/runs/2882299165
scan result: https://github.com/zdtsw/containers/actions/runs/2882299167

zdtsw added 5 commits August 19, 2022 09:08
	- use trivy to scan all Dockerfile.release.full
	- use syft to generate sbom from images we build
	- upload to codeql for trivy scan result from image
  - for some reason matrix.os to match startwith "windows" does not work
	- seems it could not find the image it built from previou step
@zdtsw
Copy link
Contributor Author

zdtsw commented Aug 19, 2022

looks like Specify at least 1 USER command in Dockerfile with non-root user as argument is the worst thing in all our dockerfile
some others might need to be addressed too
https://avd.aquasec.com/nvd/2022/cve-2022-37434/
https://avd.aquasec.com/nvd/2020/cve-2020-16156/
https://avd.aquasec.com/nvd/2016/cve-2016-2781/

@zdtsw zdtsw requested a review from gdams August 19, 2022 07:44
@smlambert
Copy link
Contributor

This PR has no related issue for it.

After discussion in the PMC call today, I will create an issue so we can discuss a best path forward, thinking about the design and benefits and maintenance implications of such a change and to talk about the scanning that occurs upstream already, in order to compare what is being checked / scanned to avoid duplication.

@gdams
Copy link
Member

gdams commented Aug 24, 2022

@tianon / @yosifkit do either of you two have any thoughts about this? It would be good to understand what scanning the official images already go through prior to publishing. I wonder if this is the most appropriate place to have this code (perhaps it's better in the upstream GitHub action that is maintained by your team?

@smlambert
Copy link
Contributor

Created #267 for discussing best approach and location for such scanning and work to take place.

@tianon
Copy link

tianon commented Aug 25, 2022

Thanks for the ping, @gdams ❤️

I would say that at the Dockerfile source level is probably not the best place to check for issues with the final built images. 😅

That being said, this is definitely a priority for Docker - there's a lot of work in BuildKit to generate SBOMs directly at build-time (see especially moby/buildkit#2773 and linked PRs), and that's the direction we're planning to take. 👍

@tellison
Copy link
Contributor

@zdtsw can this be closed now given the comments above?

@zdtsw
Copy link
Contributor Author

zdtsw commented Nov 29, 2022

@zdtsw can this be closed now given the comments above?

sure

@zdtsw zdtsw closed this Nov 29, 2022
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.

5 participants