Skip to content

Commit

Permalink
PA-7433 Add discovered urls to existing report (#62)
Browse files Browse the repository at this point in the history
* PA-7433 Add scanned urls to existing report

* rename field

* wording
  • Loading branch information
SOOS-JAlvarez committed Feb 17, 2023
1 parent 911ac90 commit b80b1ac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.21
1.0.22
6 changes: 4 additions & 2 deletions hooks/soos_dast_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ def zap_started(zap, target):

def zap_pre_shutdown(zap):
log("Overview of spidered URL's:")
for url in zap.spider.all_urls:
log(f"found: {url}")
with open('spidered_urls.txt', 'w') as f:
for url in zap.spider.all_urls:
f.write(f"{url}\n")
log(f"found: {url}")
6 changes: 6 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,12 @@ def run_analysis(self) -> None:
)
raise Exception(f"An Unexpected error has occurred running the {self.scan_mode} scan")

# Add the discovered urls to the report
discoveredUrls = open('./spidered_urls.txt', 'r').read().splitlines()
data = json.load(open(Constants.REPORT_SCAN_RESULT_FILE, 'r'))
data['discoveredUrls'] = discoveredUrls
json.dump(data, open(Constants.REPORT_SCAN_RESULT_FILE, 'w'))

self.publish_results_to_soos(
project_id=soos_dast_start_response.project_id,
branch_hash=soos_dast_start_response.branch_hash,
Expand Down

0 comments on commit b80b1ac

Please sign in to comment.