File tree Expand file tree Collapse file tree 13 files changed +47
-0
lines changed
aws_sra_examples/terraform
register_delegated_administrator/register_admin
security_hub/configuration Expand file tree Collapse file tree 13 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 44# #######################################################################
55
66resource "aws_s3_bucket" "sra_state_bucket" {
7+ # checkov:skip=CKV2_AWS_61: Ensure that an S3 bucket has a lifecycle configuration
8+ # checkov:skip=CKV_AWS_18: Ensure the S3 bucket has access logging enabled
9+ # checkov:skip=CKV2_AWS_62: Ensure S3 buckets should have event notifications enabled
10+ # checkov:skip=CKV_AWS_144: Ensure that S3 bucket has cross-region replication enabled
11+
712 bucket = " ${ var . sra_state_bucket_prefix } -${ data . aws_region . current . name } -${ data . aws_caller_identity . current . account_id } "
813 force_destroy = true
914
@@ -31,6 +36,7 @@ resource "aws_s3_bucket_versioning" "sra_state_bucket_versioning" {
3136}
3237
3338resource "aws_s3_bucket_ownership_controls" "sra_state_bucket_ownership_control" {
39+ # checkov:skip=CKV2_AWS_65: Ensure access control lists for S3 buckets are disabled
3440 bucket = aws_s3_bucket. sra_state_bucket . id
3541 rule {
3642 object_ownership = " BucketOwnerPreferred"
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ resource "aws_kms_key" "sra_secrets_key" {
1212data "aws_iam_policy_document" "sra_secrets_key_policy" {
1313 # checkov:skip=CKV_AWS_109: Ensure IAM policies does not allow permissions management without constraints
1414 # checkov:skip=CKV_AWS_111: Ensure IAM policies does not allow write access without constraints
15+ # checkov:skip=CKV_AWS_356: Ensure no IAM policies documents allow "*" as a statement's resource for restrictable actions
16+
1517 statement {
1618 sid = " Enable IAM User Permissions"
1719 effect = " Allow"
Original file line number Diff line number Diff line change @@ -136,6 +136,8 @@ data "aws_iam_policy_document" "cloudwatch_policy" {
136136}
137137
138138data "aws_iam_policy_document" "management_account_parameters_lambda_ssm_policy" {
139+ # checkov:skip=CKV_AWS_356: Ensure no IAM policies documents allow "*" as a statement's resource for restrictable actions
140+
139141 statement {
140142 sid = " STSOrganizationRead"
141143 effect = " Allow"
Original file line number Diff line number Diff line change @@ -95,6 +95,8 @@ resource "aws_kms_alias" "organization_cloudtrail_key_alias" {
9595}
9696
9797resource "aws_secretsmanager_secret" "organization_cloudtrail_key_secret" {
98+ # checkov:skip=CKV_AWS_149: Ensure that Secrets Manager secret is encrypted using KMS CMK
99+ # checkov:skip=CKV2_AWS_57: Ensure Secrets Manager secrets should have automatic rotation enabled
98100 count = var. secrets_key_alias_arn != " " ? 1 : 0
99101
100102 name = " sra/cloudtrail-org-key-arn"
Original file line number Diff line number Diff line change @@ -111,6 +111,8 @@ resource "aws_iam_role_policy" "cloudtrail_log_group_policy" {
111111}
112112
113113resource "aws_iam_role_policy" "cloudtrail_policy" {
114+ # checkov:skip=CKV_AWS_290: Ensure IAM policies does not allow write access without constraints
115+
114116 name = " sra-cloudtrail-org-policy-cloudtrail"
115117 role = aws_iam_role. cloudtrail_lambda_role . id
116118
Original file line number Diff line number Diff line change 33# SPDX-License-Identifier: MIT-0
44# #######################################################################
55resource "aws_s3_bucket" "org_trail_bucket" {
6+ # checkov:skip=CKV2_AWS_61: Ensure that an S3 bucket has a lifecycle configuration
7+ # checkov:skip=CKV_AWS_18: Ensure the S3 bucket has access logging enabled
8+ # checkov:skip=CKV2_AWS_62: Ensure S3 buckets should have event notifications enabled
9+ # checkov:skip=CKV_AWS_144: Ensure that S3 bucket has cross-region replication enabled
610 bucket = " ${ var . bucket_name_prefix } -${ data . aws_caller_identity . current . account_id } -${ data . aws_region . current . name } "
711
812 tags = {
@@ -41,6 +45,7 @@ resource "aws_s3_bucket_public_access_block" "this" {
4145}
4246
4347resource "aws_s3_bucket_ownership_controls" "this" {
48+ # checkov:skip=CKV2_AWS_65: Ensure access control lists for S3 buckets are disabled
4449 bucket = aws_s3_bucket. org_trail_bucket . id
4550
4651 rule {
@@ -138,6 +143,8 @@ resource "aws_s3_bucket_policy" "org_trail_bucket_policy" {
138143
139144resource "aws_secretsmanager_secret" "org_trail_s3_bucket_secret" {
140145 # checkov:skip=CKV_AWS_149: Ensure that Secrets Manager secret is encrypted using KMS CMK
146+ # checkov:skip=CKV2_AWS_57: Ensure Secrets Manager secrets should have automatic rotation enabled
147+
141148 count = var. sra_secrets_key_alias_arn != " " ? 1 : 0
142149
143150 name = " sra/cloudtrail_org_s3_bucket"
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ data "aws_iam_policy_document" "guardduty_policy" {
9090
9191data "aws_iam_policy_document" "iam_policy" {
9292 # checkov:skip=CKV_AWS_111: Ensure IAM policies does not allow write access without constraints
93+ # checkov:skip=CKV_AWS_356: Ensure no IAM policies documents allow "*" as a statement's resource for restrictable actions
9394 statement {
9495 sid = " AllowReadIamActions"
9596 effect = " Allow"
Original file line number Diff line number Diff line change 33# SPDX-License-Identifier: MIT-0
44# #######################################################################
55data "aws_iam_policy_document" "kms_policy" {
6+ # checkov:skip=CKV_AWS_111: Ensure IAM policies does not allow write access without constraints
7+ # checkov:skip=CKV_AWS_356: Ensure no IAM policies documents allow "*" as a statement's resource for restrictable actions
8+ # checkov:skip=CKV_AWS_109: Ensure IAM policies does not allow permissions management / resource exposure without constraints
9+
610 statement {
711 sid = " EnableIAMUserPermissions"
812 effect = " Allow"
@@ -88,6 +92,8 @@ resource "aws_kms_alias" "guardduty_delivery_key_alias" {
8892}
8993
9094resource "aws_secretsmanager_secret" "guardduty_delivery_key_secret" {
95+ # checkov:skip=CKV2_AWS_57: Ensure Secrets Manager secrets should have automatic rotation enabled
96+
9197 count = var. create_secret ? 1 : 0
9298 name = " sra/guardduty_org_delivery_key_arn"
9399 description = " GuardDuty Delivery KMS Key ARN"
Original file line number Diff line number Diff line change 44# #######################################################################
55
66resource "aws_s3_bucket" "guardduty_delivery_bucket" {
7+ # checkov:skip=CKV2_AWS_61: Ensure that an S3 bucket has a lifecycle configuration
8+ # checkov:skip=CKV_AWS_18: Ensure the S3 bucket has access logging enabled
9+ # checkov:skip=CKV2_AWS_62: Ensure S3 buckets should have event notifications enabled
10+ # checkov:skip=CKV_AWS_144: Ensure that S3 bucket has cross-region replication enabled
711 bucket = " ${ var . guardduty_org_delivery_bucket_prefix } -${ data . aws_caller_identity . current . account_id } -${ data . aws_region . current . name } "
812 force_destroy = true
913
@@ -31,6 +35,7 @@ resource "aws_s3_bucket_versioning" "guardduty_versioning" {
3135}
3236
3337resource "aws_s3_bucket_ownership_controls" "guardduty_ownership_control" {
38+ # checkov:skip=CKV2_AWS_65: Ensure access control lists for S3 buckets are disabled
3439 bucket = aws_s3_bucket. guardduty_delivery_bucket . id
3540 rule {
3641 object_ownership = " BucketOwnerPreferred"
Original file line number Diff line number Diff line change @@ -91,6 +91,9 @@ resource "aws_kms_alias" "macie_delivery_key_alias" {
9191}
9292
9393resource "aws_secretsmanager_secret" "macie_delivery_key_secret" {
94+ # checkov:skip=CKV_AWS_149: Ensure that Secrets Manager secret is encrypted using KMS CMK
95+ # checkov:skip=CKV2_AWS_57: Ensure Secrets Manager secrets should have automatic rotation enabled
96+
9497 count = var. secrets_key_alias_arn != " " ? 1 : 0
9598 name = " sra/macie_org_delivery_key_arn"
9699 description = " Macie Delivery KMS Key ARN"
You can’t perform that action at this time.
0 commit comments