Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Allow s3 logging from aws_s3_bucket_logging #421

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pguinard-public-com
Copy link

Fixes #374

Sample from that pull request which also matches the code we have provided in tests:

Fixed behavior:

$ cat test.tf
resource "aws_s3_bucket" "bucket_new_syntax" {
  bucket = "bucket_new_syntax"
}

resource "aws_s3_bucket_logging" "bucket_new_syntax" {
  bucket = aws_s3_bucket.bucket_new_syntax.id

  target_bucket = aws_s3_bucket.logbucket.id
  target_prefix = "log/"
}

$ regula run --include $HOME/git/regula/rego/rules/tf/aws/s3/bucket_access_logging.rego --no-built-ins

No problems found. Good going.

Original behavior:

$ cat test.tf
resource "aws_s3_bucket" "bucket_new_syntax" {
  bucket = "bucket_new_syntax"
}

$ regula run --include $HOME/git/regula/rego/rules/tf/aws/s3/bucket_access_logging.rego --no-built-ins

FG_R00274: S3 bucket access logging should be enabled [Medium]
           https://docs.fugue.co/FG_R00274.html

  [1]: aws_s3_bucket.bucket_new_syntax
       in test.tf:1:1

Found one problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] The policy FG_R00274 doesn't work with the new syntax (provider aws 4.x)
1 participant