Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CKV2_AWS_6] False positives for s3 bucket public access blocks #6982

Open
tarfeef101 opened this issue Jan 29, 2025 · 0 comments
Open

[CKV2_AWS_6] False positives for s3 bucket public access blocks #6982

tarfeef101 opened this issue Jan 29, 2025 · 0 comments
Labels
checks Check additions or changes

Comments

@tarfeef101
Copy link
Contributor

Checkov reports false positives on the public access block check, running in the following env:

  • terraform 1.0.3
  • checkov 3.2.38
  • aws provider 5.84.0
  • running on a planfile, command is run in CI like so checkov -f plan.json --quiet --config-file /opt/checkov.yaml --external-checks-dir /opt/custom_checks --download-external-modules true --repo-root-for-plan-enrichment .
    e.g.
    • (the checkov config file just enables/disables checks, nothing that would interfere here)
module "example" {
  source           = "./example"
}

w/ module code looking like

resource "aws_s3_bucket" "example" {
  bucket = "example"
  tags   = { Name = "example" }
}

resource "aws_s3_bucket_server_side_encryption_configuration" "example" {
  bucket = aws_s3_bucket.example.id
  rule {
    apply_server_side_encryption_by_default {
      sse_algorithm = "aws:kms"
    }
    bucket_key_enabled = true
  }
}

resource "aws_s3_bucket_public_access_block" "example" {
  bucket                  = aws_s3_bucket.example.id
  block_public_acls       = true
  block_public_policy     = true
  ignore_public_acls      = true
  restrict_public_buckets = true
}
@tarfeef101 tarfeef101 added the checks Check additions or changes label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
checks Check additions or changes
Projects
None yet
Development

No branches or pull requests

1 participant