Skip to content
5 changes: 5 additions & 0 deletions assets/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,11 @@ html {
scrollbar-gutter: stable;
}

/* Auto-clickable for standalone images */
img:not(a img):not(.image-card-img):not([src*="#no-click"]) {
cursor: pointer;
}

/* Chroma syntax highlighting */

/* Background */
Expand Down
27 changes: 15 additions & 12 deletions content/operate/rs/security/access-control/create-cluster-roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,33 +51,33 @@ Here's a summary of the Cluster Manager UI actions permitted by each default man

You can use the [Cluster Manager UI](#create-roles-ui) or the [REST API](#define-roles-rest-api) to create a role that grants cluster access but does not grant access to any databases.

### Cluster Manager UI method {#create-roles-ui}
{{< multitabs id="create-cluster-role"
tab1="Cluster Manager UI"
tab2="REST API" >}}

To create a role that grants cluster access:
To create a role that grants cluster access using the Cluster Manager UI:

1. From **Access Control** > **Roles**, you can:

- Point to a role and select {{< image filename="/images/rs/buttons/edit-button.png#no-click" alt="The Edit button" width="25px" class="inline" >}} to edit an existing role.
- Select a role from the list of existing roles to edit it.

- Select **+ Add role** to create a new role.
- Click **+ Add role** to create a new role.

{{<image filename="images/rs/access-control-role-panel.png" alt="Add role with name" >}}
<img src="../../../../../images/rs/screenshots/access-control/7-22-updates/roles-screen.png" alt="Add role with name">

1. Enter a descriptive name for the role.

1. Choose a **Cluster management role** to determine cluster management permissions.
1. Choose a **Management role** to determine cluster management permissions.

{{<image filename="images/rs/screenshots/access-control/rbac-create-role-cluster-only.png" alt="Select a cluster management role to set the level of cluster management permissions for the new role." >}}
<img src="../../../../../images/rs/screenshots/access-control/7-22-updates/rbac-create-role-cluster-only.png" alt="Select a cluster management role to set the level of cluster management permissions for the new role.">

1. To prevent database access when using this role, do not add any ACLs.

1. Select **Save**.
1. Click **Save**.

You can [assign the new role to users]({{<relref "/operate/rs/security/access-control/create-users#assign-roles-to-users">}}) to grant cluster access.

### REST API method {#define-roles-rest-api}
-tab-sep-

To [create a role]({{<relref "/operate/rs/references/rest-api/requests/roles#post-role">}}) that grants cluster access:
To [create a role]({{<relref "/operate/rs/references/rest-api/requests/roles#post-role">}}) that grants cluster access using the REST API:

```sh
POST /v1/roles
Expand All @@ -86,3 +86,6 @@ POST /v1/roles
"management": "db_viewer | db_member | cluster_viewer | cluster_member | user_manager | admin"
}
```
{{< /multitabs >}}

You can [assign the new role to users]({{<relref "/operate/rs/security/access-control/create-users#assign-roles-to-users">}}) to grant cluster access.
131 changes: 61 additions & 70 deletions content/operate/rs/security/access-control/create-combined-roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,31 @@ To create a role that grants database access privileges and allows access to the

1. [Define Redis ACLs](#define-redis-acls) that determine database access privileges.

1. [Create a role with ACLs](#create-role) added and choose a **Cluster management role** other than **None**.
1. [Create a role with ACLs](#create-role) added and choose a **Management role** other than **None**.

## Define Redis ACLs

You can use the [Cluster Manager UI](#define-acls-ui) or the [REST API](#define-acls-rest-api) to define Redis ACL rules that you can assign to roles.

### Cluster Manager UI method {#define-acls-ui}
{{< multitabs id="define-redis-acls"
tab1="Cluster Manager UI"
tab2="REST API" >}}

To define a Redis ACL rule using the Cluster Manager UI:

1. From **Access Control > Redis ACLs**, you can either:
1. From **Access Control > Roles > Data ACLs**, you can either:

- Point to a Redis ACL and select {{< image filename="/images/rs/buttons/edit-button.png#no-click" alt="The Edit button" width="25px" class="inline" >}} to edit an existing Redis ACL.
- Select an existing Redis ACL from the list to edit it.

- Select **+ Add Redis ACL** to create a new Redis ACL.
- Click **+ Add Redis ACL** to create a new Redis ACL.

1. Enter a descriptive name for the Redis ACL. This will be used to associate the ACL rule with the role.

1. Define the ACL rule. For more information about Redis ACL rules and syntax, see the [Redis ACL overview]({{<relref "/operate/rs/security/access-control/redis-acl-overview">}}).

{{<note>}}
The **ACL builder** does not support selectors and key permissions. Use **Free text command** to manually define them instead.
{{</note>}}
1. Click **Save**.

1. Select **Save**.

{{<note>}}
For multi-key commands on multi-slot keys, the return value is `failure`, but the command runs on the keys that are allowed.
{{</note>}}

### REST API method {#define-acls-rest-api}
-tab-sep-

To define a Redis ACL rule using the REST API, use a [create Redis ACL]({{<relref "/operate/rs/references/rest-api/requests/redis_acls#post-redis_acl">}}) request. For more information about Redis ACL rules and syntax, see the [Redis ACL overview]({{<relref "/operate/rs/security/access-control/redis-acl-overview">}}).

Expand All @@ -68,92 +62,89 @@ Example response body:
}
```

To associate the Redis ACL with a role and database, use the `uid` from the response as the `redis_acl_uid` when you add `roles_permissions` to the database. See [Associate a database with roles and Redis ACLs](#associate-roles-acls-rest-api) for an example request.
To associate the Redis ACL with a role and database, use the `uid` from the response as the `redis_acl_uid` when you add `roles_permissions` to the database.

{{< /multitabs >}}

{{<note>}}
For multi-key commands on multi-slot keys, the return value is `failure`, but the command runs on the keys that are allowed.
{{</note>}}

## Create roles with ACLs and cluster access {#create-role}

You can create a role that grants database access privileges and allows access to the Cluster Management UI and REST API.

### Cluster Manager UI method {#create-roles-ui}
{{< multitabs id="create-combined-roles"
tab1="Cluster Manager UI"
tab2="REST API" >}}

To define a role for combined access using the Cluster Manager UI:

1. From **Access Control** > **Roles**, you can:

- Point to a role and select {{< image filename="/images/rs/buttons/edit-button.png#no-click" alt="The Edit button" width="25px" class="inline" >}} to edit an existing role.
- Select a role from the list of existing roles to edit it.

- Select **+ Add role** to create a new role.
- Click **+ Add role** to create a new role.

{{<image filename="images/rs/access-control-role-panel.png" alt="Add role with name">}}
<img src="../../../../../images/rs/screenshots/access-control/7-22-updates/roles-screen.png" alt="Add role with name">

1. Enter a descriptive name for the role. This will be used to reference the role when configuring users.

1. Choose a **Cluster management role** other than **None**. For details about permissions granted by each role, see [Cluster Manager UI permissions]({{<relref "/operate/rs/security/access-control/create-cluster-roles#cluster-manager-ui-permissions">}}) and [REST API permissions]({{<relref "/operate/rs/references/rest-api/permissions">}}).
1. Choose a **Management role** other than **None**. For details about permissions granted by each role, see [Cluster Manager UI permissions]({{<relref "/operate/rs/security/access-control/create-cluster-roles#cluster-manager-ui-permissions">}}) and [REST API permissions]({{<relref "/operate/rs/references/rest-api/permissions">}}).

{{<image filename="images/rs/screenshots/access-control/rbac-create-combined-role-select-cm-role.png" alt="Add role with name">}}
<img src="../../../../../images/rs/screenshots/access-control/7-22-updates/create-role-combined-access-select-management-role.png" alt="Add role with name">

1. Select **+ Add ACL**.

{{<image filename="images/rs/access-control-role-acl.png" alt="Add role database acl">}}
1. Click **+ Add ACL**.

1. Choose a Redis ACL and databases to associate with the role.

{{<image filename="images/rs/screenshots/access-control/access-control-role-databases.png" alt="Add databases to access">}}

1. Select the check mark {{< image filename="/images/rs/buttons/checkmark-button.png#no-click" alt="The Check button" width="25px" class="inline" >}} to confirm.
<img src="../../../../../images/rs/screenshots/access-control/7-22-updates/create-role-combined-access-select-db.png" alt="Add databases to access">

1. Select **Save**.
1. Click the check mark to confirm.

{{<image filename="images/rs/screenshots/access-control/rbac-save-combined-role.png" alt="Add databases to access">}}

You can [assign the new role to users]({{<relref "/operate/rs/security/access-control/create-users#assign-roles-to-users">}}) to grant database access and access to the Cluster Manager UI and REST API.
1. Click **Save**.

### REST API method {#define-roles-rest-api}
-tab-sep-

To define a role for combined access using the REST API:

1. [Create a role.](#create-role-rest-api)

1. [Associate a database with roles and Redis ACLs.](#associate-roles-acls-rest-api)

#### Create a role {#create-role-rest-api}

To [create a role]({{<relref "/operate/rs/references/rest-api/requests/roles#post-role">}}) using the REST API:

```sh
POST /v1/roles
{
"name": "<role-name>",
"management": "db_viewer | db_member | cluster_viewer | cluster_member | admin"
}
```
1. Use a [create role]({{<relref "/operate/rs/references/rest-api/requests/roles#post-role">}}) request:

Example response body:

```json
{
"management": "admin",
"name": "<role-name>",
"uid": 7
}
```
```sh
POST /v1/roles
{
"name": "<role-name>",
"management": "db_viewer | db_member | cluster_viewer | cluster_member | admin"
}
```

To associate the role with a Redis ACL and database, use the `uid` from the response as the `role_uid` when you add `roles_permissions` to the database. See [Associate a database with roles and Redis ACLs](#associate-roles-acls-rest-api) for an example request.
Example response body:

```json
{
"management": "admin",
"name": "<role-name>",
"uid": 7
}
```

#### Associate a database with roles and Redis ACLs {#associate-roles-acls-rest-api}
To associate the role with a Redis ACL and database, use the `uid` from the response as the `role_uid` when you add `roles_permissions` to the database.

[Update a database's configuration]({{<relref "/operate/rs/references/rest-api/requests/bdbs#put-bdbs">}}) to add `roles_permissions` with the role and Redis ACL:
2. [Update a database's configuration]({{<relref "/operate/rs/references/rest-api/requests/bdbs#put-bdbs">}}) to add `roles_permissions` with the role and Redis ACL:

```sh
POST /v1/bdbs/<database-id>
{
"roles_permissions":
[
```sh
POST /v1/bdbs/<database-id>
{
"role_uid": <integer>,
"redis_acl_uid": <integer>
"roles_permissions":
[
{
"role_uid": <integer>,
"redis_acl_uid": <integer>
}
]
}
]
}
```
```

{{< /multitabs >}}

You can [assign the new role to users]({{<relref "/operate/rs/security/access-control/create-users#assign-roles-to-users">}}) to grant database access and access to the Cluster Manager UI and REST API.
Loading