Repository: prowler-cloud/prowler
Pull request: fix(html): handle muted status to html outputs
### Context

Fixes #4181


### Description

Muted FIndings appeared as Pass/Fail/Manual, it's necessary to handle the case when the finding it's muted on HTML outputs.

Thanks @alanrickman-keysight for the report 🥇 


### License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.


Problem statement:
[Bug]: Unable to filter muted findings in HTML output
### Steps to Reproduce

1. Run a scan with a mutelist against an account with failures and muted failures e.g. `prowler aws --profile xxx --compliance cis_1.5_aws --mutelist-file mutelist.yaml --output-modes html csv`
2. Open the HTML report


### Expected behavior

The status filter in the HTML output should provide options for both `FAIL` and `MUTED (FAIL)` in the same way that the dashboard does.

### Actual Result with Screenshots or Logs

The dashboard shows all findings as `FAIL` so there's no easy way in the HTML output to filter out findings you've chosen to mute.

### How did you install Prowler?

From brew (brew install prowler)

### Environment Resource

Workstation

### OS used

MacOS

### Prowler version

4.2.1

### Pip version

23.3.2

### Context

_No response_

Hints from issue discussion:
Hi! @alanrickman-keysight thanks for the report! We will investigate this issue and reach you with a fix 😄

Commit message: fix(html): handle muted status to html outputs

Patch to review:
diff --git a/prowler/lib/outputs/html/html.py b/prowler/lib/outputs/html/html.py
index e2c24fb405..f13092df73 100644
--- a/prowler/lib/outputs/html/html.py
+++ b/prowler/lib/outputs/html/html.py
@@ -136,12 +136,17 @@ def fill_html(file_descriptor, finding):
     try:
         row_class = "p-3 mb-2 bg-success-custom"
         finding.status = finding.status.split(".")[0]
+        # Change the status of the finding if it's muted
+        if finding.muted:
+            finding.status = f"Muted({finding.status})"
         if finding.status == "MANUAL":
             row_class = "table-info"
         elif finding.status == "FAIL":
             row_class = "table-danger"
         elif finding.status == "WARNING":
             row_class = "table-warning"
+        elif "Muted" in finding.status:
+            row_class = "table-secondary"
 
         file_descriptor.write(
             f"""


Code review comments:
diff_hunk: @@ -136,12 +136,17 @@ def fill_html(file_descriptor, finding):
     try:
         row_class = "p-3 mb-2 bg-success-custom"
         finding.status = finding.status.split(".")[0]
+        # Change the status of the finding if it's muted
+        if finding.muted:
+            finding.status = f"Muted({finding.status})"
path: prowler/lib/outputs/html/html.py
text: @user1:
```suggestion
            finding.status = f"Muted({finding.status})"
            row_class = "table-warning"
```

@user1:
Why not to add it there?

@author:
Done

diff_hunk: @@ -136,12 +136,17 @@ def fill_html(file_descriptor, finding):
     try:
         row_class = "p-3 mb-2 bg-success-custom"
         finding.status = finding.status.split(".")[0]
+        # Change the status of the finding if it's muted
+        if finding.muted:
+            finding.status = f"Muted({finding.status})"
         if finding.status == "MANUAL":
             row_class = "table-info"
         elif finding.status == "FAIL":
             row_class = "table-danger"
         elif finding.status == "WARNING":
             row_class = "table-warning"
+        elif "Muted" in finding.status:
+            row_class = "table-secondary"
path: prowler/lib/outputs/html/html.py
text: @user1:
```suggestion
```

@author:
True

diff_hunk: @@ -136,12 +136,17 @@ def fill_html(file_descriptor, finding):
     try:
         row_class = "p-3 mb-2 bg-success-custom"
         finding.status = finding.status.split(".")[0]
+        # Change the status of the finding if it's muted
+        if finding.muted:
+            finding.status = f"Muted({finding.status})"
         if finding.status == "MANUAL":
             row_class = "table-info"
         elif finding.status == "FAIL":
             row_class = "table-danger"
         elif finding.status == "WARNING":
             row_class = "table-warning"
path: prowler/lib/outputs/html/html.py
text: @user1:
This is no longer needed in v4

@author:
True