CRITICAL
Source
Trivy
ID
AVD-DIG-0006

Spaces bucket or bucket object has public read acl set

Space bucket and bucket object permissions should be set to deny public access unless explicitly required.

Impact

Follow the appropriate remediation steps below to resolve the issue.

Apply a more restrictive ACL

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
resource "digitalocean_spaces_bucket" "good_example" {
  name   = "private_space"
  region = "nyc3"
  acl    = "private"
}

resource "digitalocean_spaces_bucket_object" "index" {
  region       = digitalocean_spaces_bucket.good_example.region
  bucket       = digitalocean_spaces_bucket.good_example.name
  key          = "index.html"
  content      = "<html><body><p>This page is empty.</p></body></html>"
  content_type = "text/html"
}