Google Storage bucket level access disabled
이 페이지는 아직 한국어로 제공되지 않습니다. 번역 작업 중입니다.
현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우
언제든지 연락주시기 바랍니다.Id: bb0db090-5509-4853-a827-75ced0b3caa0
Cloud Provider: GCP
Platform: Terraform
Severity: High
Category: Insecure Configurations
Learn More
Description
Google Storage Bucket Level Access controls access to objects at the bucket level rather than allowing fine-grained permissions at the object level. When disabled, Access Control Lists (ACLs) can be used to grant permissions to individual objects, increasing the risk of accidental exposure or misconfiguration that could lead to unauthorized access to sensitive data.
Enabling uniform bucket-level access simplifies permissions management and helps ensure consistent access control across all objects in a bucket. To secure your configuration, set uniform_bucket_level_access = true in your google_storage_bucket resource as shown below:
resource "google_storage_bucket" "secure_bucket" {
name = "image-store.com"
location = "EU"
uniform_bucket_level_access = true
// other configuration...
}
Compliant Code Examples
resource "google_storage_bucket" "negative1" {
name = "image-store.com"
location = "EU"
force_destroy = true
uniform_bucket_level_access = true
website {
main_page_suffix = "index.html"
not_found_page = "404.html"
}
cors {
origin = ["http://image-store.com"]
method = ["GET", "HEAD", "PUT", "POST", "DELETE"]
response_header = ["*"]
max_age_seconds = 3600
}
}
Non-Compliant Code Examples
resource "google_storage_bucket" "positive1" {
name = "image-store.com"
location = "EU"
force_destroy = true
uniform_bucket_level_access = false
website {
main_page_suffix = "index.html"
not_found_page = "404.html"
}
cors {
origin = ["http://image-store.com"]
method = ["GET", "HEAD", "PUT", "POST", "DELETE"]
response_header = ["*"]
max_age_seconds = 3600
}
}
resource "google_storage_bucket" "positive2" {
name = "image-store.com"
location = "EU"
force_destroy = true
website {
main_page_suffix = "index.html"
not_found_page = "404.html"
}
cors {
origin = ["http://image-store.com"]
method = ["GET", "HEAD", "PUT", "POST", "DELETE"]
response_header = ["*"]
max_age_seconds = 3600
}
}