add acls
This commit is contained in:
parent
e4a027e21d
commit
3594a73baf
4 changed files with 20 additions and 7 deletions
|
@ -22,10 +22,17 @@ spec:
|
|||
mountPath: /opt/init-user.json
|
||||
subPath: init-user.json
|
||||
readOnly: true
|
||||
- name: acl-conf
|
||||
mountPath: /opt/acl.conf
|
||||
subPath: acl.conf
|
||||
readOnly: true
|
||||
extraVolumes:
|
||||
- name: init-user
|
||||
secret:
|
||||
secretName: emqx-init-user-secret
|
||||
- name: acl-conf
|
||||
configMap:
|
||||
name: emqx-acl-conf
|
||||
listenersServiceTemplate:
|
||||
metadata:
|
||||
annotations:
|
||||
|
|
|
@ -9,6 +9,9 @@ configMapGenerator:
|
|||
- name: emqx-conf
|
||||
files:
|
||||
- emqx.conf=./resources/emqx.conf
|
||||
- name: emqx-acl-conf
|
||||
files:
|
||||
- acl.conf=./resources/acl.conf
|
||||
replacements:
|
||||
- source:
|
||||
kind: ConfigMap
|
||||
|
|
5
kubernetes/apps/database/emqx/cluster/resources/acl.conf
Normal file
5
kubernetes/apps/database/emqx/cluster/resources/acl.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
%% ACLs for emqx %%
|
||||
{allow, {user, "jahanson"}, all, ["#"]}.
|
||||
{allow, {user, "tasmota"}, publish, ["tasmota/discovery/#", "tele/tasmota_+/+", "cmnd/tasmota_+/+"]}.
|
||||
{allow, {user, "homeassistant"}, subscribe, ["stat/tasmota_+/+", "tele/tasmota_+/+"]}.
|
||||
{deny, all}.
|
|
@ -14,14 +14,12 @@ authorization {
|
|||
{
|
||||
type = built_in_database
|
||||
enable = true
|
||||
},
|
||||
{
|
||||
type = file
|
||||
enable = true
|
||||
path = "/opt/acl.conf"
|
||||
}
|
||||
]
|
||||
no_match: "deny"
|
||||
}
|
||||
|
||||
authorization.sources.built_in_database.rules = [
|
||||
{allow, {user, "jahanson"}, all, ["#"]},
|
||||
{allow, {user, "tasmota"}, publish, ["tasmota/discovery/#", "tele/tasmota_+/+", "cmnd/tasmota_+/+"]},
|
||||
{allow, {user, "homeassistant"}, subscribe, ["stat/tasmota_+/+", "tele/tasmota_+/+"]},
|
||||
{deny, all}
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue