Description
For the node-based Redis OSS group shown here, AtRestEncryptionEnabled defaults to false. Set it to true at creation to protect backups and data written to disk during synchronization, backup or swap.
Potential impact
An unencrypted backup can expose cached sessions, tokens or personal data to anyone who obtains a copy.
Remediation
- Use the service-managed key or an approved customer-managed KMS key with the required permissions. Configure TLS and user authentication separately.
- For an existing group, take a backup and restore it to a new group with storage encryption enabled. Account for writes after the backup. Verify the restored data and application connections before switching to the new endpoint.
Examples
Both examples create one node. Supply a cache subnet group in your VPC and restrict security-group access. High availability and migration require separate configuration.
Before
yaml
Parameters:
CacheSubnetGroupName:
Type: String
CacheSecurityGroups:
Type: List<AWS::EC2::SecurityGroup::Id>
Resources:
ReplicationGroup:
Type: AWS::ElastiCache::ReplicationGroup
Properties:
ReplicationGroupDescription: example
AtRestEncryptionEnabled: false
Engine: redis
CacheNodeType: cache.t3.micro
NumCacheClusters: 1
CacheSubnetGroupName: !Ref CacheSubnetGroupName
SecurityGroupIds: !Ref CacheSecurityGroups
After
yaml
Parameters:
CacheSubnetGroupName:
Type: String
CacheSecurityGroups:
Type: List<AWS::EC2::SecurityGroup::Id>
Resources:
ReplicationGroup:
Type: AWS::ElastiCache::ReplicationGroup
Properties:
ReplicationGroupDescription: example
AtRestEncryptionEnabled: true
Engine: redis
CacheNodeType: cache.t3.micro
NumCacheClusters: 1
CacheSubnetGroupName: !Ref CacheSubnetGroupName
SecurityGroupIds: !Ref CacheSecurityGroups