Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

sarif report with errors with exit code 0 #575

Closed
2 of 3 tasks
dani-santos-code opened this issue Nov 20, 2023 · 0 comments · Fixed by #576
Closed
2 of 3 tasks

sarif report with errors with exit code 0 #575

dani-santos-code opened this issue Nov 20, 2023 · 0 comments · Fixed by #576

Comments

@dani-santos-code
Copy link
Contributor

ISSUE TYPE
  • Bug Report
  • Feature Idea

BUG REPORT

SUMMARY

When running kubeaudit on the cli, we generally yield an exit code other than 0 if the report contains errors. Following the pattern for json and logrus, we're not running os.Exit(rootConfig.exitCode) when we generate a sarif report.

this is causing issues, since now when a sarif report with results is generated, we get exit code 0.

ENVIRONMENT
  • Kubeaudit version: 0.22.0
  • Kubeaudit install method: DIY-BUILD
STEPS TO REPRODUCE
  1. use one of the manifest files in the repo to test. Example: auditors/privileged/fixtures/privileged-nil.yml

  2. go run ./cmd/main.go all -f auditors/privileged/fixtures/privileged-nil.yml --format=sarif

  3. when you run echo $? you should see 0

EXPECTED RESULTS

2

ACTUAL RESULTS

0

ADDITIONAL INFORMATION

FEATURE IDEA

  • If the maintainers agree with the feature as described here, I intend to submit a Pull Request myself.1

Proposal:

1 This is the quickest way to get a new feature! We reserve the right to close feature requests, even ones we like, if the proposer does not intend to contribute to the feature and it doesn't fit in our current roadmap.

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

Successfully merging a pull request may close this issue.

1 participant