Updated on 2024-10-25 GMT+08:00

Configuring RabbitMQ ACL Users

When ACL is enabled for a RabbitMQ instance, message production and consumption require authentication.

This section describes how to create, edit, and delete a user.

RabbitMQ ACL users can be configured on the console only in RabbitMQ AMQP-0-9-1. By default, you can create users on the management UI, and assign permissions for RabbitMQ 3.x.x instances.

Prerequisites

  • A RabbitMQ AMQP-0-9-1 instance has been purchased.
  • ACL has been enabled.

Creating a User

  1. Log in to the console.
  2. In the upper left corner, click and select a region.

    Select the region where your RabbitMQ instance is in.

  3. Click and choose Middleware > Distributed Message Service for RabbitMQ to open the console of DMS for RabbitMQ.
  4. Click an instance name to go to the instance details page.
  5. In the navigation pane, choose Users.
  6. Click Create User.
  7. Configure the user's name and other parameters by referring to Table 1.

    Table 1 User parameters

    Parameter

    Description

    Username

    You can customize a username that complies with the rules: 7–64 characters; starts with a letter; can contain only letters, digits, hyphens (-), and underscores (_).

    The name cannot be changed after the user is created.

    Password

    Password of the user.

    A password must meet the following requirements:

    • Contains 8 to 32 characters.
    • Contains at least three types of the following characters: uppercase letters, lowercase letters, digits, and special characters `~! @#$ %^&*()-_=+\|[{}];:'",<.>? and spaces, and cannot start with a hyphen (-).
    • Cannot be the username spelled forwards or backwards.

    Confirm Password

    Enter the password again.

    Vhost

    • Accessible Virtual Host: Select a virtual host from the drop-down list box.
    • Assignable Resource: Use regular expressions to grant user permissions for virtual host resources. For example, ^test-.* grants the user permissions for all the resources whose names start with test-.
    • Writable Resource: Use regular expressions to grant user write permissions for virtual host resources. For example, .*, grants user write permissions for all virtual host resources.
    • Readable Resource: Use regular expressions to grant user read permissions for virtual host resources. For example, .* grants user read permissions for all virtual host resources.

    Click Add to add virtual hosts as required.

    Figure 1 Creating a User

  8. Click OK.
  9. After ACL is enabled, user authentication information (username and password) must be added to both the producer and consumer configurations. For details, see the following instructions:

Modifying User Information

  1. Log in to the console.
  2. In the upper left corner, click and select a region.

    Select the region where your RabbitMQ instance is in.

  3. Click and choose Middleware > Distributed Message Service for RabbitMQ to open the console of DMS for RabbitMQ.
  4. Click an instance name to go to the instance details page.
  5. In the navigation pane, choose Users.
  6. In the row containing the desired user, click Edit.
  7. To edit the password, click Edit next to Password and enter a new password. To edit the virtual host:

    • Accessible Virtual Host: Select a virtual host from the drop-down list box.
    • Assignable Resource: Use regular expressions to grant user permissions for virtual host resources. For example, ^test-.* grants the user permissions for all the resources whose names start with test-.
    • Writable Resource: Use regular expressions to grant user write permissions for virtual host resources. For example, .*, grants user write permissions for all virtual host resources.
    • Readable Resource: Use regular expressions to grant user read permissions for virtual host resources. For example, .* grants user read permissions for all virtual host resources.

  8. Click OK.

Deleting a User

  1. Log in to the console.
  2. In the upper left corner, click and select a region.

    Select the region where your RabbitMQ instance is in.

  3. Click and choose Middleware > Distributed Message Service for RabbitMQ to open the console of DMS for RabbitMQ.
  4. Click an instance name to go to the instance details page.
  5. In the navigation pane, choose Users.
  6. In the row containing the desired user, click Delete.
  7. Click OK.

    Deleting a user will remove its authorization relationship and disconnect it from the instance.