Bird
Raised Fist0
RabbitMQdevops~20 mins

User and permission management in RabbitMQ - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
RabbitMQ User & Permission Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
RabbitMQ User Listing Output
What is the output of the command rabbitmqctl list_users after creating two users named alice and bob with tags administrator and monitoring respectively?
RabbitMQ
rabbitmqctl add_user alice password123
rabbitmqctl add_user bob password456
rabbitmqctl set_user_tags alice administrator
rabbitmqctl set_user_tags bob monitoring
rabbitmqctl list_users
A
Listing users ...
alice	[monitoring]
bob	[administrator]
B
Listing users ...
alice	[]
bob	[]
C
Listing users ...
alice	[administrator]
bob	[monitoring]
DError: user not found
Attempts:
2 left
💡 Hint
Remember that user tags are assigned explicitly and shown in brackets after the username.
❓ Configuration
intermediate
2:00remaining
Setting RabbitMQ Permissions
Which configuration command correctly grants the user alice full permissions on the virtual host /?
Arabbitmqctl set_permissions -p / alice "." "." "."
Brabbitmqctl set_permissions alice / ".*" ".*" ".*"
Crabbitmqctl set_permissions -p alice / ".*" ".*" ".*"
Drabbitmqctl set_permissions -p / alice ".*" ".*" ".*"
Attempts:
2 left
💡 Hint
The correct syntax requires specifying the virtual host with -p before the username.
❓ Troubleshoot
advanced
2:00remaining
Diagnosing Permission Denied Error
A user bob tries to publish messages to a queue but receives a permission denied error. Which of the following is the most likely cause?
AUser bob has no write permission on the virtual host for the queue.
BUser bob is not created in RabbitMQ.
CUser bob is not tagged as administrator.
DUser bob's password has expired.
Attempts:
2 left
💡 Hint
Publishing requires write permission on the virtual host.
🔀 Workflow
advanced
2:00remaining
User Creation and Permission Setup Workflow
What is the correct order of commands to create a user charlie, assign the tag management, and grant read and write permissions on virtual host /app?
A1,3,2
B3,1,2
C2,1,3
D1,2,3
Attempts:
2 left
💡 Hint
User must exist before assigning tags or permissions.
✅ Best Practice
expert
2:00remaining
Best Practice for RabbitMQ User Permissions
Which option best follows the principle of least privilege when assigning permissions to a RabbitMQ user?
AGrant full permissions ".*" on all virtual hosts to simplify management.
BGrant only the necessary read and write permissions on specific virtual hosts and queues the user needs.
CCreate one user with full permissions and share credentials among team members.
DAssign administrator tag to all users to avoid permission issues.
Attempts:
2 left
💡 Hint
Least privilege means giving only what is needed, no more.

Practice

(1/5)
1. What is the primary purpose of RabbitMQ user management?
easy
A. To monitor message queue performance
B. To configure network settings for RabbitMQ
C. To control who can access RabbitMQ and what they can do
D. To backup RabbitMQ data automatically

Solution

  1. Step 1: Understand user management role

    User management in RabbitMQ controls access by defining users who can connect.
  2. Step 2: Understand permission role

    Permissions define what actions users can perform on queues and exchanges.
  3. Final Answer:

    To control who can access RabbitMQ and what they can do -> Option C
  4. Quick Check:

    User management = Access control [OK]
Hint: User management = who can do what in RabbitMQ [OK]
Common Mistakes:
  • Confusing user management with monitoring
  • Thinking permissions configure network
  • Assuming user management handles backups
2. Which command correctly adds a new user named alice with password secret123 in RabbitMQ?
easy
A. rabbitmqctl new_user alice secret123
B. rabbitmqctl add_user alice secret123
C. rabbitmqctl user_add alice secret123
D. rabbitmqctl create_user alice secret123

Solution

  1. Step 1: Recall RabbitMQ user creation syntax

    The correct command to add a user is rabbitmqctl add_user username password.
  2. Step 2: Match command with options

    Only rabbitmqctl add_user alice secret123 matches the correct syntax exactly.
  3. Final Answer:

    rabbitmqctl add_user alice secret123 -> Option B
  4. Quick Check:

    add_user command adds user [OK]
Hint: Use add_user to create users, not create_user [OK]
Common Mistakes:
  • Using create_user instead of add_user
  • Swapping username and password order
  • Using commands that don't exist
3. What will be the output of the following command if user bob has permissions to configure and write to all queues but no read permission?

rabbitmqctl list_user_permissions bob
medium
A. Config: .* Write: .* Read: ""
B. Config: "" Write: "" Read: ""
C. Config: .* Write: .* Read: .*
D. Config: .* Write: "" Read: .*

Solution

  1. Step 1: Understand permission patterns

    Permissions use regex patterns: .* means all, "" means none.
  2. Step 2: Match permissions to output

    Bob has configure and write permissions to all queues, so those are .*. No read permission means empty string "".
  3. Final Answer:

    Config: .* Write: .* Read: "" -> Option A
  4. Quick Check:

    Permissions regex = C [OK]
Hint: Empty quotes mean no permission, .* means full permission [OK]
Common Mistakes:
  • Assuming missing permission shows as .*
  • Confusing read and write permissions
  • Misreading empty string as no permission
4. You run rabbitmqctl set_permissions -p / myuser ".*" ".*" ".*" but get an error saying user myuser does not exist. What is the most likely fix?
medium
A. Restart RabbitMQ server before setting permissions
B. Change the virtual host name from / to default
C. Remove the -p option from the command
D. Create the user first using rabbitmqctl add_user myuser password

Solution

  1. Step 1: Understand error cause

    Setting permissions requires the user to exist first; error means user missing.
  2. Step 2: Fix by creating user

    Use rabbitmqctl add_user myuser password to create the user before setting permissions.
  3. Final Answer:

    Create the user first using rabbitmqctl add_user myuser password -> Option D
  4. Quick Check:

    User must exist before permissions [OK]
Hint: Add user before setting permissions [OK]
Common Mistakes:
  • Trying to set permissions on non-existent user
  • Changing virtual host unnecessarily
  • Restarting server without fixing user
5. You want to create a user carol who can only read from queues in the virtual host vhost1. Which sequence of commands correctly achieves this?
hard
A. rabbitmqctl add_user carol pass123
rabbitmqctl set_permissions -p vhost1 carol "" "" ".*"
B. rabbitmqctl add_user carol pass123
rabbitmqctl set_permissions -p vhost1 carol ".*" ".*" ".*"
C. rabbitmqctl add_user carol pass123
rabbitmqctl set_permissions -p vhost1 carol ".*" "" ""
D. rabbitmqctl add_user carol pass123
rabbitmqctl set_permissions -p vhost1 carol "" ".*" ""

Solution

  1. Step 1: Create user carol

    Use rabbitmqctl add_user carol pass123 to add the user.
  2. Step 2: Set read-only permissions

    Set configure and write permissions to empty string "", and read permission to ".*" for all queues in vhost1.
  3. Final Answer:

    rabbitmqctl add_user carol pass123
    rabbitmqctl set_permissions -p vhost1 carol "" "" ".*"
    -> Option A
  4. Quick Check:

    Read-only = config "", write "", read ".*" [OK]
Hint: Set empty config/write, full read permission for read-only user [OK]
Common Mistakes:
  • Giving full permissions instead of read-only
  • Mixing up permission order (config, write, read)
  • Forgetting to specify virtual host
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard