-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update s3.tf #43
base: master
Are you sure you want to change the base?
Update s3.tf #43
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bridgecrew has found infrastructure configuration errors in this PR ⬇️
@@ -66,6 +66,20 @@ resource "aws_s3_bucket" "data_science" { | |||
force_destroy = true | |||
} | |||
|
|||
resource "aws_s3_bucket" "data_science2" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resource "aws_s3_bucket" "data_science2" { | |
} | |
resource "aws_s3_bucket_server_side_encryption_configuration" "data_science2" { | |
bucket = aws_s3_bucket.data_science2.bucket | |
rule { | |
apply_server_side_encryption_by_default { | |
sse_algorithm = "AES256" | |
} | |
} | |
} | |
} |
Ensure data stored in the S3 bucket is securely encrypted at rest
Resource: aws_s3_bucket.data_science2 | ID: BC_AWS_S3_14
Description
SSE helps prevent unauthorized access to S3 buckets. Encrypting and decrypting data at the S3 bucket level is transparent to users when accessing data.Benchmarks
- PCI-DSS V3.2.1 3.4
- PCI-DSS V3.2 3
- NIST-800-53 AC-17, SC-2
- CIS AWS V1.3 2.1.1
- FEDRAMP (MODERATE) SC-28
@@ -66,6 +66,20 @@ resource "aws_s3_bucket" "data_science" { | |||
force_destroy = true | |||
} | |||
|
|||
resource "aws_s3_bucket" "data_science2" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resource "aws_s3_bucket" "data_science2" { | |
} | |
resource "aws_s3_bucket_server_side_encryption_configuration" "data_science2" { | |
bucket = aws_s3_bucket.data_science2.bucket | |
rule { | |
apply_server_side_encryption_by_default { | |
sse_algorithm = "aws:kms" | |
} | |
} | |
} | |
} |
Ensure S3 buckets are encrypted with KMS by default
Resource: aws_s3_bucket.data_science2 | ID: BC_AWS_GENERAL_56
Description
TBA@@ -66,6 +66,20 @@ resource "aws_s3_bucket" "data_science" { | |||
force_destroy = true | |||
} | |||
|
|||
resource "aws_s3_bucket" "data_science2" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure S3 Bucket has public access blocks
Resource: aws_s3_bucket.data_science2 | ID: BC_AWS_NETWORKING_52
How to Fix
resource "aws_s3_bucket" "bucket_good_1" {
bucket = "bucket_good"
}
resource "aws_s3_bucket_public_access_block" "access_good_1" {
bucket = aws_s3_bucket.bucket_good_1.id
block_public_acls = true
block_public_policy = true
}
Description
When you create an S3 bucket, it is good practice to set the additional resource **aws_s3_bucket_public_access_block** to ensure the bucket is never accidentally public.We recommend you ensure S3 bucket has public access blocks. If the public access block is not attached it defaults to False.
@@ -66,6 +66,20 @@ resource "aws_s3_bucket" "data_science" { | |||
force_destroy = true | |||
} | |||
|
|||
resource "aws_s3_bucket" "data_science2" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure S3 bucket has cross-region replication enabled
Resource: aws_s3_bucket.data_science2 | ID: BC_AWS_GENERAL_72
How to Fix
resource "aws_s3_bucket" "test" {
...
+ replication_configuration {
+ role = aws_iam_role.replication.arn
+ rules {
+ id = "foobar"
+ prefix = "foo"
+ status = "Enabled"
+
+ destination {
+ bucket = aws_s3_bucket.destination.arn
+ storage_class = "STANDARD"
+ }
+ }
+ }
}
Description
Cross-region replication enables automatic, asynchronous copying of objects across S3 buckets. By default, replication supports copying new S3 objects after it is enabled. It is also possible to use replication to copy existing objects and clone them to a different bucket, but in order to do so, you must contact AWS Support.@@ -66,6 +66,20 @@ resource "aws_s3_bucket" "data_science" { | |||
force_destroy = true | |||
} | |||
|
|||
resource "aws_s3_bucket" "data_science2" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure AWS resources that support tags have Tags
Resource: aws_s3_bucket.data_science2 | ID: BC_AWS_GENERAL_26
How to Fix
resource "aws_security_group" "sg" {
name = "my-sg"
...
+ tags = {
+ Environment = "dev"
+ Owner = "apps-team"
+ }
}
Description
Many different types of AWS resources support tags. Tags allow you to add metadata to a resource to help identify ownership, perform cost / billing analysis, and to enrich a resource with other valuable information, such as descriptions and environment names. While there are many ways that tags can be used, we recommend you follow a tagging practice.View AWS's recommended tagging best practices here.
No description provided.