-
-
Notifications
You must be signed in to change notification settings - Fork 839
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
Use object lock enabled #148
Conversation
/test all |
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.
Change details
-
Error ID Change Path Resource BC_AWS_NETWORKING_52 Added /main.tf aws_s3_bucket.default
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.
Looks good to me, but I'll leave it open in case you want to get another set of eyes since this module has had some recent flux 👍
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.
This looks good, but before approving it, I want some extra testing, due to this note which says changing the value "Forces new resource". We want to be extra careful that we are not causing a change that could end up having Terraform destroy and replace an existing S3 bucket.
Tested with a config where object_lock_configuration = {
mode = var.object_lock_mode_archive
days = var.object_lock_days_archive
years = null
} This branch fixes perma drift. Also tested changing object_lock_configuration = null This did end up planning to delete the bucket. however this is if you change configuration. For those who have it configured this fixes consistency bugs, for those who don't it won't be a problem. It only becomes a problem when attempting to switch. from enabled -> disabled. |
This Pull Request has been updated, so we're dismissing all reviews.
/test all |
object_lock_enabled = "Enabled" | ||
} | ||
} | ||
object_lock_enabled = local.object_lock_enabled |
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.default | 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.
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.
Change details
-
Error ID Change Path Resource BC_AWS_NETWORKING_52 Added /main.tf aws_s3_bucket.default
object_lock_enabled = "Enabled" | ||
} | ||
} | ||
object_lock_enabled = local.object_lock_enabled |
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.default | 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.
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.
Change details
-
Error ID Change Path Resource BC_AWS_NETWORKING_52 Added /main.tf aws_s3_bucket.default
/test all |
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.
The BridgeCrew complaint is a mistake on BridgeCrew's part.
what
why
object_lock_configuration
forobject_lock_enabled
references
object_lock_enabled
inaws_s3_bucket
#144 (this did not useobject_lock_enabled
and only removed the dynamic)