Skip to content

Commit 81d157f

Browse files
ansdmichaelklishin
authored andcommitted
Document SASL mechanism ANONYMOUS
1 parent bdc1376 commit 81d157f

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

docs/access-control.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -770,8 +770,8 @@ auth_backends.2 = internal
770770
## Authentication Mechanisms {#mechanisms}
771771

772772
RabbitMQ supports multiple SASL authentication
773-
mechanisms. There are three such mechanisms built into the
774-
server: <code>PLAIN</code>, <code>AMQPLAIN</code>,
773+
mechanisms. There are four such mechanisms built into the
774+
server: <code>PLAIN</code>, <code>AMQPLAIN</code>, <code>ANONYMOUS</code>,
775775
and <code>RABBIT-CR-DEMO</code>, and one — <code>EXTERNAL</code> —
776776
available as a [plugin](https://github.com/rabbitmq/rabbitmq-auth-mechanism-ssl).
777777

@@ -806,6 +806,18 @@ The built-in mechanisms are:
806806
</td>
807807
</tr>
808808

809+
<tr>
810+
<td>ANONYMOUS</td>
811+
<td>
812+
This mechanism is enabled by default allowing anonymous clients to connect without providing
813+
any credentials. RabbitMQ will internally authenticate and authorize the client using the credentials
814+
configured in <code>anonymous_login_user</code> and <code>anonymous_login_pass</code> (both are set to <code>guest</code> by default).
815+
In other words, any unauthenticated client will be able to connect and act as the configured <code>anonymous_login_user</code>.
816+
<strong>For production environments, remove this mechanism.</strong>
817+
See the [production checklist](http://localhost:3000/docs/next/production-checklist#anonymous-login) documentation.
818+
</td>
819+
</tr>
820+
809821
<tr>
810822
<td>EXTERNAL</td>
811823
<td>
@@ -831,10 +843,9 @@ the <code>rabbit</code> application determines which of the
831843
installed mechanisms are offered to connecting clients. This
832844
variable should be a list of atoms corresponding to
833845
mechanism names, for example
834-
<code>['PLAIN', 'AMQPLAIN']</code> by default. The server-side list is not
835-
considered to be in any particular order. See the
836-
[configuration file](./configure#configuration-files)
837-
documentation.
846+
<code>['PLAIN', 'AMQPLAIN', 'ANONYMOUS']</code> by default.
847+
The server mechanisms are ordered in decreasing level of preference.
848+
See the [configuration file](./configure#configuration-files) documentation.
838849

839850

840851
### Mechanism Configuration in the Client {#client-mechanism-configuration}

docs/configure.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,7 @@ management_db_cache_multiplier = 5
11151115
```ini
11161116
auth_mechanisms.1 = PLAIN
11171117
auth_mechanisms.2 = AMQPLAIN
1118+
auth_mechanisms.3 = ANONYMOUS
11181119
```
11191120
</p>
11201121
</td>

docs/production-checklist.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,19 @@ For IoT applications that involve many clients performing the same or similar
143143
function and having fixed IP addresses, it may make sense to [authenticate using x509 certificates](./ssl) or
144144
[source IP address ranges](https://github.com/gotthardp/rabbitmq-auth-backend-ip-range).
145145

146+
### Anonymous Login
147+
148+
For production environments, prohibit anonymous logins.
149+
150+
You can disallow [SASL mechansim](access-control#mechanisms) `ANONYMOUS` in [rabbitmq.conf](configure#config-file) as follows:
151+
```
152+
# Remove 'ANONYMOUS' from the list of advertised SASL mechanisms, e.g.
153+
auth_mechanisms = ['PLAIN', 'AMQPLAIN']
154+
155+
# Value none has a special meaning that no user is configured for anonymous logins.
156+
anonymous_login_user = none
157+
```
158+
146159
## Monitoring and Resource Limits {#monitoring-and-resource-usage}
147160

148161
RabbitMQ nodes are limited by various resources, both physical

0 commit comments

Comments
 (0)