mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-05-28 15:45:36 +00:00
Explain how to assign global roles to groups
This commit is contained in:
committed by
Denise Schannon
parent
86e57ae4a2
commit
1f0824553e
@@ -2,70 +2,166 @@
|
||||
title: Custom Roles
|
||||
weight: 1128
|
||||
aliases:
|
||||
- /rancher/v2.x/en/tasks/global-configuration/roles/
|
||||
- /rancher/v2.x/en/tasks/global-configuration/roles/
|
||||
---
|
||||
|
||||
Within Rancher, _roles_ determine what actions a user can make within a cluster or project.
|
||||
|
||||
Note that _roles_ are different from _permissions_, which determine what clusters and projects you can access.
|
||||
|
||||
>**Prerequisites:**
|
||||
>
|
||||
>To complete the tasks on this page, the following permissions are required:
|
||||
>
|
||||
>- [Administrator Global Permissions]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/global-permissions/).
|
||||
>- [Custom Global Permissions]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/global-permissions/#custom-global-permissions) with the [Manage Roles]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/global-permissions/#global-permissions-reference) role assigned.
|
||||
This section covers the following topics:
|
||||
|
||||
## Adding A Custom Role
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Creating a custom role for a cluster or project](#creating-a-custom-role-for-a-cluster-or-project)
|
||||
- [Creating a custom global role that inherits from an existing role](#creating-a-custom-global-role-that-inherits-from-an-existing-role)
|
||||
- [Creating a custom global role that does not inherit from another role](#creating-a-custom-global-role-that-does-not-inherit-from-another-role)
|
||||
- [Deleting a custom global role](#deleting-a-custom-global-role)
|
||||
- [Assigning a custom global role to a group](#assigning-a-custom-global-role-to-a-group)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To complete the tasks on this page, one of the following permissions are required:
|
||||
|
||||
- [Administrator Global Permissions]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/global-permissions/).
|
||||
- [Custom Global Permissions]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/global-permissions/#custom-global-permissions) with the [Manage Roles]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/global-permissions/#global-permissions-reference) role assigned.
|
||||
|
||||
## Creating A Custom Role for a Cluster or Project
|
||||
|
||||
While Rancher comes out-of-the-box with a set of default user roles, you can also create default custom roles to provide users with very specific permissions within Rancher.
|
||||
|
||||
1. From the **Global** view, select **Security > Roles** from the main menu.
|
||||
The steps to add custom roles differ depending on the version of Rancher.
|
||||
|
||||
1. **v2.0.7 and later only:** Select a tab to determine the scope of the roles you're adding. The tabs are:
|
||||
{{% tabs %}}
|
||||
{{% tab "Rancher v2.0.7+" %}}
|
||||
|
||||
- **Cluster**
|
||||
1. From the **Global** view, select **Security > Roles** from the main menu.
|
||||
|
||||
The role is valid for assignment when adding/managing members to _only_ clusters.
|
||||
1. Select a tab to determine the scope of the roles you're adding. The tabs are:
|
||||
|
||||
- **Project**
|
||||
- **Cluster:** The role is valid for assignment when adding/managing members to _only_ clusters.
|
||||
- **Project:** The role is valid for assignment when adding/managing members to _only_ projects.
|
||||
|
||||
The role is valid for assignment when adding/managing members to _only_ projects.
|
||||
1. Click **Add Cluster/Project Role.**
|
||||
|
||||
>**Note:** You cannot edit the Global tab.
|
||||
1. **Name** the role.
|
||||
|
||||
1. Click **Add Cluster/Project Role**.
|
||||
1. Optional: Choose the **Cluster/Project Creator Default** option to assign this role to a user when they create a new cluster or project. Using this feature, you can expand or restrict the default roles for cluster/project creators.
|
||||
|
||||
1. **Name** the role.
|
||||
> Out of the box, the Cluster Creator Default and the Project Creator Default roles are `Cluster Owner` and `Project Owner` respectively.
|
||||
|
||||
1. Choose whether to set the role to a status of [locked]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/locked-roles/).
|
||||
1. Use the **Grant Resources** options to assign individual [Kubernetes API endpoints](https://kubernetes.io/docs/reference/) to the role.
|
||||
|
||||
Locked roles cannot be assigned to users.
|
||||
> When viewing the resources associated with default roles created by Rancher, if there are multiple Kuberenetes API resources on one line item, the resource will have `(Custom)` appended to it. These are not custom resources but just an indication that there are multiple Kubernetes API resources as one resource.
|
||||
|
||||
1. **v2.0.7 and later only:** Choose a **Cluster/Project Creator Default** option setting. Use this option to set if the role is assigned to a user when they create a new cluster or project. Using this feature, you can expand or restrict the default roles for cluster/project creators.
|
||||
You can also choose the individual cURL methods (`Create`, `Delete`, `Get`, etc.) available for use with each endpoint you assign.
|
||||
|
||||
>**Note:** Out of the box, the Cluster Creator Default and the Project Creator Default roles are `Cluster Owner` and `Project Owner` respectively.
|
||||
1. Use the **Inherit from a Role** options to assign individual Rancher roles to your custom roles.
|
||||
|
||||
1. **v2.0.6 and earlier only:** Assign the role a **Context**. Context determines the scope of role assigned to the user. The contexts are:
|
||||
1. Click **Create**.
|
||||
|
||||
- **All**
|
||||
{{% /tab %}}
|
||||
{{% tab "Rancher prior to v2.0.7" %}}
|
||||
|
||||
The user can use their assigned role regardless of context. This role is valid for assignment when adding/managing members to clusters or projects.
|
||||
1. From the **Global** view, select **Security > Roles** from the main menu.
|
||||
|
||||
- **Cluster**
|
||||
1. Click **Add Cluster/Project Role**.
|
||||
|
||||
This role is valid for assignment when adding/managing members to _only_ clusters.
|
||||
1. **Name** the role.
|
||||
|
||||
- **Project**
|
||||
1. Choose whether to set the role to a status of [locked]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/locked-roles/).
|
||||
|
||||
This role is valid for assignment when adding/managing members to _only_ projects.
|
||||
> **Note:** Locked roles cannot be assigned to users.
|
||||
|
||||
6. Use the **Grant Resources** options to assign individual [Kubernetes API endpoints](https://kubernetes.io/docs/reference/) to the role.
|
||||
1. Assign the role a **Context**. Context determines the scope of role assigned to the user. The contexts are:
|
||||
|
||||
>**Note:** When viewing the resources associated with default roles created by Rancher, if there are multiple Kuberenetes API resources on one line item, the resource will have `(Custom)` appended to it. These are not custom resources but just an indication that there are multiple Kubernetes API resources as one resource.
|
||||
- **All:** The user can use their assigned role regardless of context. This role is valid for assignment when adding/managing members to clusters or projects.
|
||||
|
||||
You can also choose the individual cURL methods (`Create`, `Delete`, `Get`, etc.) available for use with each endpoint you assign.
|
||||
- **Cluster:** This role is valid for assignment when adding/managing members to _only_ clusters.
|
||||
|
||||
7. Use the **Inherit from a Role** options to assign individual Rancher roles to your custom roles.
|
||||
- **Project:** This role is valid for assignment when adding/managing members to _only_ projects.
|
||||
|
||||
8. Click **Create**.
|
||||
1. Use the **Grant Resources** options to assign individual [Kubernetes API endpoints](https://kubernetes.io/docs/reference/) to the role.
|
||||
|
||||
> When viewing the resources associated with default roles created by Rancher, if there are multiple Kuberenetes API resources on one line item, the resource will have `(Custom)` appended to it. These are not custom resources but just an indication that there are multiple Kubernetes API resources as one resource.
|
||||
|
||||
You can also choose the individual cURL methods (`Create`, `Delete`, `Get`, etc.) available for use with each endpoint you assign.
|
||||
|
||||
1. Use the **Inherit from a Role** options to assign individual Rancher roles to your custom roles.
|
||||
|
||||
1. Click **Create**.
|
||||
|
||||
{{% /tab %}}
|
||||
{{% /tabs %}}
|
||||
|
||||
## Creating a Custom Global Role that Inherits from an Existing Role
|
||||
|
||||
_Available as of v2.3.4_
|
||||
|
||||
If you have a group of individuals that need the same level of access in Rancher, it can save time to create a custom global role that inherits from another role, such as the administrator role, so that you only have to configure the variations between the new and existing roles.
|
||||
|
||||
The custom global role can then be assigned to a user or group so that the custom global role takes effect the first time the user or users sign into Rancher.
|
||||
|
||||
To create a custom global role based on an existing role,
|
||||
|
||||
1. Go to the **Global** view and click **Security > Roles.**
|
||||
1. On the **Global** tab, go to the role that the custom global role will be based on. Click **Ellipsis (…) > Clone.**
|
||||
Enter a name for the role.
|
||||
1. Optional: To assign the custom role default for new users, go to the **New User Default** section and click **Yes: Default role for new users.**
|
||||
1. In the **Grant Resources** section, select the Kubernetes resource operations that will be enabled for users with the custom role.
|
||||
1. Click **Save.**
|
||||
|
||||
## Creating a Custom Global Role that Does Not Inherit from Another Role
|
||||
|
||||
_Available as of v2.3.4_
|
||||
|
||||
Custom global roles don't have to be based on existing roles. To create a custom global role by choosing the specific Kubernetes resource operations that should be allowed for the role, follow these steps:
|
||||
|
||||
1. Go to the **Global** view and click **Security > Roles.**
|
||||
1. On the **Global** tab, click **Add Global Role.**
|
||||
1. Enter a name for the role.
|
||||
1. Optional: To assign the custom role default for new users, go to the **New User Default** section and click **Yes: Default role for new users.**
|
||||
1. In the **Grant Resources** section, select the Kubernetes resource operations that will be enabled for users with the custom role.
|
||||
1. Click **Save.**
|
||||
|
||||
## Deleting a Custom Global Role
|
||||
|
||||
_Available as of v2.3.4_
|
||||
|
||||
When deleting a custom global role, all global role bindings with this custom role are deleted.
|
||||
|
||||
If a user is only assigned one custom global role, and the role is deleted, the user would lose access to Rancher. For the user to regain access, an administrator would need to edit the user and apply new global permissions.
|
||||
|
||||
Custom global roles can be deleted, but built-in roles cannot be deleted.
|
||||
|
||||
To delete a custom global role,
|
||||
|
||||
1. Go to the **Global** view and click **Security > Roles.**
|
||||
2. On the **Global** tab, go to the custom global role that should be deleted and click **Ellipsis (…) > Delete.**
|
||||
3. Click **Delete.**
|
||||
|
||||
## Assigning a Custom Global Role to a Group
|
||||
|
||||
_Available as of v2.3.4_
|
||||
|
||||
If you have a group of individuals that need the same level of access in Rancher, it can save time to create a custom global role. When the role is assigned to a group, the users in the group have the appropriate level of access the first time they sign into Rancher.
|
||||
|
||||
When a user in the group logs in, they get the built-in Standard User global role by default. They will also get the permissions assigned to their groups.
|
||||
|
||||
If a user is removed from the external authentication provider group, they would lose their permissions from the custom global role that was assigned to the group. They would continue to have their individual Standard User role.
|
||||
|
||||
> **Prerequisites:** You can only assign a global role to a group if:
|
||||
>
|
||||
> * You have set up an [external authentication provider]({{<baseurl>}}/rancher/v2.x/en/admin-settings/authentication/#external-vs-local-authentication)
|
||||
> * The external authentication provider suppports [user groups]({{<baseurl>}}/rancher/v2.x/en/admin-settings/authentication/user-groups/)
|
||||
> * You have already set up at least one user group with the authentication provider
|
||||
|
||||
To assign a custom global role to a group, follow these steps:
|
||||
|
||||
1. From the **Global** view, go to **Security > Groups.**
|
||||
1. Click **Assign Global Role.**
|
||||
1. In the **Select Group To Add** field, choose the existing group that will be assigned the custom global role.
|
||||
1. In the **Custom** section, choose any custom global role that will be assigned to the group.
|
||||
1. Optional: In the **Global Permissions** or **Built-in** sections, select any additional permissions that the group should have.
|
||||
1. Click **Create.**
|
||||
|
||||
**Result:** The custom global role will take effect when the users in the group log into Rancher.
|
||||
@@ -7,43 +7,43 @@ _Permissions_ are individual access rights that you can assign when selecting a
|
||||
|
||||
Global Permissions define user authorization outside the scope of any particular cluster. Out-of-the-box, there are two default global permissions: `Administrator` and `Standard User`.
|
||||
|
||||
- **Administrator:**
|
||||
- **Administrator:** These users have full control over the entire Rancher system and all clusters within it.
|
||||
|
||||
These users have full control over the entire Rancher system and all clusters within it.
|
||||
- <a id="user"></a>**Standard User:** These users can create new clusters and use them. Standard users can also assign other users permissions to their clusters.
|
||||
|
||||
- <a id="user"></a>**Standard User:**
|
||||
You cannot update or delete the built-in Global Permissions.
|
||||
|
||||
These users can create new clusters and use them. Standard users can also assign other users permissions to their clusters.
|
||||
This section covers the following topics:
|
||||
|
||||
>**Note:** You cannot create, update, or delete Global Permissions.
|
||||
- [Global permission assignment](#global-permission-assignment)
|
||||
- [Custom global permissions](#custom-global-permissions)
|
||||
- [Custom global permissions reference](#custom-global-permissions-reference)
|
||||
- [Configuring default global permissions for new users](#configuring-default-global-permissions)
|
||||
- [Configuring global permissions for existing individual users](#configuring-global-permissions-for-existing-individual-users)
|
||||
- [Configuring global permissions for groups](#configuring-global-permissions-for-groups)
|
||||
|
||||
# Global Permission Assignment
|
||||
|
||||
Assignment of global permissions to a user depends on their authentication source: external or local.
|
||||
|
||||
- **External Authentication**
|
||||
|
||||
When a user logs into Rancher using an external authentication provider for the first time, they are automatically assigned the `Standard User` global permission.
|
||||
|
||||
- **Local Authentication**
|
||||
|
||||
When you create a new local user, you assign them a global permission as you complete the **Add User** form.
|
||||
- **External Authentication:** When a user logs into Rancher using an external authentication provider for the first time, they are automatically assigned the `Standard User` global permission.
|
||||
- **Local Authentication:** When you create a new local user, you assign them a global permission as you complete the **Add User** form.
|
||||
|
||||
# Custom Global Permissions
|
||||
|
||||
Using custom permissions is convenient for providing users with narrow or specialized access to Rancher.
|
||||
|
||||
When a user from an [external authentication source]({{< baseurl >}}/rancher/v2.x/en/admin-settings/authentication/) signs into Rancher for the first time, they're automatically assigned a set of global permissions (hereafter, permissions). By default, after a user logs in from the first time, they are created as a user and assigned the default `user` permission. The standard `user` permission allows users to login and create clusters.
|
||||
When a user from an [external authentication source]({{<baseurl>}}/rancher/v2.x/en/admin-settings/authentication/) signs into Rancher for the first time, they're automatically assigned a set of global permissions (hereafter, permissions). By default, after a user logs in from the first time, they are created as a user and assigned the default `user` permission. The standard `user` permission allows users to login and create clusters.
|
||||
|
||||
However, in some organizations, these permissions may extend too much access. Rather than assigning users the default global permissions of `Administrator` or `Standard User`, you can assign them a more restrictive set of custom global permissions.
|
||||
|
||||
The default roles, Administrator and Standard User, each come with multiple global permissions built into them. The Administrator role includes all global permissions, while the default user role includes three global permissions: Create Clusters, Use Catalog Templates, and User Base, which is equivalent to the minimum permission to log in to Rancher. In other words, the custom global permissions are modularized so that if you want to change the default user role permissions, you can choose which subset of global permissions are included in the new default user role.
|
||||
|
||||
Administrators can enforce custom global permissions in two ways:
|
||||
Administrators can enforce custom global permissions in multiple ways:
|
||||
|
||||
- Changing the [default permissions for new users](#configuring-default-global-permissions)
|
||||
|
||||
- Editing the [permissions of an existing user](#configuring-global-permissions-for-individual-users)
|
||||
- [Changing the default permissions for new users](#configuring-default-global-permissions)
|
||||
- [Editing the permissions of an existing user](#configuring-global-permissions-for-individual-users)
|
||||
- [Assigning a custom global permission to a group](#assigning-a-custom-global-permission-to-a-group)
|
||||
|
||||
### Custom Global Permissions Reference
|
||||
|
||||
@@ -62,25 +62,25 @@ The following table lists each custom global permission available and whether it
|
||||
| Manage Settings | ✓ | |
|
||||
| Manage Users | ✓ | |
|
||||
| Use Catalog Templates | ✓ | ✓ |
|
||||
| User Base* (Basic log-in access) | ✓ | ✓ |
|
||||
| User Base\* (Basic log-in access) | ✓ | ✓ |
|
||||
|
||||
> *This role has two names:
|
||||
> \*This role has two names:
|
||||
>
|
||||
> - When you go to the <b>Users</b> tab and edit a user's global role, this role is called <b>Login Access</b> in the custom global permissions list.
|
||||
> - When you go to the <b>Security</b> tab and edit the roles from the roles page, this role is called <b>User Base.</b>
|
||||
|
||||
For details on which Kubernetes resources correspond to each global permission, you can go to the **Global** view in the Rancher UI. Then click **Security > Roles** and go to the **Global** tab. If you click an individual role, you can refer to the **Grant Resources** table to see all of the operations and resources that are permitted by the role.
|
||||
|
||||
> **Notes:**
|
||||
> **Notes:**
|
||||
>
|
||||
>- Each permission listed above is comprised of multiple individual permissions not listed in the Rancher UI. For a full list of these permissions and the rules they are comprised of, access through the API at `/v3/globalRoles`.
|
||||
>- When viewing the resources associated with default roles created by Rancher, if there are multiple Kuberenetes API resources on one line item, the resource will have `(Custom)` appended to it. These are not custom resources but just an indication that there are multiple Kubernetes API resources as one resource.
|
||||
> - Each permission listed above is comprised of multiple individual permissions not listed in the Rancher UI. For a full list of these permissions and the rules they are comprised of, access through the API at `/v3/globalRoles`.
|
||||
> - When viewing the resources associated with default roles created by Rancher, if there are multiple Kuberenetes API resources on one line item, the resource will have `(Custom)` appended to it. These are not custom resources but just an indication that there are multiple Kubernetes API resources as one resource.
|
||||
|
||||
### Configuring Default Global Permissions
|
||||
|
||||
If you want to restrict the default permissions for new users, you can remove the `user` permission as default role and then assign multiple individual permissions as default instead. Conversely, you can also add administrative permissions on top of a set of other standard permissions.
|
||||
|
||||
>**Note:** Default roles are only assigned to users added from an external authentication provider. For local users, you must explicitly assign global permissions when adding a user to Rancher. You can customize these global permissions when adding the user.
|
||||
> **Note:** Default roles are only assigned to users added from an external authentication provider. For local users, you must explicitly assign global permissions when adding a user to Rancher. You can customize these global permissions when adding the user.
|
||||
|
||||
To change the default global permissions that are assigned to external users upon their first log in, follow these steps:
|
||||
|
||||
@@ -94,7 +94,7 @@ To change the default global permissions that are assigned to external users upo
|
||||
|
||||
**Result:** The default global permissions are configured based on your changes. Permissions assigned to new users display a check in the **New User Default** column.
|
||||
|
||||
### Configuring Global Permissions for Individual Users
|
||||
### Configuring Global Permissions for Existing Individual Users
|
||||
|
||||
To configure permission for a user,
|
||||
|
||||
@@ -109,3 +109,29 @@ To configure permission for a user,
|
||||
1. Click **Save.**
|
||||
|
||||
> **Result:** The user's global permissions have been updated.
|
||||
|
||||
### Configuring Global Permissions for Groups
|
||||
|
||||
_Available as of v2.3.4_
|
||||
|
||||
If you have a group of individuals that need the same level of access in Rancher, in can save time to assign permissions to the entire group at once, so that the users in the group have the appropriate level of access the first time they sign into Rancher.
|
||||
|
||||
When a user in the group logs in, they will get the built-in Standard User global role by default. They will also get the permissions assigned to their groups.
|
||||
|
||||
If a user is removed from the external authentication provider group, they would lose their permissions from the custom global role that was assigned to the group. They would continue to have their individual Standard User role.
|
||||
|
||||
> **Prerequisites:** You can only assign a global role to a group if:
|
||||
>
|
||||
> * You have set up an [external authentication provider]({{<baseurl>}}/rancher/v2.x/en/admin-settings/authentication/#external-vs-local-authentication)
|
||||
> * The external authentication provider suppports [user groups]({{<baseurl>}}/rancher/v2.x/en/admin-settings/authentication/user-groups/)
|
||||
> * You have already set up at least one user group with the authentication provider
|
||||
|
||||
To assign a custom global role to a group, follow these steps:
|
||||
|
||||
1. From the **Global** view, go to **Security > Groups.**
|
||||
1. Click **Assign Global Role.**
|
||||
1. In the **Select Group To Add** field, choose the existing group that will be assigned the custom global role.
|
||||
1. In the **Global Permissions,** **Custom,** and/or **Built-in** sections, select the permissions that the group should have.
|
||||
1. Click **Create.**
|
||||
|
||||
**Result:** The custom global role will take effect when the users in the group log into Rancher.
|
||||
Reference in New Issue
Block a user