Enable Cloud Audit logging for Cloud Storage buckets Affecting Cloud Storage service in Google


0.0
medium
0
10
    Severity Framework Snyk CCSS
    Rule category Logging / Audit

Is your enviroment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
    Frameworks
  • Snyk ID SNYK-CC-00723
  • credit Snyk Research Team

Description

Failure to enable Cloud Audit logging for Cloud Storage buckets increases the risk of unauthorized access, data breaches, and compliance violations. Cloud Audit logging provides detailed logs of all activity within the bucket, including object-level operations, access attempts, and changes to bucket permissions. Enabling Cloud Audit logging ensures visibility into potential security incidents, aids in forensic investigations, and helps meet regulatory requirements. It is recommended to configure Cloud Audit logging for Cloud Storage buckets to enhance security and maintain compliance.

How to fix?

Set the log_type attribute to the values DATA_READ, DATA_WRITE, ADMIN_READ and service attribute to storage.googleapis.com or allServices.

Example Configuration


resource "google_project_iam_audit_config" "allowed1" {
  project = "test-project"  
  service = "storage.googleapis.com"
  audit_log_config {
    log_type = "ADMIN_READ"
  }
  audit_log_config {
    log_type = "DATA_READ"
  }
  audit_log_config {
    log_type = "DATA_WRITE"
  }
}