Hands-on task
An ACL user just for the cache
The application needs its own Redis login with minimal privileges. Create an ACL user:
- name
app, passwordapp-secret, user enabled; - access only to keys matching
cache:*; - only the
GET,SET,DELandPINGcommands allowed —FLUSHALL,CONFIG,KEYSand everything else forbidden.
The user must survive a Redis restart: keep the ACLs in a separate file /etc/redis/users.acl, included in /etc/redis/redis.conf with the aclfile directive. Don't touch the default user.
- redis
- ACL
- ACL SETUSER
- aclfile
- ACL SAVE
- principle of least privilege