For the complete documentation index, see llms.txt. This page is also available as Markdown.
Cortex CloudApplication Security

ElastiCache cluster is using the default subnet group misconfiguration detected in code

Rule Details

Cortex AppSec Rule ID

APPSEC_AWS_323

Category - Subcategory

Public Exposure - VPC VCN VNet

Provider

AWS

Severity

LOW

Framework

Terraform, Terraform Plan

Impact

This rule is checking to ensure that ElastiCache clusters are not using the default subnet group provided by AWS. This is a potential issue for a few reasons. First, using the default subnet group may not align with the specific security or access control requirements of your particular applications or user groups. Custom subnet groups allow you to define network traffic routing and access rules more granularly. Second, having all ElastiCache clusters in the default subnet group may lead to situations where a network issue impacts all clusters instead of a single one. By having separate subnet groups, you can isolate clusters and minimize the impact of any potential issues. So, this rule tries to avoid these potential issues by making sure that each ElastiCache cluster has its own dedicated subnet group.

How to Fix

Resource: aws_elasticache_cluster

  • Arguments: subnet_group_name

To fix this issue, you need to create a custom subnet group instead of using the default one, and attach it to the ElastiCache cluster. The subnet group should contain the appropriate subnets for your application. [source,go]

resource "aws_elasticache_subnet_group" "example" { name = "example" subnet_ids = [aws_subnet.example1.id, aws_subnet.example2.id] }

resource "aws_elasticache_cluster" "example" { cluster_id = "cluster-example" engine = "memcached" node_type = "cache.m4.large" num_cache_nodes = 2 parameter_group_name = "default.memcached1.4" engine_version = "1.4.24"

  • subnet_group_name = aws_elasticache_subnet_group.example.name }


Last updated

Was this helpful?