aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4/tests/scenario/rbac.py
diff options
context:
space:
mode:
authorasteroide <thomas.duval@orange.com>2017-09-13 11:19:47 +0200
committerasteroide <thomas.duval@orange.com>2017-09-13 11:19:47 +0200
commit1f754ef804ffedaf1c222f9f51313b6afcbbec6e (patch)
tree489c8dafa509d3066608d2c3fc087a07d587ab27 /moonv4/tests/scenario/rbac.py
parent3595c59908df7c43fad4301545d3b9c455dffcc7 (diff)
Move test files from Interface dir to tests dir
Change-Id: Iaf697b15a8e51cd96a4a1b65d74483b7f3ac9cea
Diffstat (limited to 'moonv4/tests/scenario/rbac.py')
-rw-r--r--moonv4/tests/scenario/rbac.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/moonv4/tests/scenario/rbac.py b/moonv4/tests/scenario/rbac.py
new file mode 100644
index 00000000..89fd7de8
--- /dev/null
+++ b/moonv4/tests/scenario/rbac.py
@@ -0,0 +1,44 @@
+
+pdp_name = "pdp1"
+policy_name = "RBAC policy example"
+model_name = "RBAC"
+policy_genre = "authz"
+
+subjects = {"user0": "", "user1": "", }
+objects = {"vm0": "", "vm1": "", }
+actions = {"start": "", "stop": ""}
+
+subject_categories = {"role": "", }
+object_categories = {"id": "", }
+action_categories = {"action-type": "", }
+
+subject_data = {"role": {"admin": "", "employee": "", "*": ""}}
+object_data = {"id": {"vm0": "", "vm1": "", "*": ""}}
+action_data = {"action-type": {"vm-action": "", "*": ""}}
+
+subject_assignments = {"user0": ({"role": "employee"}, {"role": "*"}), "user1": ({"role": "employee"}, {"role": "*"}), }
+object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})}
+action_assignments = {"start": ({"action-type": "vm-action"}, {"action-type": "*"}), "stop": ({"action-type": "vm-action"}, {"action-type": "*"})}
+
+meta_rule = {
+ "rbac": {"id": "", "value": ("role", "id", "action-type")},
+}
+
+rules = {
+ "rbac": (
+ {
+ "rule": ("admin", "vm0", "vm-action"),
+ "instructions": (
+ {"decision": "grant"}, # "grant" to immediately exit, "continue" to wait for the result of next policy
+ )
+ },
+ {
+ "rule": ("employee", "vm1", "vm-action"),
+ "instructions": (
+ {"decision": "grant"},
+ )
+ },
+ )
+}
+
+