diff --git a/prowler/lib/outputs/html/html.py b/prowler/lib/outputs/html/html.py index 9d75af8a13..a7b27093da 100644 --- a/prowler/lib/outputs/html/html.py +++ b/prowler/lib/outputs/html/html.py @@ -173,9 +173,15 @@ class HTML(Output):
  • Passed: {str(stats.get("total_pass", 0))}
  • +
  • + Passed (Muted): {str(stats.get("total_muted_pass", 0))} +
  • Failed: {str(stats.get("total_fail", 0))}
  • +
  • + Failed (Muted): {str(stats.get("total_muted_fail", 0))} +
  • Total Resources: {str(stats.get("resources_count", 0))}
  • diff --git a/prowler/lib/outputs/outputs.py b/prowler/lib/outputs/outputs.py index d6c5fe1022..0f99ef7de5 100644 --- a/prowler/lib/outputs/outputs.py +++ b/prowler/lib/outputs/outputs.py @@ -91,6 +91,8 @@ def extract_findings_statistics(findings: list) -> dict: stats = {} total_pass = 0 total_fail = 0 + muted_pass = 0 + muted_fail = 0 resources = set() findings_count = 0 all_fails_are_muted = True @@ -98,17 +100,25 @@ def extract_findings_statistics(findings: list) -> dict: for finding in findings: # Save the resource_id resources.add(finding.resource_id) + if finding.status == "PASS": total_pass += 1 findings_count += 1 + if finding.muted is True: + muted_pass += 1 + if finding.status == "FAIL": total_fail += 1 findings_count += 1 + if finding.muted is True: + muted_fail += 1 if not finding.muted and all_fails_are_muted: all_fails_are_muted = False stats["total_pass"] = total_pass + stats["total_muted_pass"] = muted_pass stats["total_fail"] = total_fail + stats["total_muted_fail"] = muted_fail stats["resources_count"] = len(resources) stats["findings_count"] = findings_count stats["all_fails_are_muted"] = all_fails_are_muted diff --git a/tests/lib/outputs/html/html_test.py b/tests/lib/outputs/html/html_test.py index 9e978a9f80..0fa5ccbe3e 100644 --- a/tests/lib/outputs/html/html_test.py +++ b/tests/lib/outputs/html/html_test.py @@ -14,10 +14,12 @@ from tests.providers.kubernetes.kubernetes_fixtures import ( ) html_stats = { - "total_pass": 0, - "total_fail": 1, + "total_pass": 25, + "total_muted_pass": 20, + "total_fail": 5, + "total_muted_fail": 5, "resources_count": 1, - "findings_count": 1, + "findings_count": 30, } pass_html_finding = """ @@ -300,13 +302,19 @@ def get_aws_html_header(args: list) -> str: