-
Notifications
You must be signed in to change notification settings - Fork 76
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
Feature request: Disable exit code on vulnerability count #204
Comments
@PPACI Thanks for the suggestion but I think you might be able to do that without modifying Nancy at all. Examples below are for linux but there might be a way to do it if on windows if that is your ci environment. Something like so
That assumes you want to keep the exit code around for later. If you want to bail on the exit code altogether you can just do this.
Also I'm curious can you describe what you are trying to do a little more?? Nancy is setup that way so that the feedback loop of when there is a vulnerability discovered you know about it immediately and can address it by fixing it or adding a temporary/permanent exclusion. |
Thank you for the answer. We're also using different analyser such as Trivy, which has the following option :https://github.com/aquasecurity/trivy#image-1
This feature proposal was more to be on par feature wise with other security scanner than a real need (which can be addressed as you said by bash directly). |
My preference here would be to not exit with the vulnerability count as the code (because it is a misuse of POSIX standards anyways), and have it just exit with 1 if it finds vulns. I think that's more reliable to people to begin with. The |
Also, thanks for filing an issue, always nice to get to chat with someone in the community! Feel free to send us a PR if you want, as well, we love contributions! |
Sorry about the accidental close 🤦♂️ I'm with @DarthHater on how it feels like it could promote bad behavior. You just put this little exit-code flag in place in your build pipeline and tada no more vulns ever again (if even not intentional). But maybe if you use the flag the intention is more that you plan on using the output and doing more with it later anyways. |
in summary i gather:
so the smallest thing we have agreement to do is adjust behavior per 2, but may also need (have not looked closely) to think about what if anything we can improve for 3. mention of crashing CI/CD/halting build such as not to allow reading logs made me think we may provide less output when exiting at this point, but that may also be simple build system behavior (e.g. reap container w/ no external logging). since this is pretty stale, is there enough consensus for me to generate a PR for 2? |
Hi Sonatype.
I would like to introduce a feature request to ease some use case in CI/CD
this is a very interesting feature, but in some case, I would like to be able to disable this.
Being able to do something like
Nancy sleuth --no-exit
nancy/internal/cmd/root.go
Line 449 in ab916e3
Maybe we could do something like
count > 0 && exitFlag
?Thank you for your hard work!
cc @bhamail / @DarthHater
The text was updated successfully, but these errors were encountered: