Hi,
I just installed HiveMQ CE 2020.5 with the following extensions:
- File RBAC
- MQTT Message Log
- Deny Root Wildcard Subscriptions
The content of credentials.xml for the RBAC extension is
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<file-rbac>
<users>
<user>
<name>user1</name>
<password>pass1</password>
<roles>
<id>role1</id>
</roles>
</user>
</users>
<roles>
<role>
<id>role1</id>
<permissions>
<permission>
<topic>topic/data</topic>
<activity>PUBLISH</activity>
</permission>
</permissions>
</role>
</roles>
</file-rbac>
After reading the documentation I would have expected to get a NOT_AUTHORIZED if I try to subscribe to topic/data. But I can subscribe and receive messages.
Subscribe:
$ mqtt sub -t topic/data -h localhost -p 1883 -u user1 -pw pass1
Hello World...
Publish:
$ mqtt pub -t topic/data -m "Hello World..." -h localhost -p 1883 -u user1 -pw pass1
The server log for the subscribe:
INFO - Received CONNECT from client 'hmq_A0jix_5_272f4cb78ad7ece55b955844891d6ea8': Protocol version: 'V_5', Clean Start: 'true', Session Expiry Interval: '9223372036854775807'
INFO - Sent CONNACK to client 'hmq_A0jix_5_272f4cb78ad7ece55b955844891d6ea8': Reason Code: 'SUCCESS', Session Present: 'false'
INFO - Received SUBSCRIBE from client 'hmq_A0jix_5_272f4cb78ad7ece55b955844891d6ea8': Topics: { [Topic: 'topic/data', QoS: '2'] }
INFO - Sent SUBACK to client 'hmq_A0jix_5_272f4cb78ad7ece55b955844891d6ea8': Suback Reason Codes: { [Reason Code: 'GRANTED_QOS_2'] }
When I define SUBSCRIBE as the allowed acitivity in credentials.xml the publish gets rejected as expected.
I could also reproduce this behavior with a custom SimpleAuthenticator without the RBAC extension. So it is not an issue with the extension itself. But is this an issue or is it expected behavior?
Thanks for any help.