-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from jsztuka/fix-clair-out
fix(stoneintg-358|stonebugs-42):drop URL & report number of vulns
- Loading branch information
Showing
3 changed files
with
30 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,45 @@ | ||
package required_checks | ||
|
||
violation_critical_vulnerabilities[{"msg": msg, "details":{"name": name, "description": description, "url": url}}] { | ||
violation_critical_vulnerabilities[{"msg": msg, "vulnerabilities_number": vulns_num, "details":{"name": name, "description": description, "url": url}}] { | ||
rpms_with_critical_vulnerabilities := {rpm.Name | rpm := input.data[_].Features[_]; count(rpm.Vulnerabilities) > 0; rpm.Vulnerabilities[_].Severity == "Critical"} | ||
not count(rpms_with_critical_vulnerabilities) == 0 | ||
|
||
name := "clair_critical_vulnerabilities" | ||
msg = sprintf("Found packages with critical vulnerabilities: %s", [concat(", ", rpms_with_critical_vulnerabilities)]) | ||
description := "The image musn't contain packages that have critical severity vulnerabilities." | ||
url := "https://source.redhat.com/groups/public/product-security/content/product_security_folder/understanding_red_hat_security_vulnerabilities_10pdf" | ||
vulns_num = count(rpms_with_critical_vulnerabilities) | ||
msg := "Found packages with critical vulnerabilities. Consider updating to a newer version of those packages, they may no longer be affected by the reported CVEs." | ||
description = sprintf("Packages found: %s", [concat(", ", rpms_with_critical_vulnerabilities)]) | ||
url := "https://access.redhat.com/articles/red_hat_vulnerability_tutorial" | ||
} | ||
|
||
violation_high_vulnerabilities[{"msg": msg, "details":{"name": name, "description": description, "url": url}}] { | ||
violation_high_vulnerabilities[{"msg": msg, "vulnerabilities_number": vulns_num, "details":{"name": name, "description": description, "url": url}}] { | ||
rpms_with_high_vulnerabilities := {rpm.Name | rpm := input.data[_].Features[_]; count(rpm.Vulnerabilities) > 0; rpm.Vulnerabilities[_].Severity == "High"} | ||
not count(rpms_with_high_vulnerabilities) == 0 | ||
|
||
name := "clair_high_vulnerabilities" | ||
msg = sprintf("Found packages with high vulnerabilities: %s", [concat(", ", rpms_with_high_vulnerabilities)]) | ||
description := "The image musn't contain packages that have high severity vulnerabilities." | ||
url := "https://source.redhat.com/groups/public/product-security/content/product_security_folder/understanding_red_hat_security_vulnerabilities_10pdf" | ||
vulns_num = count(rpms_with_high_vulnerabilities) | ||
msg := "Found packages with high vulnerabilities. Consider updating to a newer version of those packages, they may no longer be affected by the reported CVEs." | ||
description = sprintf("Packages found: %s", [concat(", ", rpms_with_high_vulnerabilities)]) | ||
url := "https://access.redhat.com/articles/red_hat_vulnerability_tutorial" | ||
} | ||
|
||
violation_medium_vulnerabilities[{"msg": msg, "details":{"name": name, "description": description, "url": url}}] { | ||
violation_medium_vulnerabilities[{"msg": msg, "vulnerabilities_number": vulns_num, "details":{"name": name, "description": description, "url": url}}] { | ||
rpms_with_medium_vulnerabilities := {rpm.Name | rpm := input.data[_].Features[_]; count(rpm.Vulnerabilities) > 0; rpm.Vulnerabilities[_].Severity == "Medium"} | ||
not count(rpms_with_medium_vulnerabilities) == 0 | ||
|
||
name := "clair_medium_vulnerabilities" | ||
msg = sprintf("Found packages with medium vulnerabilities: %s", [concat(", ", rpms_with_medium_vulnerabilities)]) | ||
description := "The image musn't contain packages that have medium severity vulnerabilities." | ||
url := "https://source.redhat.com/groups/public/product-security/content/product_security_folder/understanding_red_hat_security_vulnerabilities_10pdf" | ||
vulns_num = count(rpms_with_medium_vulnerabilities) | ||
msg := "Found packages with medium vulnerabilities. Consider updating to a newer version of those packages, they may no longer be affected by the reported CVEs." | ||
description = sprintf("Packages found: %s", [concat(", ", rpms_with_medium_vulnerabilities)]) | ||
url := "https://access.redhat.com/articles/red_hat_vulnerability_tutorial" | ||
} | ||
|
||
violation_low_vulnerabilities[{"msg": msg, "details":{"name": name, "description": description, "url": url}}] { | ||
violation_low_vulnerabilities[{"msg": msg, "vulnerabilities_number": vulns_num, "details":{"name": name, "description": description, "url": url}}] { | ||
rpms_with_low_vulnerabilities := {rpm.Name | rpm := input.data[_].Features[_]; count(rpm.Vulnerabilities) > 0; rpm.Vulnerabilities[_].Severity == "Low"} | ||
not count(rpms_with_low_vulnerabilities) == 0 | ||
|
||
name := "clair_low_vulnerabilities" | ||
msg = sprintf("Found packages with low vulnerabilities: %s", [concat(", ", rpms_with_low_vulnerabilities)]) | ||
description := "The image musn't contain packages that have low severity vulnerabilities." | ||
url := "https://source.redhat.com/groups/public/product-security/content/product_security_folder/understanding_red_hat_security_vulnerabilities_10pdf" | ||
vulns_num = count(rpms_with_low_vulnerabilities) | ||
msg := "Found packages with low vulnerabilities. Consider updating to a newer version of those packages, they may no longer be affected by the reported CVEs." | ||
description = sprintf("Packages found: %s", [concat(", ", rpms_with_low_vulnerabilities)]) | ||
url := "https://access.redhat.com/articles/red_hat_vulnerability_tutorial" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters