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

Exit with zero in case of vulnerability found #2

Closed
anotherbridge opened this issue May 23, 2023 · 4 comments · Fixed by #15
Closed

Exit with zero in case of vulnerability found #2

anotherbridge opened this issue May 23, 2023 · 4 comments · Fixed by #15
Assignees

Comments

@anotherbridge
Copy link

Describe the bug
When a vulnerability was found the exit code of the program is zero. Thus it makes it hard to integrate the tool into an automation that should raise an alert in case a vulnerability was found. This is the case when running pyscan either for a specific package or within a repository.

To Reproduce
Steps to reproduce the behavior:

  1. Run pyscan package -n requests -v 2.30.0
  2. Run echo $?
  3. Observe that 0 is returned

Expected behavior
It is expected that a non-zero exit code is returned in case a vulnerability is found.

Desktop (please complete the following information):

  • OS: macOS Ventura ARM architecture, Debian 11.7 x86 architecture
@aswinnnn
Copy link
Owner

Yes, this is a known case and will be integrated as default way of exiting in the new version as mentioned in the future notes in CHANGELOG.md. I will be closing this issue as its already taken care of and will be released within the next version.

@anotherbridge
Copy link
Author

@aswinnnn Is this behavior already released, since I can still not get an exit code of 1 when a vulnerability was detected in one of the packages. The non-zero exit code is only producable when the tool itself encounters an error, e.g. such as described in #16.

@aswinnnn
Copy link
Owner

aswinnnn commented Jul 5, 2023

It was released, but I moved the scanner functions around in the latest version and looks like I forgot about the exit codes. Fixing it ASAP.

@aswinnnn aswinnnn reopened this Jul 5, 2023
@anotherbridge
Copy link
Author

Thanks a lot!

aswinnnn added a commit that referenced this issue Jul 5, 2023
@aswinnnn aswinnnn linked a pull request Jul 5, 2023 that will close this issue
9 tasks
@aswinnnn aswinnnn self-assigned this Sep 28, 2023
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 a pull request may close this issue.

2 participants