From 1b48dd430d9a89bb2847e5894bab33d67d8b3394 Mon Sep 17 00:00:00 2001 From: pedrooot Date: Fri, 12 Sep 2025 16:48:05 +0200 Subject: [PATCH] feat(html): improve view --- prowler/lib/outputs/html/html.py | 947 ++++++++++++++++--------------- 1 file changed, 487 insertions(+), 460 deletions(-) diff --git a/prowler/lib/outputs/html/html.py b/prowler/lib/outputs/html/html.py index ff332c2353..69fce32ade 100644 --- a/prowler/lib/outputs/html/html.py +++ b/prowler/lib/outputs/html/html.py @@ -143,19 +143,60 @@ class HTML(Output): Prowler - The Handy Cloud Security Tool -
- Dark Mode: - + +
+
-
+ +
+
-
- prowler-logo +
Report Information
  • -
    -
    - Version: {prowler_version} -
    -
    + Version: +
    {prowler_version}
  • - Parameters used: {" ".join(sys.argv[1:]) if from_cli else ""} + Parameters used: +
    {" ".join(sys.argv[1:]) if from_cli else "N/A"}
  • - Date: {timestamp.isoformat()} + Date: +
    {timestamp.isoformat()}
-
{HTML.get_assessment_summary(provider)} -
+
+ +
Assessment Overview @@ -1194,11 +1248,17 @@ class HTML(Output):
+ +
+ {HTML.get_assessment_summary(provider)}
-
-
-
+
+ + + +
+
@@ -1663,36 +1723,6 @@ class HTML(Output): } }); - // Theme Switcher Logic - const themeToggleCheckbox = document.getElementById('themeToggleCheckbox'); - const currentTheme = localStorage.getItem('theme'); - - function applyTheme(theme) { - if (theme === 'dark') { - document.body.classList.add('dark-theme'); - themeToggleCheckbox.checked = true; - } else { - document.body.classList.remove('dark-theme'); - themeToggleCheckbox.checked = false; - } - } - - if (currentTheme) { - applyTheme(currentTheme); - } else { - // Default to light theme if no preference is stored - applyTheme('light'); - } - - themeToggleCheckbox.addEventListener('change', function() { - if (this.checked) { - localStorage.setItem('theme', 'dark'); - applyTheme('dark'); - } else { - localStorage.setItem('theme', 'light'); - applyTheme('light'); - } - }); }); @@ -1729,39 +1759,40 @@ class HTML(Output): else: audited_regions = ", ".join(provider.identity.audited_regions) return f""" -
AWS Assessment Summary
  • - AWS Account: {provider.identity.account} + AWS Account: +
    {provider.identity.account}
  • - AWS-CLI Profile: {profile} + AWS-CLI Profile: +
    {profile}
  • - Audited Regions: {audited_regions} + Audited Regions: +
    {audited_regions}
-
-
-
-
- AWS Credentials -
-
    -
  • - User Id: {provider.identity.user_id} +
    +
    + AWS Credentials +
    +
      +
    • + User Id: +
      {provider.identity.user_id}
    • - Caller Identity ARN: {provider.identity.identity_arn} + Caller Identity ARN: +
      {provider.identity.identity_arn}
    -
    -
""" +
""" except Exception as error: logger.error( f"{error.__class__.__name__}[{error.__traceback__.tb_lineno}] -- {error}" @@ -1793,39 +1824,40 @@ class HTML(Output): else: html_identity = provider.identity.identity_id return f""" -
Azure Assessment Summary
  • - Azure Tenant IDs: {" ".join(provider.identity.tenant_ids)} + Azure Tenant IDs: +
    {" ".join(provider.identity.tenant_ids)}
  • - Azure Tenant Domain: {provider.identity.tenant_domain} + Azure Tenant Domain: +
    {provider.identity.tenant_domain}
  • - Azure Subscriptions: {" ".join(printed_subscriptions)} + Azure Subscriptions: +
    {" ".join(printed_subscriptions)}
-
-
-
-
- Azure Credentials -
-
    -
  • - Azure Identity Type: {provider.identity.identity_type} +
    +
    + Azure Credentials +
    +
      +
    • + Azure Identity Type: +
      {provider.identity.identity_type}
    • - Azure Identity ID: {html_identity} + Azure Identity ID: +
      {html_identity}
    -
    -
""" +
""" except Exception as error: logger.error( f"{error.__class__.__name__}[{error.__traceback__.tb_lineno}] -- {error}" @@ -1854,7 +1886,6 @@ class HTML(Output): except AttributeError: profile = "default" return f""" -
GCP Assessment Summary @@ -1865,9 +1896,7 @@ class HTML(Output):
-
-
-
+
GCP Credentials
@@ -1876,8 +1905,7 @@ class HTML(Output): GCP Account: {profile} -
-
""" +
""" except Exception as error: logger.error( f"{error.__class__.__name__}[{error.__traceback__.tb_lineno}] -- {error}" @@ -1897,7 +1925,7 @@ class HTML(Output): """ try: return f""" -
+
Kubernetes Assessment Summary @@ -1921,8 +1949,7 @@ class HTML(Output): Kubernetes Context: {provider.identity.context} -
-
""" +
""" except Exception as error: logger.error( f"{error.__class__.__name__}[{error.__traceback__.tb_lineno}] -- {error}" @@ -2004,7 +2031,7 @@ class HTML(Output): """ return f""" -
+
GitHub Assessment Summary @@ -2022,8 +2049,7 @@ class HTML(Output):
    {credentials_items}
-
-
""" +
""" except Exception as error: logger.error( f"{error.__class__.__name__}[{error.__traceback__.tb_lineno}] -- {error}" @@ -2068,8 +2094,7 @@ class HTML(Output): M365 Identity ID: {provider.identity.identity_id} -
-
""" +
""" except Exception as error: logger.error( f"{error.__class__.__name__}[{error.__traceback__.tb_lineno}] -- {error}" @@ -2113,8 +2138,7 @@ class HTML(Output): NHN Identity ID: {provider.identity.identity_id} - - """ + """ except Exception as error: logger.error( f"{error.__class__.__name__}[{error.__traceback__.tb_lineno}] -- {error}" @@ -2158,8 +2182,7 @@ class HTML(Output): MongoDB Atlas authentication method: API Key - - """ + """ except Exception as error: logger.error( f"{error.__class__.__name__}[{error.__traceback__.tb_lineno}] -- {error}" @@ -2203,8 +2226,7 @@ class HTML(Output): IAC authentication method: {provider.auth_method} - - """ + """ except Exception as error: logger.error( f"{error.__class__.__name__}[{error.__traceback__.tb_lineno}] -- {error}" @@ -2227,6 +2249,11 @@ class HTML(Output): # It is not pretty but useful # AWS_provider --> aws # GCP_provider --> gcp + # GitHub_provider --> github + # M365_provider --> m365 + # NHN_provider --> nhn + # MongoDB Atlas_provider --> mongodbatlas + # IAC_provider --> iac # Azure_provider --> azure # Kubernetes_provider --> kubernetes