We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
ecr_repositories_scan_vulnerabilities_in_latest_image: Configure level
### New feature motivation

Hi, is it possible to configure the level from which the test shall fail?
AWS tags some findings as medium which I might want to ignore, but of course I don't want to mute critical findings for the image.

### Solution Proposed

none

### Describe alternatives you've considered

none

### Additional context

_No response_

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `prowler/providers/aws/services/ecr/ecr_repositories_scan_vulnerabilities_in_latest_image/ecr_repositories_scan_vulnerabilities_in_latest_image.py`
Content:
```
1 from prowler.lib.check.models import Check, Check_Report_AWS
2 from prowler.providers.aws.services.ecr.ecr_client import ecr_client
3 
4 
5 class ecr_repositories_scan_vulnerabilities_in_latest_image(Check):
6     def execute(self):
7         findings = []
8         for registry in ecr_client.registries.values():
9             for repository in registry.repositories:
10                 # First check if the repository has images
11                 if len(repository.images_details) > 0:
12                     # We only want to check the latest image pushed
13                     image = repository.images_details[-1]
14 
15                     report = Check_Report_AWS(self.metadata())
16                     report.region = repository.region
17                     report.resource_id = repository.name
18                     report.resource_arn = repository.arn
19                     report.resource_tags = repository.tags
20                     report.status = "PASS"
21                     report.status_extended = f"ECR repository {repository.name} has imageTag {image.latest_tag} scanned without findings."
22                     if not image.scan_findings_status:
23                         report.status = "FAIL"
24                         report.status_extended = f"ECR repository {repository.name} has imageTag {image.latest_tag} without a scan."
25                     elif image.scan_findings_status == "FAILED":
26                         report.status = "FAIL"
27                         report.status_extended = (
28                             f"ECR repository {repository.name} with scan status FAILED."
29                         )
30                     elif image.scan_findings_status != "FAILED":
31                         if image.scan_findings_severity_count and (
32                             image.scan_findings_severity_count.critical
33                             or image.scan_findings_severity_count.high
34                             or image.scan_findings_severity_count.medium
35                         ):
36                             report.status = "FAIL"
37                             report.status_extended = f"ECR repository {repository.name} has imageTag {image.latest_tag} scanned with findings: CRITICAL->{image.scan_findings_severity_count.critical}, HIGH->{image.scan_findings_severity_count.high}, MEDIUM->{image.scan_findings_severity_count.medium}."
38 
39                     findings.append(report)
40 
41         return findings
42
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/prowler/providers/aws/services/ecr/ecr_repositories_scan_vulnerabilities_in_latest_image/ecr_repositories_scan_vulnerabilities_in_latest_image.py b/prowler/providers/aws/services/ecr/ecr_repositories_scan_vulnerabilities_in_latest_image/ecr_repositories_scan_vulnerabilities_in_latest_image.py
--- a/prowler/providers/aws/services/ecr/ecr_repositories_scan_vulnerabilities_in_latest_image/ecr_repositories_scan_vulnerabilities_in_latest_image.py
+++ b/prowler/providers/aws/services/ecr/ecr_repositories_scan_vulnerabilities_in_latest_image/ecr_repositories_scan_vulnerabilities_in_latest_image.py
@@ -5,6 +5,12 @@
 class ecr_repositories_scan_vulnerabilities_in_latest_image(Check):
     def execute(self):
         findings = []
+
+        # Get minimun severity to report
+        minimum_severity = ecr_client.audit_config.get(
+            "ecr_repository_vulnerability_minimum_severity", "MEDIUM"
+        )
+
         for registry in ecr_client.registries.values():
             for repository in registry.repositories:
                 # First check if the repository has images
@@ -27,8 +33,23 @@
                         report.status_extended = (
                             f"ECR repository {repository.name} with scan status FAILED."
                         )
-                    elif image.scan_findings_status != "FAILED":
-                        if image.scan_findings_severity_count and (
+                    elif (
+                        image.scan_findings_status != "FAILED"
+                        and image.scan_findings_severity_count
+                    ):
+                        if (
+                            minimum_severity == "CRITICAL"
+                            and image.scan_findings_severity_count.critical
+                        ):
+                            report.status = "FAIL"
+                            report.status_extended = f"ECR repository {repository.name} has imageTag {image.latest_tag} scanned with findings: CRITICAL->{image.scan_findings_severity_count.critical}."
+                        elif minimum_severity == "HIGH" and (
+                            image.scan_findings_severity_count.critical
+                            or image.scan_findings_severity_count.high
+                        ):
+                            report.status = "FAIL"
+                            report.status_extended = f"ECR repository {repository.name} has imageTag {image.latest_tag} scanned with findings: CRITICAL->{image.scan_findings_severity_count.critical}, HIGH->{image.scan_findings_severity_count.high}."
+                        elif minimum_severity == "MEDIUM" and (
                             image.scan_findings_severity_count.critical
                             or image.scan_findings_severity_count.high
                             or image.scan_findings_severity_count.medium

{"golden_diff": "diff --git a/prowler/providers/aws/services/ecr/ecr_repositories_scan_vulnerabilities_in_latest_image/ecr_repositories_scan_vulnerabilities_in_latest_image.py b/prowler/providers/aws/services/ecr/ecr_repositories_scan_vulnerabilities_in_latest_image/ecr_repositories_scan_vulnerabilities_in_latest_image.py\n--- a/prowler/providers/aws/services/ecr/ecr_repositories_scan_vulnerabilities_in_latest_image/ecr_repositories_scan_vulnerabilities_in_latest_image.py\n+++ b/prowler/providers/aws/services/ecr/ecr_repositories_scan_vulnerabilities_in_latest_image/ecr_repositories_scan_vulnerabilities_in_latest_image.py\n@@ -5,6 +5,12 @@\n class ecr_repositories_scan_vulnerabilities_in_latest_image(Check):\n     def execute(self):\n         findings = []\n+\n+        # Get minimun severity to report\n+        minimum_severity = ecr_client.audit_config.get(\n+            \"ecr_repository_vulnerability_minimum_severity\", \"MEDIUM\"\n+        )\n+\n         for registry in ecr_client.registries.values():\n             for repository in registry.repositories:\n                 # First check if the repository has images\n@@ -27,8 +33,23 @@\n                         report.status_extended = (\n                             f\"ECR repository {repository.name} with scan status FAILED.\"\n                         )\n-                    elif image.scan_findings_status != \"FAILED\":\n-                        if image.scan_findings_severity_count and (\n+                    elif (\n+                        image.scan_findings_status != \"FAILED\"\n+                        and image.scan_findings_severity_count\n+                    ):\n+                        if (\n+                            minimum_severity == \"CRITICAL\"\n+                            and image.scan_findings_severity_count.critical\n+                        ):\n+                            report.status = \"FAIL\"\n+                            report.status_extended = f\"ECR repository {repository.name} has imageTag {image.latest_tag} scanned with findings: CRITICAL->{image.scan_findings_severity_count.critical}.\"\n+                        elif minimum_severity == \"HIGH\" and (\n+                            image.scan_findings_severity_count.critical\n+                            or image.scan_findings_severity_count.high\n+                        ):\n+                            report.status = \"FAIL\"\n+                            report.status_extended = f\"ECR repository {repository.name} has imageTag {image.latest_tag} scanned with findings: CRITICAL->{image.scan_findings_severity_count.critical}, HIGH->{image.scan_findings_severity_count.high}.\"\n+                        elif minimum_severity == \"MEDIUM\" and (\n                             image.scan_findings_severity_count.critical\n                             or image.scan_findings_severity_count.high\n                             or image.scan_findings_severity_count.medium\n", "issue": "ecr_repositories_scan_vulnerabilities_in_latest_image: Configure level\n### New feature motivation\n\nHi, is it possible to configure the level from which the test shall fail?\r\nAWS tags some findings as medium which I might want to ignore, but of course I don't want to mute critical findings for the image.\n\n### Solution Proposed\n\nnone\n\n### Describe alternatives you've considered\n\nnone\n\n### Additional context\n\n_No response_\n", "before_files": [{"content": "from prowler.lib.check.models import Check, Check_Report_AWS\nfrom prowler.providers.aws.services.ecr.ecr_client import ecr_client\n\n\nclass ecr_repositories_scan_vulnerabilities_in_latest_image(Check):\n    def execute(self):\n        findings = []\n        for registry in ecr_client.registries.values():\n            for repository in registry.repositories:\n                # First check if the repository has images\n                if len(repository.images_details) > 0:\n                    # We only want to check the latest image pushed\n                    image = repository.images_details[-1]\n\n                    report = Check_Report_AWS(self.metadata())\n                    report.region = repository.region\n                    report.resource_id = repository.name\n                    report.resource_arn = repository.arn\n                    report.resource_tags = repository.tags\n                    report.status = \"PASS\"\n                    report.status_extended = f\"ECR repository {repository.name} has imageTag {image.latest_tag} scanned without findings.\"\n                    if not image.scan_findings_status:\n                        report.status = \"FAIL\"\n                        report.status_extended = f\"ECR repository {repository.name} has imageTag {image.latest_tag} without a scan.\"\n                    elif image.scan_findings_status == \"FAILED\":\n                        report.status = \"FAIL\"\n                        report.status_extended = (\n                            f\"ECR repository {repository.name} with scan status FAILED.\"\n                        )\n                    elif image.scan_findings_status != \"FAILED\":\n                        if image.scan_findings_severity_count and (\n                            image.scan_findings_severity_count.critical\n                            or image.scan_findings_severity_count.high\n                            or image.scan_findings_severity_count.medium\n                        ):\n                            report.status = \"FAIL\"\n                            report.status_extended = f\"ECR repository {repository.name} has imageTag {image.latest_tag} scanned with findings: CRITICAL->{image.scan_findings_severity_count.critical}, HIGH->{image.scan_findings_severity_count.high}, MEDIUM->{image.scan_findings_severity_count.medium}.\"\n\n                    findings.append(report)\n\n        return findings\n", "path": "prowler/providers/aws/services/ecr/ecr_repositories_scan_vulnerabilities_in_latest_image/ecr_repositories_scan_vulnerabilities_in_latest_image.py"}], "after_files": [{"content": "from prowler.lib.check.models import Check, Check_Report_AWS\nfrom prowler.providers.aws.services.ecr.ecr_client import ecr_client\n\n\nclass ecr_repositories_scan_vulnerabilities_in_latest_image(Check):\n    def execute(self):\n        findings = []\n\n        # Get minimun severity to report\n        minimum_severity = ecr_client.audit_config.get(\n            \"ecr_repository_vulnerability_minimum_severity\", \"MEDIUM\"\n        )\n\n        for registry in ecr_client.registries.values():\n            for repository in registry.repositories:\n                # First check if the repository has images\n                if len(repository.images_details) > 0:\n                    # We only want to check the latest image pushed\n                    image = repository.images_details[-1]\n\n                    report = Check_Report_AWS(self.metadata())\n                    report.region = repository.region\n                    report.resource_id = repository.name\n                    report.resource_arn = repository.arn\n                    report.resource_tags = repository.tags\n                    report.status = \"PASS\"\n                    report.status_extended = f\"ECR repository {repository.name} has imageTag {image.latest_tag} scanned without findings.\"\n                    if not image.scan_findings_status:\n                        report.status = \"FAIL\"\n                        report.status_extended = f\"ECR repository {repository.name} has imageTag {image.latest_tag} without a scan.\"\n                    elif image.scan_findings_status == \"FAILED\":\n                        report.status = \"FAIL\"\n                        report.status_extended = (\n                            f\"ECR repository {repository.name} with scan status FAILED.\"\n                        )\n                    elif (\n                        image.scan_findings_status != \"FAILED\"\n                        and image.scan_findings_severity_count\n                    ):\n                        if (\n                            minimum_severity == \"CRITICAL\"\n                            and image.scan_findings_severity_count.critical\n                        ):\n                            report.status = \"FAIL\"\n                            report.status_extended = f\"ECR repository {repository.name} has imageTag {image.latest_tag} scanned with findings: CRITICAL->{image.scan_findings_severity_count.critical}.\"\n                        elif minimum_severity == \"HIGH\" and (\n                            image.scan_findings_severity_count.critical\n                            or image.scan_findings_severity_count.high\n                        ):\n                            report.status = \"FAIL\"\n                            report.status_extended = f\"ECR repository {repository.name} has imageTag {image.latest_tag} scanned with findings: CRITICAL->{image.scan_findings_severity_count.critical}, HIGH->{image.scan_findings_severity_count.high}.\"\n                        elif minimum_severity == \"MEDIUM\" and (\n                            image.scan_findings_severity_count.critical\n                            or image.scan_findings_severity_count.high\n                            or image.scan_findings_severity_count.medium\n                        ):\n                            report.status = \"FAIL\"\n                            report.status_extended = f\"ECR repository {repository.name} has imageTag {image.latest_tag} scanned with findings: CRITICAL->{image.scan_findings_severity_count.critical}, HIGH->{image.scan_findings_severity_count.high}, MEDIUM->{image.scan_findings_severity_count.medium}.\"\n\n                    findings.append(report)\n\n        return findings\n", "path": "prowler/providers/aws/services/ecr/ecr_repositories_scan_vulnerabilities_in_latest_image/ecr_repositories_scan_vulnerabilities_in_latest_image.py"}]}