aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4/templates/moonforming/conf/rbac.py
diff options
context:
space:
mode:
authorThomas Duval <thomas.duval@orange.com>2017-10-29 21:12:28 +0100
committerThomas Duval <thomas.duval@orange.com>2017-10-29 21:12:28 +0100
commit63a4316f271a15cc9e9718fbef6f54f2eb05ad20 (patch)
tree6b3cc9a8a56e7decbd341f49740299be5a7fe041 /moonv4/templates/moonforming/conf/rbac.py
parent324009655ea60c5215929fc3ddbe57fd2242c133 (diff)
Update the moonforming template
Change-Id: I283a414acb2d38ca094bc542dec577b085217cf9
Diffstat (limited to 'moonv4/templates/moonforming/conf/rbac.py')
-rw-r--r--moonv4/templates/moonforming/conf/rbac.py61
1 files changed, 61 insertions, 0 deletions
diff --git a/moonv4/templates/moonforming/conf/rbac.py b/moonv4/templates/moonforming/conf/rbac.py
new file mode 100644
index 00000000..25c010fd
--- /dev/null
+++ b/moonv4/templates/moonforming/conf/rbac.py
@@ -0,0 +1,61 @@
+
+pdp_name = "pdp_rbac"
+policy_name = "RBAC policy example"
+model_name = "RBAC"
+policy_genre = "authz"
+
+subjects = {"adminuser": "", "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 = {
+ "adminuser":
+ ({"role": "admin"}, {"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"},
+ )
+ },
+ )
+}
+
+