Skip to content

Commit 7c295de

Browse files
fix typos
1 parent 3daf926 commit 7c295de

7 files changed

Lines changed: 7 additions & 10 deletions

File tree

docs/content/en/open_source/contributing/how-to-write-a-parser.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ For parser, we rely on module `cvss`. But we also have a helper method to valida
174174
```python
175175
cvss_data = parse_cvss_data("CVSS:3.0/S:C/C:H/I:H/A:N/AV:P/AC:H/PR:H/UI:R/E:H/RL:O/RC:R/CR:H/IR:X/AR:X/MAC:H/MPR:X/MUI:X/MC:L/MA:X")
176176
if cvss_data:
177-
finding.cvss3 = cvss_data.get("vector")
177+
finding.cvssv3 = cvss_data.get("vector")
178178
finding.cvssv3_score = cvss_data.get("score")
179179
finding.severity = cvss_data.get("severity") # if your tool does generate severity
180180
```
@@ -312,7 +312,7 @@ or like this:
312312
$ ./run-unittest.sh --test-case unittests.tools.test_aqua_parser.TestAquaParser
313313
{{< /highlight >}}
314314

315-
If you want to run all unit tests, simply run `$ docker-compose exec uwsgi bash -c 'python manage.py test unittests -v2'`
315+
If you want to run all parser unit tests, simply run `$ docker-compose exec uwsgi bash -c 'python manage.py test -p "test_*_parser.py" -v2'`
316316

317317
### Endpoint validation
318318

dojo/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2702,7 +2702,7 @@ def save(self, dedupe_option=True, rules_option=True, product_grading_option=Tru
27022702

27032703
cvss_data = parse_cvss_data(self.cvssv3)
27042704
if cvss_data:
2705-
self.cvss3 = cvss_data.get("vector")
2705+
self.cvssv3 = cvss_data.get("vector")
27062706
self.cvssv3_score = cvss_data.get("score")
27072707

27082708
except Exception as ex:

dojo/tools/aqua/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def get_item(self, resource, vuln, test):
226226

227227
cvss_data = parse_cvss_data(cvssv3)
228228
if cvss_data:
229-
finding.cvss3 = cvss_data.get("vector")
229+
finding.cvssv3 = cvss_data.get("vector")
230230
finding.cvssv3_score = cvss_data.get("score")
231231

232232
if vulnerability_id != "No CVE":

dojo/tools/jfrog_xray_unified/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def get_item(vulnerability, test):
142142

143143
cvss_data = parse_cvss_data(cvssv3)
144144
if cvss_data:
145-
finding.cvss3 = cvss_data.get("vector")
145+
finding.cvssv3 = cvss_data.get("vector")
146146
finding.cvssv3_score = cvss_data.get("score")
147147

148148
if vulnerability_id:

dojo/tools/npm_audit_7_plus/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def get_item(item_node, tree, test):
169169
from dojo.utils import parse_cvss_data
170170
cvss_data = parse_cvss_data(cvssv3)
171171
if cvss_data:
172-
dojo_finding.cvss3 = cvss_data.get("vector")
172+
dojo_finding.cvssv3 = cvss_data.get("vector")
173173
dojo_finding.cvssv3_score = cvss_data.get("score")
174174

175175
return dojo_finding

dojo/tools/qualys/parser.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,11 +352,8 @@ def parse_finding(host, tree):
352352
finding.mitigated = temp["mitigation_date"]
353353
finding.is_mitigated = temp["mitigated"]
354354
finding.active = temp["active"]
355-
logger.debug("CVSS_Vector: %s", temp.get("CVSS_vector"))
356355
if temp.get("CVSS_vector") is not None:
357-
logger.debug("CVSS_Vector: %s", temp.get("CVSS_vector"))
358356
cvss_data = parse_cvss_data(temp.get("CVSS_vector"))
359-
logger.debug("cvss_data: %s", cvss_data)
360357
if cvss_data:
361358
finding.cvssv3 = cvss_data.get("vector")
362359
finding.cvssv3_score = cvss_data.get("score")

dojo/tools/sonatype/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def get_finding(security_issue, component, test):
6666
if "cvssVector" in security_issue:
6767
cvss_data = parse_cvss_data(security_issue["cvssVector"])
6868
if cvss_data:
69-
finding.cvss3 = cvss_data.get("vector")
69+
finding.cvssv3 = cvss_data.get("vector")
7070
finding.cvssv3_score = cvss_data.get("score")
7171

7272
if "pathnames" in component:

0 commit comments

Comments
 (0)