Repository: prowler-cloud/prowler
Issue category: Bug Report

Issue:
Invalid WAF arn
### Steps to Reproduce

Run prowler on Docker against an account with global WAF enabled.

### Expected behavior

To pass

### Actual Result with Screenshots or Logs

2024-11-18 10:09:43,933 [File: wafv2_service.py:122]    [Module: wafv2_service]  ERROR: us-east-1 -- WAFInvalidParameterException[105]: An error occurred (WAFInvalidParameterException) when calling the ListResourcesForWebACL operation: Error reason: The ARN isn't valid. A valid ARN begins with arn: and includes other information separated by colons or slashes., field: RESOURCE_ARN, parameter: arn:aws:wafv2:us-east-1:xxxxx:global/webacl/xxx/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx

2024-11-18 10:09:43,934 [File: wafv2_service.py:122]    [Module: wafv2_service]  ERROR: us-east-1 -- WAFInvalidParameterException[105]: An error occurred (WAFInvalidParameterException) when calling the ListResourcesForWebACL operation: Error reason: The ARN isn't valid. A valid ARN begins with arn: and includes other information separated by colons or slashes., field: RESOURCE_ARN, parameter: arn:aws:wafv2:us-east-1:xxxxx:global/webacl/xxx/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx

2024-11-18 10:09:43,938 [File: wafv2_service.py:122]    [Module: wafv2_service]  ERROR: us-east-1 -- WAFInvalidParameterException[105]: An error occurred (WAFInvalidParameterException) when calling the ListResourcesForWebACL operation: Error reason: The ARN isn't valid. A valid ARN begins with arn: and includes other information separated by colons or slashes., field: RESOURCE_ARN, parameter: arn:aws:wafv2:us-east-1:xxxxx:global/webacl/xxx/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx

### How did you install Prowler?

Docker (docker pull toniblyx/prowler)

### Environment Resource

3. Docker container locally

### OS used

One inside docker

### Prowler version

4.5.3

### Pip version

one inside docker image

### Context

We have three global WAF, and three regional WAF. The three regional works, and the three global throws an malformed arn error.


Hints:
Thank you very much for using Prowler and for reporting this issue.

We are reviewing it and will provide you with a solution as soon as possible! 🚀

Patch:
diff --git a/prowler/providers/aws/services/wafv2/wafv2_service.py b/prowler/providers/aws/services/wafv2/wafv2_service.py
index 4971f1c4223..85feed76f62 100644
--- a/prowler/providers/aws/services/wafv2/wafv2_service.py
+++ b/prowler/providers/aws/services/wafv2/wafv2_service.py
@@ -99,7 +99,7 @@ def _get_logging_configuration(self, acl):
     def _list_resources_for_web_acl(self, acl):
         logger.info("WAFv2 - Describing resources...")
         try:
-            if acl.scope == Scope.REGIONAL or acl.region in self.regional_clients:
+            if acl.scope == Scope.REGIONAL:
                 for resource in self.regional_clients[
                     acl.region
                 ].list_resources_for_web_acl(


Test patch: