Skip to content

Commit

Permalink
Add skip to checkov validations in replica bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Galeano Galeano committed Oct 18, 2023
1 parent db071c4 commit 19a2db8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bucket_replication.tf
Expand Up @@ -4,6 +4,13 @@ resource "aws_s3_bucket" "replication_bucket" {
# checkov:skip=CKV2_AWS_62:False Positive. This bucket is the replication destination
# checkov:skip=CKV_AWS_144:False Positive. This bucket is the replication destination

## Since we use the attribute 'count' to create an aws_s3_bucket, checkov has a known issue that results in
## an error even though we are using the correct configurations. (Ref https://github.com/bridgecrewio/checkov/issues/3847)
# checkov:skip=CKV2_AWS_61:Skip due to above comment
# checkov:skip=CKV_AWS_145:Skip due to above comment
# checkov:skip=CKV_AWS_21:Skip due to above comment
# checkov:skip=CKV2_AWS_6:Skip due to above comment

provider = aws.secondary
bucket = format("%s-%s-%s-%s", var.namespace, var.stage, var.name, var.bucket_replication_name)

Expand Down
2 changes: 2 additions & 0 deletions kms_encription.tf
Expand Up @@ -175,6 +175,8 @@ data "aws_iam_policy_document" "secondary" {
}

resource "aws_kms_key" "primary" {
# checkov:skip=CKV2_AWS_64:Since we use the attribute 'count' to create an aws_kms_key, checkov has a known issue that results in
## an error even though we are using the correct configurations. (Ref https://github.com/bridgecrewio/checkov/issues/3847)
count = var.create_kms_key ? 1 : 0
provider = aws.primary

Expand Down
1 change: 1 addition & 0 deletions main.tf
Expand Up @@ -29,6 +29,7 @@ resource "aws_s3_bucket_acl" "default" {
}

resource "aws_s3_bucket_ownership_controls" "default" {
# checkov:skip=CKV2_AWS_65: Skip this validation since we use ACL
bucket = aws_s3_bucket.default.id
rule {
object_ownership = "BucketOwnerPreferred"
Expand Down

0 comments on commit 19a2db8

Please sign in to comment.