Securing Your Broker
Rules define who can do what in your Coreflux broker. They control access to system operations, topic publishing/subscribing, and administrative functions—ensuring only authorized users can perform sensitive actions.When to Use Rules
Rules are essential when you need to:| Scenario | Rule Type |
|---|---|
| Restrict who can create/delete users | User Management Rules |
| Control who deploys Actions, Models, Routes | Entity Management Rules |
| Limit access to system configuration | System Configuration Rules |
| Secure MQTT topic access | Publish/Subscribe Rules |
| Protect administrative $SYS topics | System Topic Rules |
In This Section
- Rules Syntax — Complete reference for conditions, scopes, and patterns
How to Deploy a Rule
Rules can be deployed in two ways: through a LoT Notebook (recommended) or via MQTT commands.- LoT Notebook
- MQTT Command
The easiest way to manage rules is through a LoT Notebook. Just write your rule definition in a code cell and run it—the extension automatically detects This approach is ideal for:
DEFINE RULE and sends the proper command to the broker.Click the Run button. The notebook recognizes the LoT code and deploys it instantly.
- Developing and testing rules interactively
- Documenting your security configuration alongside the code
- Sharing rule sets with your team as
.lotnbfiles
Removing Rules
Remove a rule by name using the-removeRule command. Publish to $SYS/Coreflux/Command:
You can also use the Coreflux Entities panel in VS Code to view and remove deployed rules.
Updating Rules
To update an existing rule, deploy a new rule with the same name. The new definition replaces the existing one.Viewing Active Rules
To see all deployed rules, subscribe to the rules system topic:Default Rules Reference
Coreflux includes default rules that provide a secure starting configuration:| Default Behavior | Description |
|---|---|
| Root access | The root user has full access to all operations |
| Management permissions | Management operations require appropriate permission tags |
| Open topics | Standard topic publish/subscribe is open for all users |
| Protected $SYS | System topics are restricted to authorized users |
Default rules establish a baseline security posture. Add custom rules to extend or override this behavior for your specific requirements.

