diff --git a/prowler/providers/aws/aws_provider.py b/prowler/providers/aws/aws_provider.py index 683b478968..7a24829acf 100644 --- a/prowler/providers/aws/aws_provider.py +++ b/prowler/providers/aws/aws_provider.py @@ -78,7 +78,7 @@ def __init__(self, arguments: Namespace): # MFA Configuration (false by default) input_mfa = getattr(arguments, "mfa", None) input_profile = getattr(arguments, "profile", None) - input_regions = set(getattr(arguments, "region", set())) + input_regions = set(getattr(arguments, "region", []) or []) organizations_role_arn = getattr(arguments, "organizations_role", None) # Set if unused services must be scanned diff --git a/tests/providers/aws/aws_provider_test.py b/tests/providers/aws/aws_provider_test.py index e0e4d3d2b4..cbec76b7a5 100644 --- a/tests/providers/aws/aws_provider_test.py +++ b/tests/providers/aws/aws_provider_test.py @@ -755,6 +755,14 @@ def test_aws_provider_mutelist_dynamodb(self): assert aws_provider.mutelist.mutelist == mutelist["Mutelist"] assert aws_provider.mutelist.mutelist_file_path == dynamodb_mutelist_path + @mock_aws + def test_empty_input_regions_in_arguments(self): + arguments = Namespace() + arguments.region = None + aws_provider = AwsProvider(arguments) + + assert isinstance(aws_provider, AwsProvider) + @mock_aws def test_generate_regional_clients_all_enabled_regions(self): arguments = Namespace()