From d0819323ff4ebb5e8fae619e3196fdde1c006512 Mon Sep 17 00:00:00 2001 From: Prowler Bot Date: Mon, 4 Nov 2024 14:45:03 +0100 Subject: [PATCH] chore(azure): deprecate `AzureGermanCloud` (#5564) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rubén De la Torre Vico --- docs/tutorials/azure/use-non-default-cloud.md | 1 - prowler/providers/azure/lib/arguments/arguments.py | 1 - prowler/providers/azure/lib/regions/regions.py | 6 ------ tests/lib/cli/parser_test.py | 3 --- tests/providers/azure/lib/regions/regions_test.py | 7 ------- 5 files changed, 18 deletions(-) diff --git a/docs/tutorials/azure/use-non-default-cloud.md b/docs/tutorials/azure/use-non-default-cloud.md index 50e9422433..0494efe88c 100644 --- a/docs/tutorials/azure/use-non-default-cloud.md +++ b/docs/tutorials/azure/use-non-default-cloud.md @@ -7,7 +7,6 @@ At the time of writing this documentation the available Azure Clouds from differ - AzureCloud - AzureChinaCloud - AzureUSGovernment -- AzureGermanCloud If you want to change the default one you must include the flag `--azure-region`, i.e.: diff --git a/prowler/providers/azure/lib/arguments/arguments.py b/prowler/providers/azure/lib/arguments/arguments.py index 0be2629233..a797f33c47 100644 --- a/prowler/providers/azure/lib/arguments/arguments.py +++ b/prowler/providers/azure/lib/arguments/arguments.py @@ -70,7 +70,6 @@ def validate_azure_region(region): regions_allowed = [ "AzureChinaCloud", "AzureUSGovernment", - "AzureGermanCloud", "AzureCloud", ] if region not in regions_allowed: diff --git a/prowler/providers/azure/lib/regions/regions.py b/prowler/providers/azure/lib/regions/regions.py index 4c75fcde79..6b88ab5561 100644 --- a/prowler/providers/azure/lib/regions/regions.py +++ b/prowler/providers/azure/lib/regions/regions.py @@ -2,7 +2,6 @@ from azure.identity import AzureAuthorityHosts AZURE_CHINA_CLOUD = "https://management.chinacloudapi.cn" AZURE_US_GOV_CLOUD = "https://management.usgovcloudapi.net" -AZURE_GERMAN_CLOUD = "https://management.microsoftazure.de" AZURE_GENERIC_CLOUD = "https://management.azure.com" @@ -23,10 +22,5 @@ def get_regions_config(region): "base_url": AZURE_US_GOV_CLOUD, "credential_scopes": [AZURE_US_GOV_CLOUD + "/.default"], }, - "AzureGermanCloud": { - "authority": AzureAuthorityHosts.AZURE_GERMANY, - "base_url": AZURE_GERMAN_CLOUD, - "credential_scopes": [AZURE_GERMAN_CLOUD + "/.default"], - }, } return allowed_regions[region] diff --git a/tests/lib/cli/parser_test.py b/tests/lib/cli/parser_test.py index 7d860d4ed6..ed39fa96f4 100644 --- a/tests/lib/cli/parser_test.py +++ b/tests/lib/cli/parser_test.py @@ -1140,13 +1140,11 @@ class Test_Parser: expected_regions = [ "AzureChinaCloud", "AzureUSGovernment", - "AzureGermanCloud", "AzureCloud", ] input_regions = [ "AzureChinaCloud", "AzureUSGovernment", - "AzureGermanCloud", "AzureCloud", ] for region in input_regions: @@ -1156,7 +1154,6 @@ class Test_Parser: expected_regions = [ "AzureChinaCloud", "AzureUSGovernment", - "AzureGermanCloud", "AzureCloud", ] invalid_region = "non-valid-region" diff --git a/tests/providers/azure/lib/regions/regions_test.py b/tests/providers/azure/lib/regions/regions_test.py index 8e237547fd..2f8fdd6053 100644 --- a/tests/providers/azure/lib/regions/regions_test.py +++ b/tests/providers/azure/lib/regions/regions_test.py @@ -3,7 +3,6 @@ from azure.identity import AzureAuthorityHosts from prowler.providers.azure.lib.regions.regions import ( AZURE_CHINA_CLOUD, AZURE_GENERIC_CLOUD, - AZURE_GERMAN_CLOUD, AZURE_US_GOV_CLOUD, get_regions_config, ) @@ -15,7 +14,6 @@ class Test_azure_regions: "AzureCloud", "AzureChinaCloud", "AzureUSGovernment", - "AzureGermanCloud", ] expected_output = { "AzureCloud": { @@ -33,11 +31,6 @@ class Test_azure_regions: "base_url": AZURE_US_GOV_CLOUD, "credential_scopes": [AZURE_US_GOV_CLOUD + "/.default"], }, - "AzureGermanCloud": { - "authority": AzureAuthorityHosts.AZURE_GERMANY, - "base_url": AZURE_GERMAN_CLOUD, - "credential_scopes": [AZURE_GERMAN_CLOUD + "/.default"], - }, } for region in allowed_regions: