aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/scenario_available/mls.py
blob: 0e6285c98e5ec3000a4c375b38df296eef831fb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
pdp_name = "pdp_mls"
policy_name = "MLS Policy example"
model_name = "MLS"
policy_genre = "authz"

subjects = {"adminuser": "", "user1": "", "user2": "", }
objects = {"vm0": "", "vm1": "", }
actions = {"start": "", "stop": ""}

subject_categories = {"subject-security-level": "", }
object_categories = {"object-security-level": "", }
action_categories = {"action-type": "", }

subject_data = {
    "subject-security-level": {"low": "", "medium": "", "high": ""},
}
object_data = {
    "object-security-level": {"low": "", "medium": "", "high": ""},
}
action_data = {"action-type": {"vm-action": "", "storage-action": "", }}

subject_assignments = {
    "adminuser": {"subject-security-level": "high"},
    "user1": {"subject-security-level": "medium"},
}
object_assignments = {
    "vm0": {"object-security-level": "medium"},
    "vm1": {"object-security-level": "low"},
}
action_assignments = {
    "start": {"action-type": "vm-action"},
    "stop": {"action-type": "vm-action"}
}

meta_rule = {
    "mls": {
        "id": "",
        "value": ("subject-security-level",
                  "object-security-level",
                  "action-type")},
}

rules = {
    "mls": (
        {
            "rule": ("high", "medium", "vm-action"),
            "instructions": ({"decision": "grant"})
        },
        {
            "rule": ("high", "low", "vm-action"),
            "instructions": ({"decision": "grant"})
        },
        {
            "rule": ("medium", "low", "vm-action"),
            "instructions": ({"decision": "grant"})
        },
    )
}