vulnix
vulnix copied to clipboard
Improve/document confusing exit codes
vulnix currently returns the following exit codes:
2if a runtime exception occurred, or if all went well and there were non-whitelisted vulnerabilities1if the--show-whitelistedoption was used and there was at least one whitelisted vulnerability (but no non-whitelisted ones)0otherwise
I find this a little confusing, and ended up having to use the (vulnix ... || true) > out.json trick to deal with non-zero exit codes.
A few thoughts:
- The exit codes should be documented (in
vulnix --help). I'm not sure how to achieve this with theclickpackage we're using. - Runtime exception should yield a distinct exit code from non-failure exit codes.
- There should be a flag to tell vulnix to return a non-zero exit code if and only if an exception occured.
- Alternatively, vulnix could return non-zero exit codes only in the case of an exception, and we could add an explicit flag to fail if vulnerabilities were found.
What do you think?
Good suggestions. I'll have a look into this and figure out how to do this with click. Point 1) should probably go into the manpage.