summaryrefslogtreecommitdiffstats
path: root/moonv4/tests/scenario/mls.py
blob: 3a3ded43a36f1900120029398a190d5e82af9425 (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
pdp_name = "pdp1"
policy_name = "MLS Policy example"
model_name = "MLS"

subjects = {"user0": "", "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 = {
    "user0": {"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": (
        {
            "rules": ("high", "medium", "vm-action"),
            "instructions": ({"decision": "grant"})
        },
        {
            "rules": ("high", "low", "vm-action"),
            "instructions": ({"decision": "grant"})
        },
        {
            "rules": ("medium", "low", "vm-action"),
            "instructions": ({"decision": "grant"})
        },
    )
}