Redis Security
Cache & Session Security 2026
ACL, TLS, AUTH, Keyspace Notifications & Memory Protection
ACLTLSAUTHSentinel
Redis ACL (Access Control)
# redis.conf - ACL Configuration aclfile /etc/redis/users.acl # Or inline: user default on >strong_password ~* &* +@all # App user: Limited access user app_user on >app_pass ~app:* resetchannels -@all +@read +@write +@connection +@pubsub # Monitoring user: Read-only user monitor on >monitor_pass ~* resetchannels -@all +@read +@connection +info +slowlog # Admin: Full access but dangerous commands removed user admin on >admin_pass ~* &* -@dangerous +@all # Disable default user after setup user default off
TLS/SSL Configuration
# redis.conf - TLS port 0 # Disable plaintext tls-port 6379 tls-cert-file /etc/redis/redis.crt tls-key-file /etc/redis/redis.key tls-ca-cert-file /etc/redis/ca.crt tls-dh-params-file /etc/redis/redis.dh # Require TLS for replication tls-replication yes # Require TLS for cluster bus tls-cluster yes # Client certificate authentication (mTLS) tls-auth-clients yes # Cipher suite tls-ciphersuites TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 tls-protocols "TLSv1.3"
Security Hardening
# redis.conf - Security Settings requirepass off # Use ACL instead! # Rename dangerous commands rename-command FLUSHDB "" rename-command FLUSHALL "" rename-command CONFIG "a_config_b9f2" rename-command DEBUG "" rename-command SHUTDOWN "a_shutdown_x7k3" # Memory limits to prevent DoS maxmemory 2gb maxmemory-policy allkeys-lru # Disable THP (Transparent Huge Pages) # echo never > /sys/kernel/mm/transparent_hugepage/enabled # Keyspace notifications for audit notify-keyspace-events Ex$