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

Regression: exit code is not zero when no vulnerabilities or issues found #178

Closed
manolo opened this issue Oct 26, 2023 · 3 comments · Fixed by #181
Closed

Regression: exit code is not zero when no vulnerabilities or issues found #178

manolo opened this issue Oct 26, 2023 · 3 comments · Fixed by #181
Assignees
Labels
bug Something isn't working
Milestone

Comments

@manolo
Copy link

manolo commented Oct 26, 2023

Description

bomber exits with a exitcode=10 in both cases: when any issue is found, and when no issues found.

Note that with previous releases the exit code was 0 in the case of successful scan

How to reproduce

Install bomber in their latest version: 0.4.5, even though it reports a wrong version 0.4.4 when running bomber --version see #176

Scan with no vulnerabilities

  • create a basic package.json file with a the latest non-vulnerable pack-resolver
{
  "name": "no-name",
  "license": "UNLICENSED",
  "dependencies": {
      "pac-resolver": "7.0.0"
   }
}
  • install dependencies npm install
  • generate SBOM npx @cyclonedx/cyclonedx-npm --output-file sbom.json
  • run Bomber bomber scan sbom.json --output json and you can see no issues reported
  • check exit code echo $? and it is 10

Scan with vulnerabilities

  • Modify the package.json file to downgrade pack-resolver to a vulnerable version
{
  "name": "no-name",
  "license": "UNLICENSED",
  "dependencies": {
      "pac-resolver": "5.0.0"
   }
}
  • install dependencies npm install
  • generate SBOM npx @cyclonedx/cyclonedx-npm --output-file sbom.json
  • run Bomber bomber scan sbom.json --output json and you can see a couple of issues reported
  • check exit code echo $? and it is 10
@manolo
Copy link
Author

manolo commented Oct 26, 2023

Perhaps regression was introduced in #165

@AJIOXA
Copy link

AJIOXA commented Oct 26, 2023

Same on version 0.4.5

@djschleen djschleen self-assigned this Oct 27, 2023
@djschleen
Copy link
Member

Appreciate the detailed explanation! I'll make sure we get this fixed and released as soon as possible.

@djschleen djschleen added this to the 0.4.6 milestone Oct 27, 2023
@djschleen djschleen added the bug Something isn't working label Oct 27, 2023
@djschleen djschleen linked a pull request Nov 9, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

3 participants