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

Add Trivy security scanner #21780

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

lilatomic
Copy link
Contributor

Trivy is a scanner for finding security vulnerabilities and misconfigurations in Docker images, Helm charts, and Terraform modules (among others). This MR adds it for all of those.

I made it as a single MR to minimise churn in the common code (like the invocation of Trivy). Let me know if you'd rather I split this up.

(previously it was escaping the sandbox to use /tmp/trivy, which won't survive reboots)
When running on a module, `get_terraform_backend_and_vars` would detect all vars files.
(Because the vars files are typically specified as dependencies on the deployment, the module has none.
Inference then grabs all of them.)
This is almost certainly not desired,
especially since they will be passed when running against the deployment.
# This is the 1st commit message:

document using Trivy in all backends

# The commit message pantsbuild#2 will be skipped:

# fixup! docs
@lilatomic lilatomic added category:new feature backend: Docker Docker backend-related issues labels Dec 19, 2024
@lilatomic lilatomic added backend: Helm Helm backend-related issues backend: Terraform Terraform backend-related issues labels Dec 19, 2024
Copy link
Contributor

@alonsodomin alonsodomin left a comment

Choose a reason for hiding this comment

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

LGMT

Just an observation on how other tools have been added in the past, the default approach I believe is to add their register.py hook under the experimental package, even when the parent module has already been graduated.

Taking as a reference the Python backend and its extra tools that have been gradually added but I'll let others have the final word on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: Docker Docker backend-related issues backend: Helm Helm backend-related issues backend: Terraform Terraform backend-related issues category:new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants