Shopify / kubeaudit

kubeaudit helps you audit your Kubernetes clusters against common security controls
MIT License
1.9k stars 184 forks source link

capture exit code for sarif #576

Closed dani-santos-code closed 12 months ago

dani-santos-code commented 1 year ago
Description

When running kubeaudit on the cli, we generally yield an exit code other than 0 if the report contains errors.

However, when we run it with the sarif format, we get 0 even when we have errors. This happens, because we're returning here to avoid printing extra info to the console. This means we never reach this line.

Fixes #575

Type of change
  1. go run ./cmd/main.go all -f auditors/privileged/fixtures/privileged-nil.yml --format=sarif

  2. when you run echo $? you should see 2

Checklist: