Skip to content

Commit 3defbcd

Browse files
puchy22HugoPBrito
andauthored
chore(gcp): enhance metadata for cloudstorage service (#9640)
Co-authored-by: HugoPBrito <hugopbrit@gmail.com>
1 parent ceb4691 commit 3defbcd

File tree

11 files changed

+88
-60
lines changed

11 files changed

+88
-60
lines changed

prowler/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ All notable changes to the **Prowler SDK** are documented in this file.
2424
- Parallelize Cloudflare zone API calls with threading to improve scan performance [(#9982)](https://github.com/prowler-cloud/prowler/pull/9982)
2525
- Update GCP API Keys service metadata to new format [(#9637)](https://github.com/prowler-cloud/prowler/pull/9637)
2626
- Update GCP BigQuery service metadata to new format [(#9638)](https://github.com/prowler-cloud/prowler/pull/9638)
27+
- Update GCP Cloud Storage service metadata to new format [(#9640)](https://github.com/prowler-cloud/prowler/pull/9640)
2728

2829
### 🔐 Security
2930

prowler/providers/gcp/services/cloudstorage/cloudstorage_audit_logs_enabled/cloudstorage_audit_logs_enabled.metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"Risk": "Without Data Access audit logs, you cannot track who accessed or modified objects in your Cloud Storage buckets, making it difficult to detect unauthorized access, data exfiltration, or compliance violations.",
1414
"RelatedUrl": "",
1515
"AdditionalURLs": [
16-
"https://www.trendmicro.com/cloudoneconformity/knowledge-base/gcp/CloudStorage/enable-data-access-audit-logs.html",
16+
"https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/gcp/CloudStorage/enable-data-access-audit-logs.html",
1717
"https://cloud.google.com/storage/docs/audit-logging"
1818
],
1919
"Remediation": {

prowler/providers/gcp/services/cloudstorage/cloudstorage_bucket_lifecycle_management_enabled/cloudstorage_bucket_lifecycle_management_enabled.metadata.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
{
22
"Provider": "gcp",
33
"CheckID": "cloudstorage_bucket_lifecycle_management_enabled",
4-
"CheckTitle": "Cloud Storage buckets have lifecycle management enabled",
4+
"CheckTitle": "Cloud Storage bucket has lifecycle management enabled with at least one valid rule",
55
"CheckType": [],
66
"ServiceName": "cloudstorage",
77
"SubServiceName": "",
88
"ResourceIdTemplate": "",
9-
"Severity": "medium",
9+
"Severity": "low",
1010
"ResourceType": "storage.googleapis.com/Bucket",
1111
"ResourceGroup": "storage",
12-
"Description": "**Google Cloud Storage buckets** are evaluated for the presence of **lifecycle management** with at least one valid rule (supported action and non-empty condition) to automatically transition or delete objects and optimize storage costs.",
13-
"Risk": "Buckets without lifecycle rules can accumulate stale data, increase storage costs, and fail to meet data retention and internal compliance requirements.",
12+
"Description": "**Cloud Storage buckets** use **Object Lifecycle Management** with at least one valid rule (supported `action` and non-empty `condition`) to automatically transition storage class or delete objects.",
13+
"Risk": "Without lifecycle rules, data and object versions persist indefinitely, expanding the attack surface and hindering mandated erasure. Stale data amplifies exfiltration impact (**confidentiality**) and complicates **integrity** controls, while also driving avoidable cost and retention noncompliance.",
1414
"RelatedUrl": "",
1515
"AdditionalURLs": [
16-
"https://www.trendmicro.com/cloudoneconformity/knowledge-base/gcp/CloudStorage/enable-lifecycle-management.html",
17-
"https://cloud.google.com/storage/docs/lifecycle"
16+
"https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/gcp/CloudStorage/enable-lifecycle-management.html",
17+
"https://docs.cloud.google.com/storage/docs/managing-lifecycles",
18+
"https://docs.cloud.google.com/storage/docs/lifecycle",
19+
"https://docs.cloud.google.com/storage/docs/samples/storage-enable-bucket-lifecycle-management"
1820
],
1921
"Remediation": {
2022
"Code": {
2123
"CLI": "gcloud storage buckets update gs://<BUCKET_NAME> --lifecycle-file=<PATH_TO_JSON>",
2224
"NativeIaC": "",
23-
"Other": "1) Open Google Cloud ConsoleStorage Buckets <BUCKET_NAME>\n2) Tab 'Lifecycle'\n3) Add rule(s) to delete or transition objects (e.g., delete after 365 days; transition STANDARD→NEARLINE after 90 days)\n4) Save",
24-
"Terraform": "```hcl\n# Example: enable lifecycle to transition and delete objects\nresource \"google_storage_bucket\" \"example\" {\n name = var.bucket_name\n location = var.location\n\n # Transition STANDARD → NEARLINE after 90 days\n lifecycle_rule {\n action {\n type = \"SetStorageClass\"\n storage_class = \"NEARLINE\"\n }\n condition {\n age = 90\n matches_storage_class = [\"STANDARD\"]\n }\n }\n\n # Delete objects after 365 days\n lifecycle_rule {\n action {\n type = \"Delete\"\n }\n condition {\n age = 365\n }\n }\n}\n```"
25+
"Other": "1. In Google Cloud Console, go to Storage > Buckets and open <BUCKET_NAME>\n2. Click the Lifecycle tab\n3. Click Add a rule\n4. Action: Delete\n5. Condition: Age = 1 day\n6. Click Create/Save",
26+
"Terraform": "```hcl\nresource \"google_storage_bucket\" \"<example_resource_name>\" {\n name = \"<example_resource_name>\"\n location = \"US\"\n\n # Critical: add at least one lifecycle rule with a condition to pass the check\n lifecycle_rule {\n action { type = \"Delete\" } # Critical: defines a supported action\n condition { age = 1 } # Critical: ensures the rule has a valid condition\n }\n}\n```"
2527
},
2628
"Recommendation": {
27-
"Text": "Configure lifecycle rules to automatically delete stale objects or transition them to colder storage classes according to your organization's retention and cost-optimization policy.",
29+
"Text": "Define lifecycle policies by data classification to enforce **least data retention**. Use `Delete` for TTL/age and `SetStorageClass` for archival, with version-aware conditions like `isLive=false` or `numNewerVersions`. Test on a limited dataset, review regularly, and align with **defense in depth**.",
2830
"Url": "https://hub.prowler.com/check/cloudstorage_bucket_lifecycle_management_enabled"
2931
}
3032
},

prowler/providers/gcp/services/cloudstorage/cloudstorage_bucket_log_retention_policy_lock/cloudstorage_bucket_log_retention_policy_lock.metadata.json

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,40 @@
11
{
22
"Provider": "gcp",
33
"CheckID": "cloudstorage_bucket_log_retention_policy_lock",
4-
"CheckTitle": "Cloud Storage log bucket has a Retention Policy with Bucket Lock enabled",
4+
"CheckTitle": "Cloud Storage log sink bucket has a retention policy with Bucket Lock enabled",
55
"CheckType": [],
66
"ServiceName": "cloudstorage",
77
"SubServiceName": "",
88
"ResourceIdTemplate": "",
9-
"Severity": "medium",
9+
"Severity": "high",
1010
"ResourceType": "storage.googleapis.com/Bucket",
1111
"ResourceGroup": "storage",
12-
"Description": "**Google Cloud Storage buckets** used as **log sinks** are evaluated to ensure that a **Retention Policy** is configured and **Bucket Lock** is enabled. Enabling Bucket Lock permanently prevents the retention policy from being reduced or removed, protecting logs from modification or deletion.",
13-
"Risk": "Log sink buckets without a locked retention policy are at risk of log tampering or accidental deletion. Without Bucket Lock, an attacker or user could remove or shorten the retention policy, compromising the integrity of audit logs required for forensics and compliance investigations.",
12+
"Description": "**Cloud Storage log sink buckets** have a configured **retention period** with **Bucket Lock** applied, ensuring the retention policy cannot be shortened or removed.",
13+
"Risk": "Without a locked retention policy, exported logs can be deleted early or retention reduced, undermining log **integrity** and **availability**. An attacker or malicious insider could purge evidence to evade detection, hindering **forensics** and weakening **non-repudiation** across the environment.",
1414
"RelatedUrl": "",
1515
"AdditionalURLs": [
16-
"https://www.trendmicro.com/cloudoneconformity/knowledge-base/gcp/CloudStorage/retention-policies-with-bucket-lock.html"
16+
"https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/gcp/CloudStorage/retention-policies-with-bucket-lock.html",
17+
"https://docs.cloud.google.com/storage/docs/bucket-lock",
18+
"https://docs.cloud.google.com/storage/docs/using-bucket-lock",
19+
"https://docs.cloud.google.com/storage/docs/samples/storage-lock-retention-policy",
20+
"https://docs.cloud.google.com/logging/docs/export/configure_export_v2"
1721
],
1822
"Remediation": {
1923
"Code": {
2024
"CLI": "gcloud storage buckets lock-retention-policy gs://<LOG_BUCKET_NAME>",
2125
"NativeIaC": "",
22-
"Other": "1) Open Google Cloud ConsoleStorage Buckets → <LOG_BUCKET_NAME>\n2) Go to the **Configuration** tab\n3) Under **Retention policy**, ensure a retention duration is set\n4) Click **Lock** to enable Bucket Lock and confirm the operation",
23-
"Terraform": "```hcl\nresource \"google_storage_bucket\" \"log_bucket\" {\n name = var.log_bucket_name\n location = var.location\n\n retention_policy {\n retention_period = 31536000 # 365 days in seconds\n is_locked = true\n }\n}\n```"
26+
"Other": "1. In Google Cloud Console, go to Storage > Buckets and open the bucket used by your Logs Router sink\n2. Click the Configuration tab\n3. Under Retention policy, click Edit, set any required retention duration, and click Save\n4. Click Lock retention policy, type LOCK to confirm, and confirm to permanently lock it",
27+
"Terraform": "```hcl\nresource \"google_storage_bucket\" \"<example_resource_name>\" {\n name = \"<example_resource_name>\"\n location = \"<LOCATION>\"\n\n retention_policy {\n retention_period = 86400 # Required: enable a retention policy (1 day)\n is_locked = true # CRITICAL: locks the retention policy (Bucket Lock) to pass the check\n }\n}\n```"
2428
},
2529
"Recommendation": {
26-
"Text": "Configure a retention policy and enable Bucket Lock on all Cloud Storage buckets used as log sinks to ensure log integrity and immutability.",
30+
"Text": "Set a **retention policy** on every log sink bucket and enable **Bucket Lock**. Choose durations that meet investigative and regulatory needs. Enforce **least privilege** and **separation of duties** for bucket and logging administration, and apply **defense in depth** so no single actor can weaken log retention.",
2731
"Url": "https://hub.prowler.com/check/cloudstorage_bucket_log_retention_policy_lock"
2832
}
2933
},
30-
"Categories": [],
34+
"Categories": [
35+
"logging",
36+
"forensics-ready"
37+
],
3138
"DependsOn": [],
3239
"RelatedTo": [],
3340
"Notes": ""

prowler/providers/gcp/services/cloudstorage/cloudstorage_bucket_logging_enabled/cloudstorage_bucket_logging_enabled.metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"Risk": "Buckets without Usage and Storage Logs enabled lack visibility into access and storage activity, which increases the risk of undetected data exfiltration, misuse, or configuration errors.",
1414
"RelatedUrl": "",
1515
"AdditionalURLs": [
16-
"https://www.trendmicro.com/cloudoneconformity/knowledge-base/gcp/CloudStorage/enable-usage-and-storage-logs.html",
16+
"https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/gcp/CloudStorage/enable-usage-and-storage-logs.html",
1717
"https://cloud.google.com/storage/docs/access-logs"
1818
],
1919
"Remediation": {

prowler/providers/gcp/services/cloudstorage/cloudstorage_bucket_public_access/cloudstorage_bucket_public_access.metadata.json

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
11
{
22
"Provider": "gcp",
33
"CheckID": "cloudstorage_bucket_public_access",
4-
"CheckTitle": "Ensure That Cloud Storage Bucket Is Not Anonymously or Publicly Accessible",
4+
"CheckTitle": "Cloud Storage bucket is not publicly accessible",
55
"CheckType": [],
66
"ServiceName": "cloudstorage",
77
"SubServiceName": "",
88
"ResourceIdTemplate": "",
9-
"Severity": "high",
10-
"ResourceType": "Bucket",
9+
"Severity": "critical",
10+
"ResourceType": "storage.googleapis.com/Bucket",
1111
"ResourceGroup": "storage",
12-
"Description": "Ensure That Cloud Storage Bucket Is Not Anonymously or Publicly Accessible",
13-
"Risk": "Allowing anonymous or public access grants permissions to anyone to access bucket content. Such access might not be desired if you are storing any sensitive data. Hence, ensure that anonymous or public access to a bucket is not allowed.",
14-
"RelatedUrl": "https://www.trendmicro.com/cloudoneconformity/knowledge-base/gcp/CloudStorage/publicly-accessible-storage-buckets.html",
12+
"Description": "**Cloud Storage buckets** are assessed for **anonymous or public access** by detecting permissions granted to broad principals like `allUsers` or `allAuthenticatedUsers` that make bucket data reachable without authentication.",
13+
"Risk": "**Public buckets** undermine **confidentiality** and **integrity**. Anyone can list or download objects; if write access exists, content can be overwritten or deleted. Abuse enables hotlinking and malware hosting, impacting **availability** and driving unexpected egress costs.",
14+
"RelatedUrl": "",
15+
"AdditionalURLs": [
16+
"https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/gcp/CloudStorage/publicly-accessible-storage-buckets.html",
17+
"https://docs.cloud.google.com/storage/docs/public-access-prevention",
18+
"https://docs.cloud.google.com/storage/docs/access-control/iam",
19+
"https://docs.cloud.google.com/storage/docs/access-control/iam-reference",
20+
"https://docs.cloud.google.com/storage/docs/using-uniform-bucket-level-access"
21+
],
1522
"Remediation": {
1623
"Code": {
17-
"CLI": "",
24+
"CLI": "gcloud storage buckets update gs://<example_resource_name> --public-access-prevention enforced",
1825
"NativeIaC": "",
19-
"Other": "https://docs.prowler.com/checks/gcp/google-cloud-public-policies/bc_gcp_public_1",
20-
"Terraform": "https://docs.prowler.com/checks/gcp/google-cloud-public-policies/bc_gcp_public_1#terraform"
26+
"Other": "1. In Google Cloud Console, go to Storage > Buckets and open <example_resource_name>\n2. Click the Permissions tab\n3. Set Public access prevention to Enforced\n4. Click Save",
27+
"Terraform": "```hcl\nresource \"google_storage_bucket\" \"<example_resource_name>\" {\n name = \"<example_resource_name>\"\n location = \"<LOCATION>\"\n\n public_access_prevention = \"enforced\" # Critical: blocks allUsers/allAuthenticatedUsers, making the bucket not publicly accessible\n}\n```"
2128
},
2229
"Recommendation": {
23-
"Text": "It is recommended that IAM policy on Cloud Storage bucket does not allows anonymous or public access.",
24-
"Url": "https://cloud.google.com/storage/docs/access-control/iam-reference"
30+
"Text": "Adopt **least privilege**: remove `allUsers`/`allAuthenticatedUsers` and grant only required identities. Enforce **Public Access Prevention** and use uniform bucket-level access. *If external sharing is needed*, issue **signed URLs** or use an authenticated proxy/CDN, and review permissions regularly.",
31+
"Url": "https://hub.prowler.com/check/cloudstorage_bucket_public_access"
2532
}
2633
},
2734
"Categories": [

prowler/providers/gcp/services/cloudstorage/cloudstorage_bucket_soft_delete_enabled/cloudstorage_bucket_soft_delete_enabled.metadata.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
{
22
"Provider": "gcp",
33
"CheckID": "cloudstorage_bucket_soft_delete_enabled",
4-
"CheckTitle": "Cloud Storage buckets have Soft Delete enabled",
4+
"CheckTitle": "Cloud Storage bucket has Soft Delete enabled",
55
"CheckType": [],
66
"ServiceName": "cloudstorage",
77
"SubServiceName": "",
88
"ResourceIdTemplate": "",
99
"Severity": "medium",
1010
"ResourceType": "storage.googleapis.com/Bucket",
1111
"ResourceGroup": "storage",
12-
"Description": "**Google Cloud Storage buckets** are evaluated to ensure that **Soft Delete** is enabled. Soft Delete helps protect data from accidental or malicious deletion by retaining deleted objects for a specified duration, allowing recovery within that retention window.",
13-
"Risk": "Buckets without Soft Delete enabled are at higher risk of irreversible data loss caused by accidental or unauthorized deletions, since deleted objects cannot be recovered once removed.",
12+
"Description": "**Google Cloud Storage buckets** are assessed for **Soft Delete** being enabled with a non-zero retention window, meaning deleted objects are temporarily preserved and can be restored until the window expires.",
13+
"Risk": "**No Soft Delete** makes object deletions **immediate and irreversible**, undermining data **availability** and **integrity**. Accidental removal, compromised credentials, wiper malware, or misconfigured lifecycle rules can erase datasets with no recovery path, breaking RPO/RTO and legal retention expectations.",
1414
"RelatedUrl": "",
1515
"AdditionalURLs": [
16-
"https://cloud.google.com/storage/docs/soft-delete",
17-
"https://cloud.google.com/blog/products/storage-data-transfer/understanding-cloud-storages-new-soft-delete-feature"
16+
"https://docs.cloud.google.com/storage/docs/soft-delete",
17+
"https://docs.cloud.google.com/storage/docs/use-soft-delete"
1818
],
1919
"Remediation": {
2020
"Code": {
21-
"CLI": "gcloud storage buckets update gs://<BUCKET_NAME> --soft-delete-retention-duration=<SECONDS>",
21+
"CLI": "gcloud storage buckets update gs://<BUCKET_NAME> --soft-delete-duration=<SECONDS>",
2222
"NativeIaC": "",
23-
"Other": "1) Open Google Cloud ConsoleStorage Buckets <BUCKET_NAME>\n2) Tab 'Configuration'\n3) Under 'Soft Delete', click 'Enable Soft Delete'\n4) Set the desired retention duration and save changes",
24-
"Terraform": "```hcl\n# Example: enable Soft Delete on a Cloud Storage bucket\nresource \"google_storage_bucket\" \"example\" {\n name = var.bucket_name\n location = var.location\n\n soft_delete_policy {\n retention_duration_seconds = 604800 # 7 days\n }\n}\n```"
23+
"Other": "1. In Google Cloud Console, go to Storage > Buckets and open <BUCKET_NAME>\n2. Click the Configuration tab\n3. In the Soft Delete section, click Enable Soft Delete\n4. Set a retention duration > 0 and click Save",
24+
"Terraform": "```hcl\nresource \"google_storage_bucket\" \"<example_resource_name>\" {\n name = \"<example_resource_id>\"\n location = \"<LOCATION>\"\n\n soft_delete_policy {\n retention_duration_seconds = 604800 # Critical: >0 enables Soft Delete (7 days)\n }\n}\n```"
2525
},
2626
"Recommendation": {
27-
"Text": "Enable Soft Delete on Cloud Storage buckets to retain deleted objects for a defined period, improving data recoverability and resilience against accidental or malicious deletions.",
27+
"Text": "Enable **Soft Delete** with a retention window aligned to your RPO/RTO. Apply **least privilege** for delete/undelete actions and use **defense in depth** with object versioning and retention policies. Monitor deletion events and regularly test restore procedures to ensure recoverability.",
2828
"Url": "https://hub.prowler.com/check/cloudstorage_bucket_soft_delete_enabled"
2929
}
3030
},

prowler/providers/gcp/services/cloudstorage/cloudstorage_bucket_sufficient_retention_period/cloudstorage_bucket_sufficient_retention_period.metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"Risk": "Insufficient or missing retention allows premature deletion or modification of objects, weakening data recovery and compliance with retention requirements.",
1414
"RelatedUrl": "",
1515
"AdditionalURLs": [
16-
"https://www.trendmicro.com/cloudoneconformity/knowledge-base/gcp/CloudStorage/sufficient-retention-period.html"
16+
"https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/gcp/CloudStorage/sufficient-retention-period.html"
1717
],
1818
"Remediation": {
1919
"Code": {

0 commit comments

Comments
 (0)