prowler-cloud / prowler

Prowler is an Open Source Security tool for AWS, Azure, GCP and Kubernetes to do security assessments, audits, incident response, compliance, continuous monitoring, hardening and forensics readiness. Includes CIS, NIST 800, NIST CSF, CISA, FedRAMP, PCI-DSS, GDPR, HIPAA, FFIEC, SOC2, GXP, Well-Architected Security, ENS and more
https://prowler.com
Apache License 2.0
10.76k stars 1.53k forks source link

fix(aws): enhance resource arn filtering #4821

Closed sergargar closed 2 months ago

sergargar commented 2 months ago

Description

The flag --resource-arn was not working because we were handling the audited regions as a list and not as a set and getting the error:

2024-08-21 13:55:44,520 [File: aws_provider.py:761] [Module: aws_provider] CRITICAL: TypeError[758]: 'set' object is not subscriptable

Also, the regex pattern of the ARN was not valid for the ARN of CloudWatch log groups, e.g. arn:aws:logs:eu-west-1:123456789012:log-group:/ecs/test:*

Checklist

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.

Project coverage is 89.13%. Comparing base (5876fea) to head (0f9763f). Report is 11 commits behind head on master.

Files Patch % Lines
prowler/providers/aws/aws_provider.py 76.92% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4821 +/- ## ========================================== + Coverage 89.06% 89.13% +0.07% ========================================== Files 926 928 +2 Lines 28365 28432 +67 ========================================== + Hits 25262 25344 +82 + Misses 3103 3088 -15 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 2 months ago

💚 All backports created successfully

Status Branch Result
✅ v4.3

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details