-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎉 Make Trivy Operator K8s vulnids consistent (#11188)
* 🎉 Uniform Trivy Operator K8s vulnids * sha sum * sha sum * bug fix * ruff * fix secretshandler * sha sum * ruff * fix * fix * fix unittests * fix * Update dojo/tools/trivy_operator/uniform_vulnid.py Co-authored-by: Charles Neill <[email protected]> * Update dojo/tools/trivy_operator/compliance_handler.py Co-authored-by: Charles Neill <[email protected]> * Update dojo/tools/trivy_operator/checks_handler.py Co-authored-by: Charles Neill <[email protected]> * Update dojo/tools/trivy_operator/vulnerability_handler.py Co-authored-by: Charles Neill <[email protected]> * update sha sum * update sha sum --------- Co-authored-by: Charles Neill <[email protected]>
- Loading branch information
1 parent
8db16b6
commit 3f48a94
Showing
9 changed files
with
35 additions
and
15 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 +1 @@ | ||
58e2f6cb0ed2c041fe2741d955b72cb7540bfb0923f489d6324717fcf00039da | ||
16d7a27d3146421a9aa6a8b1283f3d71b5c41b8bdb7c88ca70b0160e251034d1 |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import re | ||
|
||
|
||
class UniformTrivyVulnID: | ||
def return_uniformed_vulnid(self, vulnid): | ||
if vulnid is None: | ||
return vulnid | ||
if "cve" in vulnid.lower(): | ||
return vulnid | ||
if "khv" in vulnid.lower(): | ||
temp = re.compile("([a-zA-Z-_]+)([0-9]+)") | ||
number = str(temp.match(vulnid).groups()[1]).zfill(3) | ||
avd_category = str(temp.match(vulnid.lower()).groups()[0]) | ||
return avd_category.upper() + number | ||
if "ksv" in vulnid.lower() or "kcv" in vulnid.lower(): | ||
temp = re.compile("([a-zA-Z-_]+)([0-9]+)") | ||
number = str(temp.match(vulnid).groups()[1]).zfill(4) | ||
avd_category = str(temp.match(vulnid.lower().replace("_", "").replace("-", "")).groups()[0].replace("avd", "")) | ||
return "AVD-" + avd_category.upper() + "-" + number | ||
return vulnid |
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