RabbitMQ access control,

Source: Internet
Author: User

RabbitMQ access control,
Access Control (Authentication, Authorisation) in RabbitMQ

The two concepts of authentication and authorization are often confusing and even interchangeable. In RabbitMQ, this is wrong. They are two independent concepts. In this simple way, authentication is "identifying who this user is", and authorization is "determining which users cannot do this ".

Default Virtual Host and User

When the server starts running for the first time and detects that its database has not been initialized or deleted, it will use the following resource configuration to initialize a new database:

  • A virtual host named/
  • A user named guest and the password is also guest, which can access all resources under /.

We recommend that you delete a guest user or change its password, especially when your MQ is accessed by the public.

"Guest" user can only connect via localhost

By default, a guest user is prohibited from remotely connecting to RabbitMQ. It can only be connected using localhost. Other users you create will not be limited by this one.

This configuration is set through loopback_users in the configuration file.

If you want the guest user to connect to the remote host, you should set loopback_users to none. A complete configuration should be like this:

Or configure it like this in rabbitmq. config:

How Permissions Work

When a RabbitMQ client establishes a connection with the server, it specifies a virtual host that it intends to operate on. The first level of access control is here. At this time, the server will check whether the user has the permission to access the virtual host.

Resources, such as vswitches and queues, are named entities under a specific virtual host. The same name represents different resources in different virtual main sentences. The second level of access control is to forcibly check whether a certain operation on the resource is allowed.

RabbitMQ has configure, read, and write operations on a resource. (PS: read, write, and execute operations, also known as rwx)

  • Configure operations refer to creating or destroying resources.
  • The write operation refers to injecting a message to the resource.
  • Read operations refer to retrieving a message from a resource.

 

Summary:

The first level of access control is to check whether the user has access permissions to the virtual host when the client establishes a connection with the server.

The second level of access control is to check whether the user has the corresponding access permission to the resource when performing the operation.

 

To perform operations on resources, users must be granted the corresponding permissions. The following table lists the permissions required for executing the AMQP command:

The permission is expressed by an in-process expression.

 

Reference http://www.rabbitmq.com/access-control.html

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.