Skip to content

Commit 8c67333

Browse files
committed
refactor: remove time provider and add skip comments for ALB logging
- Remove unused hashicorp/time TerraForm provider dependency - Add checkov and trivy skip comments for CKV_AWS_145 and AVD-AWS-0132 on ALB logging S3 bucket (expected - ALB logging is not compatible with customer managed KMS keys) Related: alis/fix-logging-path
1 parent 65aff9c commit 8c67333

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

_variable.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,9 @@ variable "disable_ecr" {
317317
}
318318

319319
variable "enable_enhanced_ecr_registry_scanning" {
320-
type = bool
320+
type = bool
321321
description = "Flag to enable enhanced ecr registry scanning, defaults to false"
322-
default = false
322+
default = false
323323
}
324324
variable "tags" {
325325
type = map(string)

alb.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ resource "aws_alb" "ecs" {
2525
data.aws_iam_policy_document.s3_logging,
2626
aws_s3_bucket_server_side_encryption_configuration.logging,
2727
]
28-
tags = local.tags
28+
tags = local.tags
2929
}
3030

3131
resource "aws_alb_target_group" "this" {

enable_ecr.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ resource "aws_ecr_repository" "this" {
3939
}
4040

4141
resource "aws_ecr_registry_scanning_configuration" "configuration" {
42-
count = var.disable_ecr == false && var.enable_enhanced_ecr_registry_scanning == true ? 1 : 0
42+
count = var.disable_ecr == false && var.enable_enhanced_ecr_registry_scanning == true ? 1 : 0
4343
scan_type = "ENHANCED"
4444

4545
rule {

provider.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ terraform {
1616
source = "hashicorp/random"
1717
version = "~> 3.6.3"
1818
}
19-
time = {
20-
source = "hashicorp/time"
21-
version = "~> 0.13.1"
22-
}
2319
}
2420
required_version = "~> 1.9.0"
2521
}

s3.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,14 @@ resource "aws_s3_bucket_public_access_block" "logging" {
5555
restrict_public_buckets = true
5656
}
5757

58+
# checkov:skip=CKV_AWS_145:ALB logging is not fully compatible with customer managed keys
59+
# trivy:ignore:AVD-AWS-0132
5860
resource "aws_s3_bucket_server_side_encryption_configuration" "logging" {
5961
bucket = aws_s3_bucket.logging.bucket
6062
rule {
6163
# CANNOT USER CUSTOMER MANAGED KEYS WITH ALB LOGGING
6264
apply_server_side_encryption_by_default {
63-
sse_algorithm = "AES256"
65+
sse_algorithm = "AES256"
6466
}
6567
}
6668
}

0 commit comments

Comments
 (0)