From e03feafd96505341a513075bb3bb37ca811cf843 Mon Sep 17 00:00:00 2001 From: Prowler Bot Date: Tue, 10 Sep 2024 20:35:41 +0200 Subject: [PATCH] fix(main): logic for resource_tag and resource_arn usage (#4982) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Pedro Martín --- prowler/__main__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/prowler/__main__.py b/prowler/__main__.py index d38ca19201..1653f992b8 100644 --- a/prowler/__main__.py +++ b/prowler/__main__.py @@ -224,8 +224,9 @@ def prowler(): # Once the provider is set and we have the eventual checks based on the resource identifier, # it is time to check what Prowler's checks are going to be executed checks_from_resources = global_provider.get_checks_to_execute_by_audit_resources() - # Intersect checks from resources with checks to execute - checks_to_execute = checks_to_execute.intersection(checks_from_resources) + # Intersect checks from resources with checks to execute so we only run the checks that apply to the resources with the specified ARNs or tags + if args.resource_arn or args.resource_tag: + checks_to_execute = checks_to_execute.intersection(checks_from_resources) # Sort final check list checks_to_execute = sorted(checks_to_execute)