fix(gcp): store Cloud Storage bucket regions as lowercase (#9567)

This commit is contained in:
lydiavilchez
2025-12-16 17:34:01 +01:00
committed by GitHub
parent c1e1fb00c6
commit c83374d4ed
3 changed files with 4 additions and 3 deletions

View File

@@ -27,6 +27,7 @@ All notable changes to the **Prowler SDK** are documented in this file.
### Fixed ### Fixed
- Fix typo `trustboundaries` category to `trust-boundaries` [(#9536)](https://github.com/prowler-cloud/prowler/pull/9536) - 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 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)
--- ---

View File

@@ -77,7 +77,7 @@ class CloudStorage(GCPService):
Bucket( Bucket(
name=bucket["name"], name=bucket["name"],
id=bucket["id"], id=bucket["id"],
region=bucket["location"], region=bucket["location"].lower(),
uniform_bucket_level_access=bucket["iamConfiguration"][ uniform_bucket_level_access=bucket["iamConfiguration"][
"uniformBucketLevelAccess" "uniformBucketLevelAccess"
]["enabled"], ]["enabled"],

View File

@@ -35,7 +35,7 @@ class TestCloudStorageService:
assert len(cloudstorage_client.buckets) == 2 assert len(cloudstorage_client.buckets) == 2
assert cloudstorage_client.buckets[0].name == "bucket1" assert cloudstorage_client.buckets[0].name == "bucket1"
assert cloudstorage_client.buckets[0].id.__class__.__name__ == "str" 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].uniform_bucket_level_access
assert cloudstorage_client.buckets[0].public assert cloudstorage_client.buckets[0].public
@@ -53,7 +53,7 @@ class TestCloudStorageService:
assert cloudstorage_client.buckets[1].name == "bucket2" assert cloudstorage_client.buckets[1].name == "bucket2"
assert cloudstorage_client.buckets[1].id.__class__.__name__ == "str" 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].uniform_bucket_level_access
assert not cloudstorage_client.buckets[1].public assert not cloudstorage_client.buckets[1].public
assert cloudstorage_client.buckets[1].retention_policy is None assert cloudstorage_client.buckets[1].retention_policy is None