endpoint =flag.String("endpoint","http://127.0.0.1:6060","Address to Clair API")
myAddress =flag.String("my-address","127.0.0.1","Address from the point of view of Clair")
minimumSeverity =flag.String("minimum-severity","Negligible","Minimum severity of vulnerabilities to show (Unknown, Negligible, Low, Medium, High, Critical, Defcon1)")
colorMode =flag.String("color","auto","Colorize the output (always, auto, never)")
flagEndpoint =flag.String("endpoint","http://127.0.0.1:6060","Address to Clair API")
flagMyAddress =flag.String("my-address","127.0.0.1","Address from the point of view of Clair")
flagMinimumSeverity =flag.String("minimum-severity","Negligible","Minimum severity of vulnerabilities to show (Unknown, Negligible, Low, Medium, High, Critical, Defcon1)")
flagColorMode =flag.String("color","auto","Colorize the output (always, auto, never)")
log.Printf("Could not get layer information: %s\n",err)
os.Exit(1)
returnfmt.Errorf("Could not get layer information: %s",err)
}
// Print report.
@ -174,7 +185,7 @@ func main() {
iflen(layer.Features)==0{
fmt.Printf("%s No features have been detected in the image. This usually means that the image isn't supported by Clair.\n",color.YellowString("NOTE:"))
os.Exit(0)
returnnil
}
isSafe:=true
@ -231,11 +242,11 @@ func main() {
ifisSafe{
fmt.Printf("%s No vulnerabilities were detected in your image\n",color.GreenString("Success!"))
os.Exit(0)
}elseif!hasVisibleVulnerabilities{
fmt.Printf("%s No vulnerabilities matching the minimum severity level were detected in your image\n",color.YellowString("NOTE:"))