From c83374d4ed3d224453618c8295239077b7f26fbe Mon Sep 17 00:00:00 2001 From: lydiavilchez <114735608+lydiavilchez@users.noreply.github.com> Date: Tue, 16 Dec 2025 17:34:01 +0100 Subject: [PATCH] fix(gcp): store Cloud Storage bucket regions as lowercase (#9567) --- prowler/CHANGELOG.md | 1 + .../gcp/services/cloudstorage/cloudstorage_service.py | 2 +- .../gcp/services/cloudstorage/cloudstorage_service_test.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/prowler/CHANGELOG.md b/prowler/CHANGELOG.md index 9a63ea351b..84409fa90b 100644 --- a/prowler/CHANGELOG.md +++ b/prowler/CHANGELOG.md @@ -27,6 +27,7 @@ All notable changes to the **Prowler SDK** are documented in this file. ### Fixed - Fix typo `trustboundaries` category to `trust-boundaries` [(#9536)](https://github.com/prowler-cloud/prowler/pull/9536) - Store MongoDB Atlas provider regions as lowercase [(#9554)](https://github.com/prowler-cloud/prowler/pull/9554) +- Store GCP Cloud Storage bucket regions as lowercase [(#9567)](https://github.com/prowler-cloud/prowler/pull/9567) --- diff --git a/prowler/providers/gcp/services/cloudstorage/cloudstorage_service.py b/prowler/providers/gcp/services/cloudstorage/cloudstorage_service.py index 1a67f7dd7e..8ef005b68d 100644 --- a/prowler/providers/gcp/services/cloudstorage/cloudstorage_service.py +++ b/prowler/providers/gcp/services/cloudstorage/cloudstorage_service.py @@ -77,7 +77,7 @@ class CloudStorage(GCPService): Bucket( name=bucket["name"], id=bucket["id"], - region=bucket["location"], + region=bucket["location"].lower(), uniform_bucket_level_access=bucket["iamConfiguration"][ "uniformBucketLevelAccess" ]["enabled"], diff --git a/tests/providers/gcp/services/cloudstorage/cloudstorage_service_test.py b/tests/providers/gcp/services/cloudstorage/cloudstorage_service_test.py index 0008265049..e28b71a73e 100644 --- a/tests/providers/gcp/services/cloudstorage/cloudstorage_service_test.py +++ b/tests/providers/gcp/services/cloudstorage/cloudstorage_service_test.py @@ -35,7 +35,7 @@ class TestCloudStorageService: assert len(cloudstorage_client.buckets) == 2 assert cloudstorage_client.buckets[0].name == "bucket1" assert cloudstorage_client.buckets[0].id.__class__.__name__ == "str" - assert cloudstorage_client.buckets[0].region == "US" + assert cloudstorage_client.buckets[0].region == "us" assert cloudstorage_client.buckets[0].uniform_bucket_level_access assert cloudstorage_client.buckets[0].public @@ -53,7 +53,7 @@ class TestCloudStorageService: assert cloudstorage_client.buckets[1].name == "bucket2" assert cloudstorage_client.buckets[1].id.__class__.__name__ == "str" - assert cloudstorage_client.buckets[1].region == "EU" + assert cloudstorage_client.buckets[1].region == "eu" assert not cloudstorage_client.buckets[1].uniform_bucket_level_access assert not cloudstorage_client.buckets[1].public assert cloudstorage_client.buckets[1].retention_policy is None