Skip to content

Create bbb.tf #15

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions bbb.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
resource "aws_s3_bucket" "example" {
bucket = "my-tf-test-bucket"
acl = "private"

tags = {
Name = "My Test Bucket"
Environment = "Dev"
}

versioning {
enabled = false
mfa_delete = false
}
}


# Server Side Encryption
resource "aws_s3_bucket_server_side_encryption_configuration" "sse_example" {
bucket = aws_s3_bucket.example.bucket

rule {
apply_server_side_encryption_by_default {
kms_master_key_id = aws_kms_key.testkey.arn
sse_algorithm = "aws:kms"
}
}
}

resource "aws_kms_key" "testkey" {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security control: Iac Misconfig Detection Terraform

Type: Customer Master Keys (Cmk) Must Have Rotation Enabled, Which Means The Attribute 'Enable Key Rotation' Must Be Set To 'True' When The Key Is Enabled.

Description: Customer Master Keys (CMK) must have rotation enabled, which means the attribute 'enable_key_rotation' must be set to 'true' when the key is enabled.

Severity: HIGH

Learn more about this issue



Jit Bot commands and options (e.g., ignore issue)

You can trigger Jit actions by commenting on this PR review:

  • #jit_ignore_fp Ignore and mark this specific single instance of finding as “False Positive”
  • #jit_ignore_accept Ignore and mark this specific single instance of finding as “Accept Risk”
  • #jit_undo_ignore Undo ignore command

description = "This is a test key that is used to encrypt bucket objects"
deletion_window_in_days = 10

tags = {
Name = "my_kms_key"
TestTag = "Value"
}

policy = <<EOF
{
"Id": "key-123",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Enable IAM User Permissions",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::111111:user/test-user"
},
"Resource": [
"arn:aws:kms:us-west-2:1111111:key/1234abcd-12ab-34cd-56ef-1234567890ab",
"arn:aws:kms:us-east-2:1111111:key/0987dcba-09fe-87dc-65ba-ab0987654321"
]
"Action": "kms:*",
}
]
}
EOF
}