Redis ACL rules for per-user command and key restrictions, TLS configuration for in-transit encryption, bind address and protected mode, requirepass and its limitations, and the most common Redis security misconfigurations.
P-12 — Security: ACLs, TLS, and Network Hardening
Who this module is for: You have a Redis instance in production but its security posture is "it's on a private network, nobody can reach it." That is not enough. Redis has had critical vulnerabilities exploited via misconfigured network access. This module covers the full security model: ACLs, TLS, bind configuration, and the most common Redis security mistakes that lead to data breaches and server compromise.
The Security Threat Model
Redis was designed to be deployed on trusted networks — not exposed to the internet. Its original security model was simple: strong network perimeter, single shared password. As Redis has moved into cloud environments and microservices architectures, the threat model has evolved:
- Unauthenticated access — Redis exposed publicly or on a poorly segmented internal network
- Overprivileged clients — a compromised microservice can run
FLUSHALLorCONFIG SET dir - In-transit data exposure — traffic between app and Redis is unencrypted and interceptable
- Lateral movement — a compromised Redis instance can be used to write files to disk (via
CONFIG SET dir+CONFIG SET dbfilename+BGSAVE), achieving code execution on the server
A correctly secured Redis deployment mitigates all four.
Network Hardening
Bind to Specific Addresses
By default in Redis 3.2+, Redis binds to 127.0.0.1 only — not publicly accessible. Explicitly configure the bind addresses:
Protected Mode
protected-mode yes → default
With protected-mode yes, if Redis is not bound to a specific address and has no authentication configured, it rejects all connections from non-loopback addresses. This is a safety net against accidentally exposing an unauthenticated Redis to the network.
Firewall Rules
At the infrastructure level, restrict Redis port (6379) to only your application servers:
On cloud providers, use security groups (AWS), firewall rules (GCP), or network security groups (Azure) to achieve the same.
Rename or Disable Dangerous Commands
Commands like FLUSHALL, FLUSHDB, CONFIG, DEBUG, SHUTDOWN, and SLAVEOF can cause catastrophic damage if abused. You can rename them to unpredictable strings or disable them entirely:
Limitation: rename-command applies to all clients. With ACLs (below), you can restrict commands per user more granularly.
Authentication: requirepass
requirepass your-strong-password-here
Or at runtime:
CONFIG SET requirepass "your-strong-password-here"
With requirepass set, clients must authenticate before issuing commands:
AUTH your-strong-password-here
In ioredis:
Limitations of requirepass:
- It is a single shared password for all clients
- There is no per-user access control
- A compromised password gives full access to all commands
- Use ACLs for multi-user or fine-grained access control
ACLs: Access Control Lists
Introduced in Redis 6.0, ACLs let you define per-user command and key restrictions. Each user has a username, password, a set of allowed commands, and a set of allowed key patterns.
Viewing the Default User
The default user has full access (all commands, all keys) when requirepass is not set. With ACLs, you should disable or restrict the default user.
Sign in to keep reading
The rest of this module is free — sign in with Google to unlock it and track your progress.
Sign in & RegisterDiscussion
0Join the discussion