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 flag does not exit with failure code #104

Open
devtayls opened this issue Nov 22, 2021 · 4 comments
Open

--exit flag does not exit with failure code #104

devtayls opened this issue Nov 22, 2021 · 4 comments
Labels

Comments

@devtayls
Copy link

Expected

When the --exit flag is passed with a given threshold
And I have notifications that exceed the confidence threshold
Then the application returns a non-zero exit code indicating failure

Actual

When the --exit flag is passed with a given threshold
And I have notifications that exceed the confidence threshold
Then the application does not return a non-zero exit code indicating failure
And there is no indication that the notifications exceed the confidence threshold.

Examples

Screen Shot 2021-11-22 at 13 38 01

)

Screen Shot 2021-11-22 at 13 38 53

@devtayls
Copy link
Author

I wonder if we need to change the !is_nil(status) to !is_number(status) on line 190 of sobelow.ex

@nwai90
Copy link

nwai90 commented Mar 18, 2022

Same issue here with version 0.8

@houllette
Copy link
Collaborator

Hey @devtayls - I'm working my way through issues having just recently become maintainer, sorry for the delay. I'm trying to recreate this issue and I'm unsuccessful - meaning that I'm getting the expected behavior you outlined.

I'm just using the Sobelow codebase itself and am getting failure codes with a Low threshold (since it detects a few low confidence vulnerabilities on itself) but as soon as you bump it to Medium (where it won't find anything) it exits cleanly.

@houllette houllette added the bug label Jan 26, 2023
@goncalotomas
Copy link

goncalotomas commented Apr 21, 2023

I was also seeing this behaviour but when using mix sobelow --exit. The exit option doesn't have a boolean value but instead takes the same value of the threshold option.

Simply switching to mix sobelow --exit medium or using exit: :medium in the configuration file fixed this for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants