forked from Checkmarx/kics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix(query): S3 Bucket Policy Accepts Http Requests (Checkmarx#4949)
* Added Allow true to deny_http_requests function * i had one job
- Loading branch information
1 parent
e327eee
commit 1e1654f
Showing
2 changed files
with
53 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
assets/queries/terraform/aws/s3_bucket_policy_accepts_http_requests/test/negative4.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module "s3_bucket" { | ||
source = "terraform-aws-modules/s3-bucket/aws" | ||
version = "3.7.0" | ||
|
||
bucket = "my-s3-bucket" | ||
acl = "private" | ||
|
||
versioning = { | ||
enabled = true | ||
} | ||
|
||
policy = <<EOF | ||
{ | ||
"Version": "2012-10-17", | ||
"Id": "MYBUCKETPOLICY", | ||
"Statement": [ | ||
{ | ||
"Sid": "IPAllow", | ||
"Effect": "Allow", | ||
"Principal": "*", | ||
"Action": "s3:*", | ||
"Resource": [ | ||
"aws_s3_bucket.b.arn" | ||
], | ||
"Condition": { | ||
"Bool": { | ||
"aws:SecureTransport": "true" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
EOF | ||
} |