You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

Prerequisites

  • Knowledge of Ignition and Module installation process: Cirrus Link Module Installation
  • Have Ignition 8.0.16 or greater installed
  • Have MQTT Distributor 4.0.10 or later installed

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 important to note that a username is not limited to a single MQTT client. You will need to create separate users for each publishing and/or subscribing client, such as MQTT Transmission and MQTT Engine, if each one has a different Read/Write requirement.  

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

For subscriptions, two wildcard characters are supported:

  • A '#' character represents a complete sub-tree of the hierarchy and thus must be the last character in a subscription topic string, such as SENSOR/#. This will match any topic starting with SENSOR/, such as SENSOR/1/TEMP and SENSOR/2/HUMIDITY.
  • A '+' character represents a single level of the hierarchy and is used between delimiters. For example, SENSOR/+/TEMP will match SENSOR/1/TEMP and SENSOR/2/TEMP.

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 #

  • This allows clients connecting using this username/password to publish and subscribe on any topic

R #

  • This allows clients connecting using this username/password to subscribe on any topic but not publish on any topics

W #

  • This allows clients connecting using this username/password to publish on any topic but not subscribe on any topics

Examples for MQTT Transmission ACLs

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

  • This allows clients connecting using this username/password to publish on spBv1.0/GroupID/+/EdgeNodeID/# topic

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

  • This allows clients connecting using this username/password to subscribe on both STATE/PrimaryHostID and spBv1.0/GroupID/+/EdgeNodeID/# topics. 

W device_one/temp/#,R state/#

  • This allows clients connecting using this username/password to publish on device_one/temp/# and subscribe on state/# topics

Examples For MQTT Engine ACLs

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

  • This allows Engine clients connecting using this username/password to subscribe and publish on the spBv1.0/STATE/PrimaryHostID and spBv1.0/GroupID/+/EdgeNodeID/#  topics
  • You must also configure the SparkplugB Namespace Filter for this same Group or Group/EdgeNode combination for this topic.

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

  • This allows clients connecting using this username/password to subscribe and publish on both the legacy STATE/PrimaryHostID, spBv1.0/STATE/PrimaryHostID and spBv1.0/GroupID/+/EdgeNodeID/# topics. 

When creating an Access Control List (ACL) for MQTT Engine client, there must be RW privilege's for the MQTT Sparkplug™ B STATE message topic spBv1.0/STATE/primary_host_id 

Review Changes to the STATE message in the Sparkplug v3.0.0 Specification for details on the legacy STATE client topic

ACLs are case sensitive. This means that setting a users ACL to R spbv1.0 will not allow a user to subscribe to spBv1.0/# topics


Additional Resources


  • No labels