> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# terraform-storage-bucket-public

> A Terraform storage bucket or container grants anonymous public access.

## What it flags

Storage that anyone on the internet can read, declared with literal values in a `.tf` file:

* `aws_s3_bucket` or `aws_s3_bucket_acl` with the canned ACL `public-read`, `public-read-write` or `authenticated-read` (any AWS account).
* `aws_s3_bucket_public_access_block` or `aws_s3_account_public_access_block` that sets `block_public_acls`, `block_public_policy`, `ignore_public_acls` or `restrict_public_buckets` to `false`. One finding lists every setting turned off.
* `google_storage_bucket_iam_member` or `google_storage_bucket_iam_binding` granting a role to `allUsers` or `allAuthenticatedUsers`, and Google Cloud Storage access controls whose `entity` is one of those.
* `azurerm_storage_container` with `container_access_type` `blob` or `container`.

Public buckets are a common source of data leaks: object listings and files are readable without credentials. A bucket that hosts a public website is a legitimate exception; keep its contents to public assets and dismiss the finding with a reason.

Not flagged: values from variables or interpolated strings, a bucket policy document that grants `"Principal": "*"` (policies are not parsed), and `private` or other non-public ACLs.

```hcl theme={null}
resource "aws_s3_bucket_public_access_block" "assets" {
  bucket                  = aws_s3_bucket.assets.id
  block_public_acls       = true
  block_public_policy     = true
  ignore_public_acls      = true
  restrict_public_buckets = true
}
```

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "terraform-storage-bucket-public": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.