Skip to content

EMQX ACL Rules Not Enforced

DodaTech Updated 2026-06-26 1 min read

In this tutorial, you'll learn about EMQX ACL Rules Not Enforced. We cover key concepts, practical examples, and best practices.

The Problem

MQTT clients can publish or subscribe to topics despite ACL rules denying access.

Quick Fix

Wrong

# ACL file not loaded — no authorization configured
All clients can access all topics (permissive default).
# 1. Enable authorization via Dashboard
curl -u admin:public -X POST http://localhost:18083/api/v5/authorization/sources \
  -H 'Content-Type: application/json' \
  -d '{'type':'built_in_database'}'

# 2. Add ACL rule: deny user myuser from publishing to /admin/#
curl -u admin:public -X POST http://localhost:18083/api/v5/authorization/sources/built_in_database/rules \
  -d '{'rules':[{'who':'username','username':'myuser','topics':['/admin/#'],'action':'publish','effect':'deny'}]}'

# 3. Verify
mqttx pub -t /admin/secret -m leak -u myuser -P pass
Publish fails with 'Not Authorized' or connection dropped.

Prevention

ACL rules can be based on: username, client ID, IP address, or all clients. Rule order: first match wins. Cache ACL rules for performance. Use MQTT 5.0 enhanced auth for real-time permission updates. Test ACLs with the emqx_ctl acl check command.

DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.

FAQ

### What is the default ACL policy?

EMQX 5.x: allow all if no authorization configured. After configuring, the default deny applies — only explicitly allowed actions succeed.

Can ACL rules be dynamic?

Yes. Use Redis, MySQL, or HTTP backend for dynamic ACLs. Changes take effect immediately without broker restart.

How do I debug ACL failures?

Set log.level = debug in emqx.conf. Check broker logs for Authorization denied messages.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro