diff --git a/scubagoggles/orchestrator.py b/scubagoggles/orchestrator.py index f0e6fd80..f45fee38 100644 --- a/scubagoggles/orchestrator.py +++ b/scubagoggles/orchestrator.py @@ -9,6 +9,7 @@ import os import platform import shutil +import uuid import webbrowser from datetime import datetime, timezone @@ -273,7 +274,7 @@ def _run_reporter(self): timestamp_utc = datetime.now(timezone.utc) timestamp_zulu = timestamp_utc.strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3] + 'Z' - + report_uuid = str(uuid.uuid4()) report_metadata = { 'TenantId': None, 'DisplayName': None, @@ -283,7 +284,8 @@ def _run_reporter(self): 'ProductAbbreviationMapping': product_abbreviation_mapping, 'Tool': 'ScubaGoggles', 'ToolVersion': Version.number, - 'TimeStampZulu': timestamp_zulu + 'TimeStampZulu': timestamp_zulu, + 'ReportUUID': report_uuid } total_output.update({'MetaData': report_metadata}) @@ -341,7 +343,9 @@ def _run_reporter(self): 'Details': self._generate_summary(stats[0])}) fragments.append(Reporter.create_html_table(table_data)) - front_page_html = Reporter.build_front_page_html(fragments, tenant_info) + front_page_html = Reporter.build_front_page_html(fragments, + tenant_info, + report_uuid) report_path.write_text(front_page_html, encoding = 'utf-8') # suppress opening the report in the browser diff --git a/scubagoggles/reporter/FrontPageReport/FrontPageReportTemplate.html b/scubagoggles/reporter/FrontPageReport/FrontPageReportTemplate.html index 6667705c..276ff432 100644 --- a/scubagoggles/reporter/FrontPageReport/FrontPageReportTemplate.html +++ b/scubagoggles/reporter/FrontPageReport/FrontPageReportTemplate.html @@ -21,6 +21,7 @@

SCuBA GWS Secure Configuration Baseline Reports

{{TABLE}} diff --git a/scubagoggles/reporter/reporter.py b/scubagoggles/reporter/reporter.py index 2bc44e17..1fdc8e45 100644 --- a/scubagoggles/reporter/reporter.py +++ b/scubagoggles/reporter/reporter.py @@ -151,7 +151,11 @@ def create_html_table(table_data: list) -> str: return table_html @classmethod - def build_front_page_html(cls, fragments: list, tenant_info: dict) -> str: + def build_front_page_html(cls, + fragments: list, + tenant_info: dict, + report_uuid: str) -> str: + """ Builds the Front Page Report using the HTML Report Template @@ -172,7 +176,7 @@ def build_front_page_html(cls, fragments: list, tenant_info: dict) -> str: front_css_file = cls._reporter_path / 'styles/FrontPageStyle.css' css = front_css_file.read_text(encoding = 'utf-8') html = html.replace('{{FRONT_CSS}}', f'') - + html = html.replace('{{report_uuid}}', report_uuid) html = html.replace('{{TABLE}}', table) now = datetime.now() diff --git a/scubagoggles/reporter/styles/FrontPageStyle.css b/scubagoggles/reporter/styles/FrontPageStyle.css index c1f2daf4..5a0ed724 100644 --- a/scubagoggles/reporter/styles/FrontPageStyle.css +++ b/scubagoggles/reporter/styles/FrontPageStyle.css @@ -39,7 +39,7 @@ a.individual_reports:active { font-family: Arial, Helvetica, sans-serif; color: #85B065; text-decoration: none; -} +} table.tenantdata tr:first-child { color: black; @@ -51,6 +51,13 @@ table.tenantdata tr:first-child { .manual { background-color: var(--test-other); } .error { - background-color: #deb8b8; + background-color: #deb8b8; color: #d10000; -} \ No newline at end of file +} + +.alignRight { + text-align: right; + color: grey; + font-size: 80%; + +}