Managing Access Control Lists

1. Creating ACL Users

ACL SETUSER alice on >strongpass ~cache:* +@read +@write -@dangerous
TokenMeaning
on/offEnable/disable user
>pass / <passAdd/remove password
#sha256-hexStore hashed password
nopassNo password required
~patternAllow keys matching pattern
&channel-patPub/Sub channel pattern
+cmd / -cmdAllow/deny command
+@categoryAllow command group

2. Listing ACL Users

CommandReturns
ACL LISTDefinition strings (rewritten)
ACL USERSUsernames only

3. Getting User Details

CommandReturns
ACL GETUSER nameFlags, passwords, key patterns, commands

4. Deleting ACL Users

CommandDescription
ACL DELUSER u1 u2 ...Remove and kick connections

5. Setting User Passwords

TokenEffect
>newpassAdd password
<oldpassRemove password
resetpassDrop all passwords
resetkeys / resetchannelsDrop key/channel ACLs
resetReset everything to default

6. Enabling and Disabling Users

CommandDescription
ACL SETUSER alice onEnable
ACL SETUSER alice offBlock new connections

7. Granting Command Permissions

SyntaxUse
+commandAllow specific command
+command|subcommandSubcommand granularity
-commandDeny
allcommandsEquivalent to +@all
nocommandsDeny all

8. Using ACL Categories and Subcommands

CategoryExamples
@readGET, HGET, ZRANGE
@writeSET, DEL, ZADD
@dangerousFLUSHALL, KEYS, CONFIG
@adminCLIENT, SHUTDOWN
@fast / @slowBy worst-case complexity
ACL CATList all categories

9. Restricting Key Patterns

TokenEffect
~patAllow read+write on matching keys
%R~patRead-only key pattern 7.0+
%W~patWrite-only key pattern
allkeysEquivalent to ~*

10. Loading ACL from File

DirectiveDescription
aclfile /etc/redis/users.aclExternal ACL definitions
ACL LOADRe-read file

11. Saving ACL Configuration

CommandDescription
ACL SAVEPersist runtime ACLs to file

12. Checking Current User

CommandReturns
ACL WHOAMICurrent authenticated user

13. Logging ACL Events

CommandDescription
ACL LOG [count|RESET]Recent denied accesses