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

security-scan: conditionally allow scanning pre-release versions #543

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

shashankram
Copy link
Contributor

@shashankram shashankram commented Nov 21, 2024

Conditionally allows running image scans against Github releases marked as pre-release.

Testing done:

  • Unit test

  • Manual test
    without --enable-pre-release

$ go run /src/code/go-utils/securityscanutils/cli scan-repo -v     -i /src/code/gloo-operator/docs/cmd/imageVersionConstraints.csv    -c ">=v0.1.0-0"         -r us-docker.pkg.dev/solo-public/gloo-operator  -g gloo-operator        -a output-locally          -d /src/code/gloo-operator/docs/cmd/securityScanDebugInstructions.md

{"level":"debug","ts":"2024-11-21T13:12:11.845-0800","caller":"securityscanutils/securityscan.go:176","msg":"Number of github releases to scan: 0"}

with --enable-pre-release

go run /src/code/go-utils/securityscanutils/cli scan-repo -v     -i /src/code/gloo-operator/docs/cmd/imageVersionConstraints.csv    -c ">=v0.1.0-0"         -r us-docker.pkg.dev/solo-public/gloo-operator  -g gloo-operator        -a output-locally          -d /src/code/gloo-operator/docs/cmd/securityScanDebugInstructions.md --enable-pre-release

{"level":"debug","ts":"2024-11-21T13:12:14.772-0800","caller":"securityscanutils/securityscan.go:176","msg":"Number of github releases to scan: 1"}
{"level":"debug","ts":"2024-11-21T13:12:14.772-0800","caller":"securityscanutils/securityscan.go:203","msg":"LocalIssueWriter configured with Predicate: &{}"}
{"level":"debug","ts":"2024-11-21T13:12:14.772-0800","caller":"securityscanutils/securityscan.go:211","msg":"Completed processing user defined configuration."}
{"level":"debug","ts":"2024-11-21T13:12:14.862-0800","caller":"securityscanutils/trivy_scanner.go:89","msg":"Trivy returned 0 after 90.231655ms on us-docker.pkg.dev/solo-public/gloo-operator/gloo-operator:0.1.0-alpha.0"}
{"level":"info","ts":"2024-11-21T13:12:14.863-0800","caller":"securityscanutils/securityscan.go:276","msg":"no vulnerabilities found for version 0.1.0-alpha.0 of gloo-operator repo, skipping issue write"}

Conditionally allows running image scans against Github releases
marked as pre-release.
@nfuden
Copy link
Contributor

nfuden commented Nov 22, 2024

Can we add the context here?
I assume its that we want to scan something before we elevate it to a non-prerelease right?

@shashankram
Copy link
Contributor Author

Can we add the context here? I assume its that we want to scan something before we elevate it to a non-prerelease right?

The context is noted in the PR description. It allows optionally scanning versions marked as pre-release.

@nfuden
Copy link
Contributor

nfuden commented Nov 22, 2024

But why would you want to scan a prerelease. For example users will take formerly released things and mark them as prerelease to take them down from being checked.
Not saying you are trying to change that but more guidance around how this security scanning could or should be configured / called would make sense

@shashankram
Copy link
Contributor Author

But why would you want to scan a prerelease. For example users will take formerly released things and mark them as prerelease to take them down from being checked. Not saying you are trying to change that but more guidance around how this security scanning could or should be configured / called would make sense

Why would you not want to scan a pre-release? It is project specific, and the tool should provide the ability for projects to scan releases the way they prefer. There is no general rule here. In some projects, we may mark a release as pre-release but still run scans against it to catch issues before they make it into an actual release.

Copy link
Member

@yuval-k yuval-k left a comment

Choose a reason for hiding this comment

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

lgtm

@soloio-bulldozer soloio-bulldozer bot merged commit df75e5e into main Nov 22, 2024
4 checks passed
@soloio-bulldozer soloio-bulldozer bot deleted the shashankram/pre-release-scan branch November 22, 2024 18:30
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