optiopay / klar

Integration of Clair and Docker Registry
MIT License
506 stars 138 forks source link

CLAIR_OUTPUT filter doesn't seem to work #35

Closed xueshanf closed 7 years ago

xueshanf commented 7 years ago

I am using the latest klar I believe (used go get github.com/optiopay/klar to install) which should supports CLAIR_OUTPUT. However my scan output still shows all levels of severity.

CLAIR_ADDR=https://clair.example.com CLAIR_OUTPUT=High CLAIR_THRESHOLD=10  DOCKER_USER=username DOCKER_PASSWORD=password JSON_OUTPUT=true klar jenkins | jq '.' > output.json
grep Severity output.json  | sort -u
      "Severity": "High",
      "Severity": "Low"
      "Severity": "Low",
      "Severity": "Medium",
      "Severity": "Negligible"
      "Severity": "Negligible",
      "Severity": "Unknown"
      "Severity": "Unknown",

Did I miss anything? Thanks!

supereagle commented 7 years ago

@xueshanf Sorry, this is bug, thanks for your reporting. CLAIR_OUTPUT does not work when JSON_OUTPUT=true, you can have a try without JSON_OUTPUT=true. I will submit a PR to fix this.