This check identifies S3 buckets that have been configured with public ACLs but are simultaneously protected by bucket-level public access block settings that override those ACLs. This configuration creates a security risk through misleading access controls, where developers might assume the bucket is public (based on ACL settings) when it’s actually restricted by the public access block. To properly secure S3 buckets, ensure consistency between your ACL settings and public access block configuration. For example, an insecure configuration might include a public ACL with restrictive public access block settings: acl = "public-read-write" block_public_acls = true ignore_public_acls = true. A more transparent configuration would align these settings: acl = "public-read-write" block_public_acls = false ignore_public_acls = false.
# Fresh-create plan-JSON regression: the access block's own bucket
# reference to a not-yet-created bucket (aws_s3_bucket.public-bucket-json.id)
# is unresolved and absent from the flattened resource entirely. See
# tf_lib.resolve_s3_bucket_key_via_meta, which reads the reference from
# _dd_tfplan_meta's configuration_expressions instead.
provider"aws"{region="us-east-1"}terraform{required_providers{aws={source="hashicorp/aws"version="~> 3.0"}}}resource"aws_s3_bucket""public-bucket-json"{bucket="bucket-fresh-create-4"acl="public-read-write"}resource"aws_s3_bucket_public_access_block""block_public_bucket_3"{bucket=aws_s3_bucket.public-bucket-json.idblock_public_acls=trueblock_public_policy=trueignore_public_acls=truerestrict_public_buckets=true}
1
2
rulesets:- Terraform / AWS # Rules to enforce / AWS.
Request a personalized demo
Get Started with Datadog
Ask AI
AI-generated responses may be inaccurate. Verify important info.