| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 1 | # Copyright 2018 Whitestack, LLC |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | # |
| 15 | # For those usages not covered by the Apache License, Version 2.0 please |
| 16 | # contact: esousa@whitestack.com or glavado@whitestack.com |
| 17 | ## |
| 18 | |
| 19 | --- |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 20 | roles: |
| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 21 | |
| 22 | ## |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 23 | # This file defines the mapping between user roles and operation permissions. |
| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 24 | # It uses the following pattern: |
| 25 | # |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 26 | # - name: <ROLE_NAME> |
| 27 | # permissions: |
| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 28 | # "<OPERATION>": true | false |
| 29 | # |
| 30 | # <ROLE_NAME> defines the name of the role. This name will be matched with an |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 31 | # existing role in the RBAC system (e.g. keystone). |
| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 32 | # |
| 33 | # NOTE: The role will only be used if there is an existing match. If there |
| 34 | # isn't a role in the system that can be matched, the operation permissions |
| 35 | # won't yield any result. |
| 36 | # |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 37 | # permissions: is a dictionary of operation permissions for the role. An operation |
| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 38 | # permission is defined using the following pattern: |
| 39 | # |
| 40 | # "<OPERATION>": true | false |
| 41 | # |
| 42 | # The operations are defined using an hierarchical tree. For this purpose, an |
| 43 | # <OPERATION> tag can represents the path for the following: |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 44 | # - default: what action to be taken by default, allow or deny |
| 45 | # - admin: allow or deny usin querey string ADMIN to act on behalf of other project |
| 46 | # - colon separated hierarchical tree |
| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 47 | # |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 48 | # The default and admin <OPERATION> tag is considered false if missing. |
| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 49 | # When you use this tag, all the operation permissions will be set to the value |
| 50 | # assigned. |
| 51 | # NOTE 1: The default value is false. So if a value isn't specified, it will |
| 52 | # default to false. |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 53 | # NOTE 2: The default <OPERATION> tag can be overridden by using more specific tags |
| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 54 | # with a different value. |
| 55 | # |
| 56 | # The node <OPERATION> tag is defined by using an internal node of the tree, i.e. |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 57 | # "nsds", "users:id". A node <OPERATION> tag will affect all the nodes and leafs |
| 58 | # beneath it. It can be used to override a default <OPERATION> tag. |
| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 59 | # NOTE 1: It can be overridden by using a more specific tag, such as a node which |
| 60 | # is beneath it or a leaf. |
| 61 | # |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 62 | # The leaf <OPERATION> tag is defined by using a leaf of the tree, i.e. "users:post", |
| 63 | # "ns_instances:get", "vim_accounts:id:get". A leaf <OPERATION> tag will override all |
| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 64 | # the values defined by the parent nodes, since it is the more specific tag that can |
| 65 | # exist. |
| 66 | # |
| 67 | # General notes: |
| 68 | # - In order to find which tags are in use, check the resources_to_operations.yml. |
| 69 | # - In order to find which roles are in use, check the RBAC system. |
| 70 | # - Non existing tags will be ignored. |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 71 | # - Tags finishing in a colon will be ignored. |
| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 72 | # - The anonymous role allows to bypass the role definition for paths that |
| 73 | # shouldn't be verified. |
| 74 | ## |
| 75 | |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 76 | - name: "system_admin" |
| 77 | permissions: |
| 78 | default: true |
| 79 | admin: true |
| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 80 | |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 81 | - name: "account_manager" |
| 82 | permissions: |
| 83 | default: false |
| 84 | admin: false |
| 85 | tokens: true |
| 86 | users: true |
| 87 | projects: true |
| 88 | roles: true |
| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 89 | |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 90 | - name: "project_admin" |
| 91 | permissions: |
| 92 | default: true |
| 93 | # Users |
| 94 | users:post: false |
| tierno | 701018c | 2019-06-25 11:13:14 +0000 | [diff] [blame] | 95 | users:id:patch: false |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 96 | users:id:delete: false |
| 97 | users:id:put: false |
| 98 | # Projects |
| 99 | projects: false |
| 100 | # Roles |
| 101 | roles: false |
| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 102 | |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 103 | - name: "project_user" |
| 104 | permissions: |
| 105 | default: true |
| 106 | # NS Instances |
| 107 | ns_instances: false |
| 108 | ns_instances:get: true |
| 109 | # VNF Instances |
| 110 | vnf_instances: false |
| 111 | # Users |
| 112 | users: false |
| 113 | users:id:get: true |
| 114 | users:id:put: true |
| 115 | users:id:patch: true |
| 116 | # Projects |
| 117 | projects: false |
| 118 | # VIMs |
| 119 | vims: false |
| 120 | vims:get: true |
| 121 | vims:id:get: true |
| 122 | # VIM Accounts |
| 123 | vim_accounts: false |
| 124 | vim_accounts:get: true |
| 125 | vim_accounts:id:get: true |
| 126 | # SDN Controllers |
| 127 | sdn_controllers: false |
| 128 | sdn_controllers:get: true |
| 129 | sdn_controllers:id:get: true |
| 130 | # WIMs |
| 131 | wims: false |
| 132 | wims:get: true |
| 133 | wims:id:get: true |
| 134 | # WIM Accounts |
| 135 | wim_accounts: false |
| 136 | wim_accounts:get: true |
| 137 | wim_accounts:id:get: true |
| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 138 | |
| tierno | 1f029d8 | 2019-06-13 22:37:04 +0000 | [diff] [blame] | 139 | - name: "anonymous" |
| 140 | permissions: |