summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Pryor <spryor@redhat.com>2017-09-07 17:16:16 -0400
committerSean Pryor <spryor@redhat.com>2017-09-07 17:16:16 -0400
commit6dfea8300cec92209774df71f57e518bbd86f2c1 (patch)
tree4e0de3f185bd5560e8b7316556769b59558a94fd
parentab91ff350034a186fe7f1400c2ffece96efaeacf (diff)
downloadopenstack-access-policy-6dfea8300cec92209774df71f57e518bbd86f2c1.zip
openstack-access-policy-6dfea8300cec92209774df71f57e518bbd86f2c1.tar.gz
openstack-access-policy-6dfea8300cec92209774df71f57e518bbd86f2c1.tar.xz
Draft for Cinder readonly policy
Change-Id: I9c4b09484f63508d616b0d2b94700831362a4664
-rw-r--r--etc/cinder/policy.json250
1 files changed, 126 insertions, 124 deletions
diff --git a/etc/cinder/policy.json b/etc/cinder/policy.json
index 8818372..41bdade 100644
--- a/etc/cinder/policy.json
+++ b/etc/cinder/policy.json
@@ -1,103 +1,105 @@
{
- "context_is_admin": "role:admin",
- "admin_or_owner": "is_admin:True or project_id:%(project_id)s",
- "default": "rule:admin_or_owner",
-
- "admin_api": "is_admin:True",
-
- "volume:create": "",
- "volume:delete": "rule:admin_or_owner",
- "volume:get": "rule:admin_or_owner",
- "volume:get_all": "rule:admin_or_owner",
- "volume:get_volume_metadata": "rule:admin_or_owner",
- "volume:create_volume_metadata": "rule:admin_or_owner",
- "volume:delete_volume_metadata": "rule:admin_or_owner",
- "volume:update_volume_metadata": "rule:admin_or_owner",
- "volume:get_volume_admin_metadata": "rule:admin_api",
- "volume:update_volume_admin_metadata": "rule:admin_api",
- "volume:get_snapshot": "rule:admin_or_owner",
- "volume:get_all_snapshots": "rule:admin_or_owner",
- "volume:create_snapshot": "rule:admin_or_owner",
- "volume:delete_snapshot": "rule:admin_or_owner",
- "volume:update_snapshot": "rule:admin_or_owner",
- "volume:get_snapshot_metadata": "rule:admin_or_owner",
- "volume:delete_snapshot_metadata": "rule:admin_or_owner",
- "volume:update_snapshot_metadata": "rule:admin_or_owner",
- "volume:extend": "rule:admin_or_owner",
- "volume:update_readonly_flag": "rule:admin_or_owner",
- "volume:retype": "rule:admin_or_owner",
- "volume:update": "rule:admin_or_owner",
-
- "volume_extension:types_manage": "rule:admin_api",
- "volume_extension:types_extra_specs": "rule:admin_api",
- "volume_extension:access_types_qos_specs_id": "rule:admin_api",
- "volume_extension:access_types_extra_specs": "rule:admin_api",
- "volume_extension:volume_type_access": "rule:admin_or_owner",
- "volume_extension:volume_type_access:addProjectAccess": "rule:admin_api",
- "volume_extension:volume_type_access:removeProjectAccess": "rule:admin_api",
- "volume_extension:volume_type_encryption": "rule:admin_api",
- "volume_extension:volume_encryption_metadata": "rule:admin_or_owner",
- "volume_extension:extended_snapshot_attributes": "rule:admin_or_owner",
- "volume_extension:volume_image_metadata": "rule:admin_or_owner",
-
- "volume_extension:quotas:show": "",
- "volume_extension:quotas:update": "rule:admin_api",
- "volume_extension:quotas:delete": "rule:admin_api",
- "volume_extension:quota_classes": "rule:admin_api",
- "volume_extension:quota_classes:validate_setup_for_nested_quota_use": "rule:admin_api",
-
- "volume_extension:volume_admin_actions:reset_status": "rule:admin_api",
- "volume_extension:snapshot_admin_actions:reset_status": "rule:admin_api",
- "volume_extension:backup_admin_actions:reset_status": "rule:admin_api",
- "volume_extension:volume_admin_actions:force_delete": "rule:admin_api",
- "volume_extension:volume_admin_actions:force_detach": "rule:admin_api",
- "volume_extension:snapshot_admin_actions:force_delete": "rule:admin_api",
- "volume_extension:backup_admin_actions:force_delete": "rule:admin_api",
- "volume_extension:volume_admin_actions:migrate_volume": "rule:admin_api",
- "volume_extension:volume_admin_actions:migrate_volume_completion": "rule:admin_api",
-
- "volume_extension:volume_actions:upload_public": "rule:admin_api",
- "volume_extension:volume_actions:upload_image": "rule:admin_or_owner",
-
- "volume_extension:volume_host_attribute": "rule:admin_api",
- "volume_extension:volume_tenant_attribute": "rule:admin_or_owner",
- "volume_extension:volume_mig_status_attribute": "rule:admin_api",
- "volume_extension:hosts": "rule:admin_api",
- "volume_extension:services:index": "rule:admin_api",
- "volume_extension:services:update" : "rule:admin_api",
-
- "volume_extension:volume_manage": "rule:admin_api",
- "volume_extension:volume_unmanage": "rule:admin_api",
- "volume_extension:list_manageable": "rule:admin_api",
-
- "volume_extension:capabilities": "rule:admin_api",
-
- "volume:create_transfer": "rule:admin_or_owner",
- "volume:accept_transfer": "",
- "volume:delete_transfer": "rule:admin_or_owner",
- "volume:get_transfer": "rule:admin_or_owner",
- "volume:get_all_transfers": "rule:admin_or_owner",
-
- "volume_extension:replication:promote": "rule:admin_api",
- "volume_extension:replication:reenable": "rule:admin_api",
-
- "volume:failover_host": "rule:admin_api",
- "volume:freeze_host": "rule:admin_api",
- "volume:thaw_host": "rule:admin_api",
-
- "backup:create" : "",
- "backup:delete": "rule:admin_or_owner",
- "backup:get": "rule:admin_or_owner",
- "backup:get_all": "rule:admin_or_owner",
- "backup:restore": "rule:admin_or_owner",
- "backup:backup-import": "rule:admin_api",
- "backup:backup-export": "rule:admin_api",
- "backup:update": "rule:admin_or_owner",
-
- "snapshot_extension:snapshot_actions:update_snapshot_status": "",
- "snapshot_extension:snapshot_manage": "rule:admin_api",
- "snapshot_extension:snapshot_unmanage": "rule:admin_api",
- "snapshot_extension:list_manageable": "rule:admin_api",
+ "readonly": "(project_id:%(project_id)s and role:readonly)",
+ "_member_role": "(role:member or role:_member_)",
+ "member": "(project_id:%(project_id)s and rule:_member_role)",
+ "admin": "(is_admin:True or role:admin)",
+ "owner": "(user_id:%(user_id)s and rule:_member_role)",
+
+ "default": "rule:admin or rule:member",
+
+ "volume:create": "rule:admin or rule:member",
+ "volume:delete": "rule:admin or rule:member",
+ "volume:get": "rule:admin or rule:member or rule:readonly",
+ "volume:get_all": "rule:admin or rule:member or rule:readonly",
+ "volume:get_volume_metadata": "rule:admin or rule:member or rule:readonly",
+ "volume:create_volume_metadata": "rule:admin or rule:member",
+ "volume:delete_volume_metadata": "rule:admin or rule:member",
+ "volume:update_volume_metadata": "rule:admin or rule:member",
+ "volume:get_volume_admin_metadata": "rule:admin",
+ "volume:update_volume_admin_metadata": "rule:admin",
+ "volume:get_snapshot": "rule:admin or rule:member or rule:readonly",
+ "volume:get_all_snapshots": "rule:admin or rule:member or rule:readonly",
+ "volume:create_snapshot": "rule:admin or rule:member",
+ "volume:delete_snapshot": "rule:admin or rule:member",
+ "volume:update_snapshot": "rule:admin or rule:member",
+ "volume:get_snapshot_metadata": "rule:admin or rule:member or rule:readonly",
+ "volume:delete_snapshot_metadata": "rule:admin or rule:member",
+ "volume:update_snapshot_metadata": "rule:admin or rule:member",
+ "volume:extend": "rule:admin or rule:member",
+ "volume:update_readonly_flag": "rule:admin or rule:member",
+ "volume:retype": "rule:admin or rule:member",
+ "volume:update": "rule:admin or rule:member",
+
+ "volume_extension:types_manage": "rule:admin",
+ "volume_extension:types_extra_specs": "rule:admin",
+ "volume_extension:access_types_qos_specs_id": "rule:admin",
+ "volume_extension:access_types_extra_specs": "rule:admin",
+ "volume_extension:volume_type_access": "rule:admin or rule:member",
+ "volume_extension:volume_type_access:addProjectAccess": "rule:admin",
+ "volume_extension:volume_type_access:removeProjectAccess": "rule:admin",
+ "volume_extension:volume_type_encryption": "rule:admin",
+ "volume_extension:volume_encryption_metadata": "rule:admin or rule:member",
+ "volume_extension:extended_snapshot_attributes": "rule:admin or rule:member",
+ "volume_extension:volume_image_metadata": "rule:admin or rule:member or rule:readonly",
+
+ "volume_extension:quotas:show": "rule:admin or rule:member or rule:readonly",
+ "volume_extension:quotas:update": "rule:admin",
+ "volume_extension:quotas:delete": "rule:admin",
+ "volume_extension:quota_classes": "rule:admin",
+ "volume_extension:quota_classes:validate_setup_for_nested_quota_use": "rule:admin",
+
+ "volume_extension:volume_admin_actions:reset_status": "rule:admin",
+ "volume_extension:snapshot_admin_actions:reset_status": "rule:admin",
+ "volume_extension:backup_admin_actions:reset_status": "rule:admin",
+ "volume_extension:volume_admin_actions:force_delete": "rule:admin",
+ "volume_extension:volume_admin_actions:force_detach": "rule:admin",
+ "volume_extension:snapshot_admin_actions:force_delete": "rule:admin",
+ "volume_extension:backup_admin_actions:force_delete": "rule:admin",
+ "volume_extension:volume_admin_actions:migrate_volume": "rule:admin",
+ "volume_extension:volume_admin_actions:migrate_volume_completion": "rule:admin",
+
+ "volume_extension:volume_actions:upload_public": "rule:admin",
+ "volume_extension:volume_actions:upload_image": "rule:admin or rule:member",
+
+ "volume_extension:volume_host_attribute": "rule:admin",
+ "volume_extension:volume_tenant_attribute": "rule:admin or rule:member or rule:readonly",
+ "volume_extension:volume_mig_status_attribute": "rule:admin",
+ "volume_extension:hosts": "rule:admin or rule:readonly",
+ "volume_extension:services:index": "rule:admin or rule:readonly",
+ "volume_extension:services:update" : "rule:admin",
+
+ "volume_extension:volume_manage": "rule:admin",
+ "volume_extension:volume_unmanage": "rule:admin",
+ "volume_extension:list_manageable": "rule:admin",
+
+ "volume_extension:capabilities": "rule:admin or rule:readonly",
+
+ "volume:create_transfer": "rule:admin or rule:member",
+ "volume:accept_transfer": "rule:admin or rule:member",
+ "volume:delete_transfer": "rule:admin or rule:member",
+ "volume:get_transfer": "rule:admin or rule:member",
+ "volume:get_all_transfers": "rule:admin or rule:member",
+
+ "volume_extension:replication:promote": "rule:admin",
+ "volume_extension:replication:reenable": "rule:admin",
+
+ "volume:failover_host": "rule:admin",
+ "volume:freeze_host": "rule:admin",
+ "volume:thaw_host": "rule:admin",
+
+ "backup:create" : "rule:admin or rule:member",
+ "backup:delete": "rule:admin or rule:member",
+ "backup:get": "rule:admin or rule:member or rule:readonly",
+ "backup:get_all": "rule:admin or rule:member or rule:readonly",
+ "backup:restore": "rule:admin or rule:member",
+ "backup:backup-import": "rule:admin",
+ "backup:backup-export": "rule:admin",
+ "backup:update": "rule:admin or rule:member",
+
+ "snapshot_extension:snapshot_actions:update_snapshot_status": "rule:admin",
+ "snapshot_extension:snapshot_manage": "rule:admin",
+ "snapshot_extension:snapshot_unmanage": "rule:admin",
+ "snapshot_extension:list_manageable": "rule:admin",
"consistencygroup:create" : "group:nobody",
"consistencygroup:delete": "group:nobody",
@@ -110,29 +112,29 @@
"consistencygroup:get_cgsnapshot": "group:nobody",
"consistencygroup:get_all_cgsnapshots": "group:nobody",
- "group:group_types_manage": "rule:admin_api",
- "group:group_types_specs": "rule:admin_api",
- "group:access_group_types_specs": "rule:admin_api",
- "group:group_type_access": "rule:admin_or_owner",
-
- "group:create" : "",
- "group:delete": "rule:admin_or_owner",
- "group:update": "rule:admin_or_owner",
- "group:get": "rule:admin_or_owner",
- "group:get_all": "rule:admin_or_owner",
-
- "group:create_group_snapshot": "",
- "group:delete_group_snapshot": "rule:admin_or_owner",
- "group:update_group_snapshot": "rule:admin_or_owner",
- "group:get_group_snapshot": "rule:admin_or_owner",
- "group:get_all_group_snapshots": "rule:admin_or_owner",
-
- "scheduler_extension:scheduler_stats:get_pools" : "rule:admin_api",
- "message:delete": "rule:admin_or_owner",
- "message:get": "rule:admin_or_owner",
- "message:get_all": "rule:admin_or_owner",
-
- "clusters:get": "rule:admin_api",
- "clusters:get_all": "rule:admin_api",
- "clusters:update": "rule:admin_api"
+ "group:group_types_manage": "rule:admin",
+ "group:group_types_specs": "rule:admin",
+ "group:access_group_types_specs": "rule:admin",
+ "group:group_type_access": "rule:admin or rule:member",
+
+ "group:create" : "rule:admin or rule:member",
+ "group:delete": "rule:admin or rule:member",
+ "group:update": "rule:admin or rule:member",
+ "group:get": "rule:admin or rule:member",
+ "group:get_all": "rule:admin or rule:member",
+
+ "group:create_group_snapshot": "rule:admin or rule:member",
+ "group:delete_group_snapshot": "rule:admin or rule:member",
+ "group:update_group_snapshot": "rule:admin or rule:member",
+ "group:get_group_snapshot": "rule:admin or rule:member",
+ "group:get_all_group_snapshots": "rule:admin or rule:member",
+
+ "scheduler_extension:scheduler_stats:get_pools" : "rule:admin or rule:readonly",
+ "message:delete": "rule:admin or rule:member",
+ "message:get": "rule:admin or rule:member",
+ "message:get_all": "rule:admin or rule:member",
+
+ "clusters:get": "rule:admin",
+ "clusters:get_all": "rule:admin",
+ "clusters:update": "rule:admin"
}