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

Improve/document confusing exit codes #79

Open
EggBaconAndSpam opened this issue Aug 5, 2021 · 1 comment
Open

Improve/document confusing exit codes #79

EggBaconAndSpam opened this issue Aug 5, 2021 · 1 comment

Comments

@EggBaconAndSpam
Copy link

vulnix currently returns the following exit codes:

  • 2 if a runtime exception occurred, or if all went well and there were non-whitelisted vulnerabilities
  • 1 if the --show-whitelisted option was used and there was at least one whitelisted vulnerability (but no non-whitelisted ones)
  • 0 otherwise

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:

  1. The exit codes should be documented (in vulnix --help). I'm not sure how to achieve this with the click package we're using.
  2. Runtime exception should yield a distinct exit code from non-failure exit codes.
  3. There should be a flag to tell vulnix to return a non-zero exit code if and only if an exception occured.
  4. 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?

@ckauhaus
Copy link
Collaborator

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.

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

No branches or pull requests

2 participants