RabbitMQ permission regex

User level permissions in RabbitMQ are configured using regex. Permissions related regex can be defined via command line or via RabbitMQ UI

Following are the steps to define/configure user permissions using RabbitMQ UI:

1) Login to RabbitMQ UI (default port is 15672) using web browser

2) Go to “Admin” tab” and create new user (or click on an existing user)

3) Now, Under the ‘Set permissions’ section, you can specify appropriate regex to define user permissions as shown in below screenshot:

Note: regex used in above screenshot instructs that user have “configure” access to queue named as ‘myqueue1’ only, and has read/write access to default exchange (amq.default) as well as queue named as ‘myqueue1

You can use any valid regex to specify user permissions as per requirement. Few sample regex are as following:

“amq.default|^(myqueue1)$” (this regex will grant permission to default exchange (amq.default) and queue named as (myqueue1)

“amq.default|^(myqueue1)$|^(myqueue2)$ |^(myqueue3)$” (this regex will grant permission to default exchange (amq.default) and queue named as (myqueue1 or myqueue2 or myqueue3)

“amq.default|^(MySamplePrefix-).*$” (this regex will grant permission to default exchange (amq.default) and any queue whose name start with (MySamplePrefix-)

Leave a comment