Skip to content
Snippets Groups Projects
Commit 64e7c0ce authored by nenad.petrovic@xlab.si's avatar nenad.petrovic@xlab.si Committed by Anze Luzar
Browse files

Added uuid4 for unique indentifier of a scan run

parent 53ff563d
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,7 @@ from iac_scan_runner.utils import ( ...@@ -41,7 +41,7 @@ from iac_scan_runner.utils import (
from pydantic import SecretStr from pydantic import SecretStr
from datetime import datetime import uuid
import os import os
...@@ -152,10 +152,8 @@ class ScanRunner: ...@@ -152,10 +152,8 @@ class ScanRunner:
:param scan_response_type: Scan response type (JSON or HTML) :param scan_response_type: Scan response type (JSON or HTML)
:return: Dict or string with output for running checks :return: Dict or string with output for running checks
""" """
random_uuid = str(uuid.uuid4())
dt = datetime.now() dir_name = "../outputs/logs/scan_run_" + random_uuid
ts = datetime.timestamp(dt)
dir_name = "../outputs/logs/scan_run_" + str(ts)
os.mkdir(dir_name) os.mkdir(dir_name)
...@@ -205,8 +203,8 @@ class ScanRunner: ...@@ -205,8 +203,8 @@ class ScanRunner:
print(non_compatible_checks) print(non_compatible_checks)
print(self.results_summary.show_outcomes()) print(self.results_summary.show_outcomes())
self.results_summary.dump_outcomes(str(ts)) self.results_summary.dump_outcomes(random_uuid)
self.results_summary.generate_html_prioritized(str(ts)) self.results_summary.generate_html_prioritized(random_uuid)
else: else:
for iac_check in self.iac_checks.values(): for iac_check in self.iac_checks.values():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment