Skip to content

Commit 519403a

Browse files
author
tknguyen
committed
More checkov scans supression
1 parent 5081b2d commit 519403a

File tree

13 files changed

+47
-0
lines changed

13 files changed

+47
-0
lines changed

aws_sra_examples/terraform/common/s3/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
########################################################################
55

66
resource "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

3338
resource "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"

aws_sra_examples/terraform/common/secrets_kms/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ resource "aws_kms_key" "sra_secrets_key" {
1212
data "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"

aws_sra_examples/terraform/common/ssm_parameters/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ data "aws_iam_policy_document" "cloudwatch_policy" {
136136
}
137137

138138
data "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"

aws_sra_examples/terraform/solutions/cloudtrail_org/kms/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ resource "aws_kms_alias" "organization_cloudtrail_key_alias" {
9595
}
9696

9797
resource "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"

aws_sra_examples/terraform/solutions/cloudtrail_org/org/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ resource "aws_iam_role_policy" "cloudtrail_log_group_policy" {
111111
}
112112

113113
resource "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

aws_sra_examples/terraform/solutions/cloudtrail_org/s3/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# SPDX-License-Identifier: MIT-0
44
########################################################################
55
resource "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

4347
resource "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

139144
resource "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"

aws_sra_examples/terraform/solutions/guard_duty/configuration_role/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ data "aws_iam_policy_document" "guardduty_policy" {
9090

9191
data "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"

aws_sra_examples/terraform/solutions/guard_duty/kms_key/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# SPDX-License-Identifier: MIT-0
44
########################################################################
55
data "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

9094
resource "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"

aws_sra_examples/terraform/solutions/guard_duty/s3/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
########################################################################
55

66
resource "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

3337
resource "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"

aws_sra_examples/terraform/solutions/macie/delivery_kms_key/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ resource "aws_kms_alias" "macie_delivery_key_alias" {
9191
}
9292

9393
resource "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"

0 commit comments

Comments
 (0)