설명
ElastiCache 복제 그룹에 TLS를 켜서 클라이언트 요청과 캐시 노드 간 통신을 암호화하세요. 클라이언트 인증과 저장 데이터 암호화는 별도로 설정하세요.
잠재적 영향
TLS가 없으면 통신 경로에서 캐시 요청과 응답을 읽거나 변경할 수 있습니다. 세션 데이터도 노출될 수 있습니다.
해결 방법
transit_encryption_enabled = true를 설정하세요. 클라이언트는 TLS로 연결하고 서버 인증서를 검증하도록 구성하세요.- 기존 그룹에서 TLS를 켜려면 Valkey 7.2 이상 또는 Redis OSS 7 이상이 필요합니다. 이전 버전은 먼저 업그레이드하세요. 전환할 때는
transit_encryption_mode를preferred로 설정하고 모든 클라이언트를 TLS로 옮기세요. 이후required로 바꾸고 평문 연결이 거부되는지 확인하세요.
예시
이 예시는 노드 두 개를 사용합니다. 해당 리전에서 지원하는 엔진과 노드 유형, VPC의 캐시 서브넷 그룹과 적절한 보안 그룹을 지정하세요.
변경 전
hcl
resource "aws_elasticache_replication_group" "example" {
automatic_failover_enabled = true
preferred_cache_cluster_azs = ["us-west-2a", "us-west-2b"]
replication_group_id = "tf-rep-group-1"
description = "test description"
node_type = "cache.m4.large"
num_cache_clusters = 2
port = 6379
}
첫 번째 예시는 전송 암호화 설정을 생략합니다. 배포된 그룹에서 TLS 사용 여부를 확인하세요.
변경 후
hcl
resource "aws_elasticache_replication_group" "example" {
automatic_failover_enabled = true
preferred_cache_cluster_azs = ["us-west-2a", "us-west-2b"]
replication_group_id = "tf-rep-group-1"
description = "test description"
node_type = "cache.m4.large"
num_cache_clusters = 2
port = 6379
transit_encryption_enabled = true
}
두 번째 예시는 복제 그룹의 전송 암호화를 켭니다. 클라이언트의 TLS와 전환 모드는 별도로 설정하세요.