Prerequisites

Abstract

Access Control Lists (ACLs) control what topics a given username/password pair is allowed to publish and subscribe on. ACLs should be designed with a 'principal of least privilege' model while also considering device management and maintenance.  For example gateways and devices in the field should be limited to publishing and subscribing only on the topics for which they should be expected to.  The same should be true of 'consumer' applications that will be either sending commands to devices in the field or consuming data coming from those devices. It is also important to note that a username is not limited to a single MQTT client. 

If you are new to MQTT topics, the Eclipse Foundation's Paho project provides good information here on the basics of wildcards.

Definition

ACLs are defined by the following format: [R|W|RW] topic where:

R = Read or 'subscribe' privileges

W = Write or 'publish' privileges

RW = Read and Write (subscribe and publish) privileges

topic = The topic or wildcard topic representing the scope of the privilege

Examples

RW #

R #

W #

Examples for MQTT Transmission ACLs

W spBv1.0/GroupID/+/EdgeNodeID/#

R STATE/PrimaryHostID, R spBv1.0/GroupID/+/EdgeNodeID/#

W device_one/temp/#,R state/#


Additional Resources