ACL stands for Access Control List. It is a way to manage user permissions in Redis.
Click to reveal answer
beginner
How do you create a new user with specific permissions in Redis ACL?
Use the command ACL SETUSER username on >password ~pattern +command to create a user, enable it, set a password, define key patterns, and allow commands.
Click to reveal answer
intermediate
What does the ~pattern part do in Redis ACL user creation?
It defines which keys the user can access. For example, ~cache:* allows access only to keys starting with 'cache:'.
Click to reveal answer
beginner
How can you check the permissions of a Redis user?
Use the command ACL GETUSER username to see the user's enabled status, passwords, key patterns, and allowed commands.
Click to reveal answer
beginner
What is the purpose of the +command in Redis ACL user settings?
It allows the user to run specific commands. For example, +get lets the user run the GET command.
Click to reveal answer
Which Redis command is used to create or modify a user in the ACL system?
AACL CREATEUSER
BACL SETUSER
CUSER ADD
DPERMISSION SET
✗ Incorrect
The correct command to create or modify a user is ACL SETUSER.
In Redis ACL, what does the on keyword do when setting a user?
AEnables the user
BLocks the user
CDeletes the user
DDisables the user
✗ Incorrect
The on keyword enables the user so they can connect.
How do you restrict a Redis user to only access keys starting with 'app:'?
A-app:*
B+app:*
Capp:*
D~app:*
✗ Incorrect
The ~app:* pattern restricts key access to keys starting with 'app:'.
Which symbol is used to allow a specific command for a Redis ACL user?
A+
B-
C~
D#
✗ Incorrect
The plus sign + is used to allow commands, e.g., +get.
What command shows the details of a Redis ACL user?
AUSER INFO
BACL LISTUSER
CACL GETUSER
DACL SHOWUSER
✗ Incorrect
Use ACL GETUSER username to see user details.
Explain how to create a Redis ACL user with password, key access limited to 'cache:*', and permission to run GET and SET commands.
Think about the syntax: ACL SETUSER username on >password ~pattern +command
You got /5 concepts.
Describe how Redis ACL helps improve security in a multi-user environment.
Focus on restricting access and permissions.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of Redis ACL (Access Control List)?
easy
A. To speed up Redis database queries
B. To control which users can perform specific commands and access keys
C. To backup Redis data automatically
D. To monitor Redis server performance
Solution
Step 1: Understand ACL purpose
ACL in Redis is designed to manage user permissions, controlling what commands and keys users can access.
Step 2: Compare options
Options B, C, and D describe unrelated Redis features like performance and backup, not ACL.
Final Answer:
To control which users can perform specific commands and access keys -> Option B
Quick Check:
ACL controls permissions = A [OK]
Hint: ACL is about permissions, not performance or backups [OK]
Common Mistakes:
Confusing ACL with performance tuning
Thinking ACL manages backups
Assuming ACL monitors server stats
2. Which of the following is the correct Redis command to create or update a user with specific permissions?
easy
A. ACL CREATEUSER username on >password ~keys +commands
B. ACL UPDATEUSER username on >password ~keys +commands
C. ACL ADDUSER username on >password ~keys +commands
D. ACL SETUSER username on >password ~keys +commands
Solution
Step 1: Recall Redis ACL command syntax
The correct command to create or update a user is ACL SETUSER followed by username and permissions.
Step 2: Check options
Only ACL SETUSER username on >password ~keys +commands uses ACL SETUSER. Others use invalid commands like CREATEUSER, ADDUSER, UPDATEUSER which do not exist in Redis ACL.
Final Answer:
ACL SETUSER username on >password ~keys +commands -> Option D
Quick Check:
Use ACL SETUSER to set permissions [OK]
Hint: Remember: ACL SETUSER sets or updates users [OK]
Common Mistakes:
Using non-existent ACL commands like CREATEUSER
Confusing SETUSER with other verbs
Missing required syntax parts like 'on' or '>'
3. Given the command ACL SETUSER alice on >mypassword ~cache:* +get +set, what permissions does user 'alice' have?
medium
A. User 'alice' is disabled and cannot run any commands
B. User 'alice' can run all commands on all keys
C. User 'alice' can only run GET and SET commands on keys starting with 'cache:'
D. User 'alice' can run GET and SET commands on all keys
Solution
Step 1: Analyze ACL SETUSER command parts
'on' enables the user, '>mypassword' sets password, '~cache:*' limits keys to those starting with 'cache:', '+get +set' allows only GET and SET commands.
Step 2: Interpret permissions
User 'alice' can only run GET and SET commands on keys matching 'cache:*'. Other commands or keys are denied.
Final Answer:
User 'alice' can only run GET and SET commands on keys starting with 'cache:' -> Option C
Quick Check:
Commands + keys limited = A [OK]
Hint: Check '+' for commands and '~' for key patterns [OK]
Common Mistakes:
Assuming all commands are allowed
Ignoring key pattern restrictions
Thinking user is disabled without 'off'
4. You run ACL SETUSER bob on >secret +@all but Bob still cannot execute commands. What is the likely problem?
medium
A. Bob's client did not authenticate with the password
B. Bob's password was not set correctly
C. The command '+@all' is invalid syntax
D. Bob's user is disabled because 'on' was not set
Solution
Step 1: Check user status and permissions
'on' enables Bob, '+@all' grants all command categories, and '>secret' sets password correctly.
Step 2: Identify why commands fail
If Bob cannot run commands, likely he did not authenticate with the password, so Redis denies access despite permissions.
Final Answer:
Bob's client did not authenticate with the password -> Option A
Quick Check:
Authentication required after ACL SETUSER [OK]
Hint: Set password and authenticate client to enable commands [OK]
Common Mistakes:
Forgetting to authenticate after setting password
Assuming 'on' disables user if missing
Thinking '+@all' is invalid
5. You want to create a Redis user 'reporter' who can only run the INFO command and read keys starting with stats:. Which command correctly sets this up?
hard
A. ACL SETUSER reporter on >pass123 ~stats:* +info
B. ACL SETUSER reporter on >pass123 ~stats:* +@read
C. ACL SETUSER reporter on >pass123 ~stats:* +get +info
D. ACL SETUSER reporter on >pass123 ~stats:* +get
Solution
Step 1: Understand command requirements
User 'reporter' needs only the INFO command and access to keys starting with 'stats:'.
Step 2: Evaluate options
ACL SETUSER reporter on >pass123 ~stats:* +info: ACL SETUSER reporter on >pass123 ~stats:* +info grants only the INFO command on keys starting with 'stats:'. ACL SETUSER reporter on >pass123 ~stats:* +get +info incorrectly grants +get which is not required. ACL SETUSER reporter on >pass123 ~stats:* +@read grants all read commands (+@read), which is too broad. ACL SETUSER reporter on >pass123 ~stats:* +get misses +info, so cannot run INFO command.
Final Answer:
ACL SETUSER reporter on >pass123 ~stats:* +info -> Option A
Quick Check:
Only INFO command + key permissions = C [OK]
Hint: Grant only needed commands with '+' and keys with '~' [OK]
Common Mistakes:
Granting command categories instead of specific commands
Missing +info for INFO command
Forgetting to enable user with 'on'
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.