0
0
Redisquery~20 mins

ACL system for user permissions in Redis - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Redis ACL Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
2:00remaining
Check user permission with ACL GETUSER
Given a Redis ACL user named alice with the following rules:

ACL SETUSER alice on >password ~* +get +set -del

What is the output of the command ACL GETUSER alice?
Redis
ACL GETUSER alice
A["flags", ["off"], "password", "password", "commands", ["get", "set"], "keys", ["*"]]
B["flags", ["on"], "password", "password", "commands", ["get", "set", "del"], "keys", ["*"]]
C]]"*"[ ,"syek" ,]"tes" ,"teg"[ ,"sdnammoc" ,"drowssap" ,"drowssap" ,]"slennahclla" ,"syeklla" ,"no"[ ,"sgalf"[
D["flags", ["on", "allkeys", "allchannels"], "password", "password", "commands", ["get", "set"], "keys", ["*"]]
Attempts:
2 left
💡 Hint
Remember that the '-' before a command means it is denied and won't appear in the allowed commands list.
🧠 Conceptual
intermediate
2:00remaining
Understanding ACL command permissions
Which of the following ACL command rules correctly allows a user to only run GET and SET commands but denies DEL and all other commands?
Aon >password ~* +get +set +del
Bon >password ~* +get +set -del
Con >password ~* +get -set -del
Don >password ~* +get +set +del +expire
Attempts:
2 left
💡 Hint
Look for the option that explicitly denies DEL and only allows GET and SET.
📝 Syntax
advanced
2:00remaining
Identify the syntax error in ACL SETUSER command
Which option contains a syntax error when trying to create a user bob with password secret and allow only GET and SET commands?
AACL SETUSER bob on >secret +get +set
BACL SETUSER bob on >secret ~* +get +set -del
CACL SETUSER bob on >secret ~* +get +set
DACL SETUSER bob on >secret ~* +get +set +del
Attempts:
2 left
💡 Hint
Check if the keys pattern (~*) is missing which is required to specify accessible keys.
optimization
advanced
2:00remaining
Optimizing ACL rules for minimal permissions
You want to create a Redis ACL user readonly that can only read keys matching cache:* and run GET and EXISTS commands. Which ACL SETUSER command is the most precise and minimal?
AACL SETUSER readonly on >readonlypass ~cache:* +get +exists -set
BACL SETUSER readonly on >readonlypass ~* +get +exists
CACL SETUSER readonly on >readonlypass ~cache:* +get +exists
DACL SETUSER readonly on >readonlypass ~cache:* +get +exists +set
Attempts:
2 left
💡 Hint
Minimal permissions mean only allowing necessary keys and commands.
🔧 Debug
expert
2:00remaining
Debugging unexpected ACL denial
A Redis user writer is created with:

ACL SETUSER writer on >writepass ~data:* +set +del

However, when running SET data:1 value, the command is denied. What is the most likely cause?
AThe user lacks the 'allkeys' flag, so keys pattern '~data:*' is not recognized.
BThe keys pattern '~data:*' does not match the key 'data:1' due to a typo.
CThe user is missing the 'get' command permission required for SET.
DThe user is disabled because the 'off' flag was set accidentally.
Attempts:
2 left
💡 Hint
Check if the user has the correct flags to allow key pattern matching.