Updated BFFH Config to v0.2

This commit is contained in:
TheJoKlLa 2021-12-24 01:05:15 +01:00
parent 9c3c0f5a89
commit edc22c84e7
3 changed files with 104 additions and 84 deletions

View File

@ -1,73 +1,113 @@
-- { actor_connections = [] : List { _1 : Text, _2 : Text } {
{ actor_connections = -- General Server Configuration
-- Link up machines to actors listens =
[ { _1 = "Testmachine", _2 = "Shelly_1234" } [
, { _1 = "Another", _2 = "Bash" } { address = "::", port = Some 59661 }
-- One machine can have as many actors as it wants ],
, { _1 = "Yetmore", _2 = "Bash2" } mqtt_url = "tcp://mqtt:1883",
, { _1 = "Yetmore", _2 = "FailBash"} db_path = "/var/lib/bffh/db",
]
, actors = -- Machines Configuration
{ Shelly_1234 = { module = "Shelly", params = {=} } machines =
, Bash = { module = "Process", params = {
{ cmd = "/usr/local/lib/bffh/adapters/actor.sh" Testmachine =
, args = "your ad could be here" {
}} name = "Testmachine",
, Bash2 = { module = "Process", params = description = Some "A test machine",
{ cmd = "/usr/local/lib/bffh/adapters/actor.sh"
, args = "this is a different one" disclose = "lab.test.read",
}} read = "lab.test.read",
, FailBash = { module = "Process", params = write = "lab.test.write",
{ cmd = "/usr/local/lib/bffh/adapters/fail-actor.sh" manage = "lab.test.admin"
}}
}
, init_connections = [] : List { _1 : Text, _2 : Text }
--, init_connections = [{ _1 = "Initiator", _2 = "Testmachine" }]
, initiators = {=}
--{ Initiator = { module = "Dummy", params = {=} } }
, listens =
[ { address = "::", port = Some 59661 }
]
, machines =
{ Testmachine =
{ description = Some "A test machine"
, disclose = "lab.test.read"
, manage = "lab.test.admin"
, name = "Testmachine"
, read = "lab.test.read"
, write = "lab.test.write"
}, },
Another = Another =
{ description = Some "Another test machine" {
, disclose = "lab.test.read" name = "Another",
, manage = "lab.test.admin" description = Some "Another test machine",
, name = "Another"
, read = "lab.test.read" disclose = "lab.test.read",
, write = "lab.test.write" read = "lab.test.read",
write = "lab.test.write",
manage = "lab.test.admin"
}, },
Yetmore = Yetmore =
{ description = Some "Yet more test machines" {
, disclose = "lab.test.read" name = "Yetmore",
, manage = "lab.test.admin" description = Some "Yet more test machines",
, name = "Yetmore"
, read = "lab.test.read" disclose = "lab.test.read",
, write = "lab.test.write" read = "lab.test.read",
write = "lab.test.write",
manage = "lab.test.admin"
} }
} },
, mqtt_url = "tcp://mqtt:1883"
, db_path = "/var/lib/bffh/db" -- Actors Configuration
, roles = actors =
{ testrole = {
{ permissions = [ "lab.test.*" ] } Shelly_1234 =
, somerole = {
{ parents = ["testparent"] module = "Shelly",
, permissions = [ "lab.some.admin" ] params = {=}
},
Bash =
{
module = "Process",
params =
{
cmd = "/usr/local/lib/bffh/adapters/actor.sh",
args = "your ad could be here"
}
},
Bash2 =
{
module = "Process",
params =
{
cmd = "/usr/local/lib/bffh/adapters/actor.sh",
args = "this is a different one"
}
},
FailBash =
{
module = "Process",
params =
{
cmd = "/usr/local/lib/bffh/adapters/fail-actor.sh"
}
} }
, testparent = },
{ permissions = actor_connections =
[ "lab.some.write" [
, "lab.some.read" { machine = "Testmachine", actor = "Shelly_1234" },
, "lab.some.disclose" { machine = "Another", actor = "Bash" },
{ machine = "Yetmore", actor = "Bash2" },
{ machine = "Yetmore", actor = "FailBash"}
],
-- Initiator Configuration
initiators = {=},
init_connections = [] : List { machine : Text, initiator : Text },
-- Roles
roles =
{
testrole =
{
permissions = [ "lab.test.*" ]
},
somerole =
{
parents = ["testparent"],
permissions = [ "lab.some.admin" ]
},
testparent =
{
permissions =
[
"lab.some.write",
"lab.some.read",
"lab.some.disclose"
] ]
} }
} }

View File

@ -1 +0,0 @@
Testuser = "secret"

View File

@ -1,19 +0,0 @@
[anotherrole]
[testrole]
permissions = [
"lab.test.*"
]
[somerole]
parents = ["testparent/lmdb"]
permissions = [
"lab.some.admin"
]
[testparent]
permissions = [
"lab.some.write",
"lab.some.read",
"lab.some.disclose",
]