-
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.
Merge branch 'dev' into add_ruffS112S311
- Loading branch information
Showing
42 changed files
with
1,844 additions
and
133 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
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 |
---|---|---|
|
@@ -678,10 +678,10 @@ [email protected]: | |
dependencies: | ||
jquery ">= 1.0.0" | ||
|
||
[email protected].0: | ||
version "1.14.0" | ||
resolved "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.14.0.tgz#b75d417826f0bab38125f907356d2e3313a9c6d5" | ||
integrity sha512-mPfYKBoRCf0MzaT2cyW5i3IuZ7PfTITaasO5OFLAQxrHuI+ZxruPa+4/K1OMNT8oElLWGtIxc9aRbyw20BKr8g== | ||
[email protected].1: | ||
version "1.14.1" | ||
resolved "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.14.1.tgz#ba342ea3ffff662b787595391f607d923313e040" | ||
integrity sha512-DhzsYH8VeIvOaxwi+B/2BCsFFT5EGjShdzOcm5DssWjtcpGWIMsn66rJciDA6jBruzNiLf1q0KvwMoX1uGNvnQ== | ||
dependencies: | ||
jquery ">=1.12.0 <5.0.0" | ||
|
||
|
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,14 @@ | ||
--- | ||
title: "PTART Reports" | ||
toc_hide: true | ||
--- | ||
|
||
### What is PTART? | ||
PTART is a Pentest and Security Auditing Reporting Tool developed by the Michelin CERT (https://github.com/certmichelin/PTART) | ||
|
||
### Importing Reports | ||
Reports can be exported to JSON format from the PTART web UI, and imported into DefectDojo by using the "PTART Report" importer. | ||
|
||
### Sample Scan Data | ||
Sample scan data for testing purposes can be found [here](https://github.com/DefectDojo/django-DefectDojo/tree/master/unittests/scans/ptart). | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
42026ac47884ee26fe742e59fb7dc621b5f927ee6ee3c92daf09b97f2a740163 | ||
6a90a111e2b89eb2c400945c80ff76c64b135d78b84fdf6b09a6b83569946904 |
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
Empty file.
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,62 @@ | ||
import dojo.tools.ptart.ptart_parser_tools as ptart_tools | ||
from dojo.models import Finding | ||
|
||
|
||
class PTARTAssessmentParser: | ||
def __init__(self): | ||
self.cvss_type = None | ||
|
||
def get_test_data(self, tree): | ||
# Check that the report is valid, If we have no assessments, then | ||
# return an empty list | ||
if "assessments" not in tree: | ||
return [] | ||
|
||
self.cvss_type = tree.get("cvss_type", None) | ||
assessments = tree["assessments"] | ||
return [finding for assessment in assessments | ||
for finding in self.parse_assessment(assessment)] | ||
|
||
def parse_assessment(self, assessment): | ||
hits = assessment.get("hits", []) | ||
return [self.get_finding(assessment, hit) for hit in hits] | ||
|
||
def get_finding(self, assessment, hit): | ||
effort = ptart_tools.parse_ptart_fix_effort(hit.get("fix_complexity")) | ||
finding = Finding( | ||
title=ptart_tools.parse_title_from_hit(hit), | ||
severity=ptart_tools.parse_ptart_severity(hit.get("severity")), | ||
effort_for_fixing=effort, | ||
component_name=assessment.get("title", "Unknown Component"), | ||
date=ptart_tools.parse_date_added_from_hit(hit), | ||
) | ||
|
||
# Don't add fields if they are blank | ||
if hit["body"]: | ||
finding.description = hit.get("body") | ||
|
||
if hit["remediation"]: | ||
finding.mitigation = hit.get("remediation") | ||
|
||
if hit["id"]: | ||
finding.unique_id_from_tool = hit.get("id") | ||
finding.vuln_id_from_tool = hit.get("id") | ||
finding.cve = hit.get("id") | ||
|
||
# Clean up and parse the CVSS vector | ||
cvss_vector = ptart_tools.parse_cvss_vector(hit, self.cvss_type) | ||
if cvss_vector: | ||
finding.cvssv3 = cvss_vector | ||
|
||
if "labels" in hit: | ||
finding.unsaved_tags = hit["labels"] | ||
|
||
finding.unsaved_endpoints = ptart_tools.parse_endpoints_from_hit(hit) | ||
|
||
# Add screenshots to files, and add other attachments as well. | ||
finding.unsaved_files = ptart_tools.parse_screenshots_from_hit(hit) | ||
finding.unsaved_files.extend(ptart_tools.parse_attachment_from_hit(hit)) | ||
|
||
finding.references = ptart_tools.parse_references_from_hit(hit) | ||
|
||
return finding |
Oops, something went wrong.