|
4 | 4 |
|
5 | 5 |
|
6 | 6 | class AquaParser: |
| 7 | + |
| 8 | + def get_fields(self) -> list[str]: |
| 9 | + """ |
| 10 | + Return the list of fields used in the Aqua Parser. |
| 11 | +
|
| 12 | + Fields: |
| 13 | + - title: Made by combining cve, resource_name, and resource_version. |
| 14 | + - severity: Severity converted from Aqua format into Defect Dojo format. |
| 15 | + - severity_justification: Set to justification returned by Aqua scanner. |
| 16 | + - cvssv3: Defined based on the output of the Aqua Scanner. |
| 17 | + - description: Set to description returned from Aqua Scanner. If no description is present set to "no description". |
| 18 | + - mitigation: Set to fix_version returned from Aqua Scanner. |
| 19 | + - references: Set to url returned from Aqua Scanner. |
| 20 | + - component_name: Set to name returned from Aqua Scanner. |
| 21 | + - component_version: Set to version returned from Aqua Scanner. |
| 22 | + - impact: Set to same value as severity. |
| 23 | + - epss_score: Set to epss_score returned from scanner if it exists. |
| 24 | + - epss_percentile: Set to epss_percentile returned from scanner if it exists. |
| 25 | + """ |
| 26 | + return [ |
| 27 | + "title", |
| 28 | + "severity", |
| 29 | + "severity_justification", |
| 30 | + "cvssv3", |
| 31 | + "description", |
| 32 | + "mitigation", |
| 33 | + "references", |
| 34 | + "component_name", |
| 35 | + "component_version", |
| 36 | + "impact", |
| 37 | + "epss_score", |
| 38 | + "epss_percentile", |
| 39 | + ] |
| 40 | + |
| 41 | + def get_dedupe_fields(self) -> list[str]: |
| 42 | + """ |
| 43 | + Return the list of fields used for deduplication in the Aqua Parser. |
| 44 | +
|
| 45 | + Fields: |
| 46 | + - severity: Severity converted from Aqua format into Defect Dojo format. |
| 47 | + - component_name: Set to name returned from Aqua Scanner. |
| 48 | + - component_version: Set to version returned from Aqua Scanner. |
| 49 | +
|
| 50 | + #NOTE: vulnerability_ids is not provided by parser |
| 51 | + """ |
| 52 | + return [ |
| 53 | + "severity", |
| 54 | + "component_name", |
| 55 | + "component_version", |
| 56 | + ] |
| 57 | + |
| 58 | + # Jino This get_fields was written for the Aque Parser v2 (based off of "get_iten_v2") |
| 59 | + # What do we do with the seperate versions of this parser? |
| 60 | + # def get_fields(self) -> list[str]: |
| 61 | + # """ |
| 62 | + # Return the list of fields used in the Aqua Parser V2 |
| 63 | + # |
| 64 | + # Fields: |
| 65 | + # - title: Created by combining the finding's cve and file_path |
| 66 | + # - description: Text describing finding |
| 67 | + # - url: Url associated with the finding |
| 68 | + # - severity: Severity rating converted from Aqua's integer format into DefectDojo's format. |
| 69 | + # #Jino: On line 106 it calls severity_of instead of aqua_severity_of. get_item v1 uses aqua_severity_of# |
| 70 | + # - impact: Impact rating of finding. Same as the finding severity. |
| 71 | + # - mitigation: If solution is true, mitigation equals true. If fix_version is true, mitigation equals 'Upgrade to True'.If neither are true mitigation equals 'No known mitigation'. |
| 72 | + # """ |
| 73 | + # return [ |
| 74 | + # "title", |
| 75 | + # "description", |
| 76 | + # "url", |
| 77 | + # "severity", |
| 78 | + # "impact", |
| 79 | + # "mitigation", |
| 80 | + # ] |
| 81 | + # Dedupe for v2 based on default dedupe values |
| 82 | + # def get_dedupe_fields(self) -> list[str]: |
| 83 | + # """ |
| 84 | + # Return the list of fields used for deduplication in the Aqua Parser V2. |
| 85 | + # |
| 86 | + # Fields: |
| 87 | + # - title: Created by combining the finding's cve and file_path |
| 88 | + # - description: Text describing finding |
| 89 | + # """ |
| 90 | + # #NOTE: vulnerability_ids is not provided by parser |
| 91 | + # return [ |
| 92 | + # "title", |
| 93 | + # "description", |
| 94 | + # ] |
7 | 95 | def get_scan_types(self): |
8 | 96 | return ["Aqua Scan"] |
9 | 97 |
|
|
0 commit comments