You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
keywords: [ClickHouse Cloud, Access Control, User Management, RBAC, Security]
6
7
---
7
8
8
9
# Creating Users and Roles in ClickHouse
@@ -31,10 +32,10 @@ You can’t manage the same access entity by both configuration methods simultan
31
32
:::
32
33
33
34
:::note
34
-
If you are looking to manage ClickHouse Cloud Console users, please refer to this [page](https://clickhouse.com/docs/en/security/cloud-access-management.md)
35
+
If you are looking to manage ClickHouse Cloud Console users, please refer to this [page](/docs/en/cloud/security/cloud-access-management)
35
36
:::
36
37
37
-
To see all users, roles, profiles, etc. and all their grants use [SHOW ACCESS](/docs/en/sql-reference/statements/show.md#show-access-statement) statement.
38
+
To see all users, roles, profiles, etc. and all their grants use [`SHOW ACCESS`](/docs/en/sql-reference/statements/show.md#show-access-statement) statement.
38
39
39
40
## Overview {#access-control-usage}
40
41
@@ -49,16 +50,16 @@ If you just started using ClickHouse, consider the following scenario:
49
50
### Properties of Current Solution {#access-control-properties}
50
51
51
52
- You can grant permissions for databases and tables even if they do not exist.
52
-
- If a table was deleted, all the privileges that correspond to this table are not revoked. This means that even if you create a new table with the same name later, all the privileges remain valid. To revoke privileges corresponding to the deleted table, you need to execute, for example, the `REVOKE ALL PRIVILEGES ON db.table FROM ALL` query.
53
+
- If a table is deleted, all the privileges that correspond to this table are not revoked. This means that even if you create a new table with the same name later, all the privileges remain valid. To revoke privileges corresponding to the deleted table, you need to execute, for example, the `REVOKE ALL PRIVILEGES ON db.table FROM ALL` query.
53
54
- There are no lifetime settings for privileges.
54
55
55
56
### User Account {#user-account-management}
56
57
57
58
A user account is an access entity that allows to authorize someone in ClickHouse. A user account contains:
58
59
59
60
- Identification information.
60
-
-[Privileges](/docs/en/sql-reference/statements/grant.md#privileges) that define a scope of queries the user can execute.
61
-
- Hosts allowed to connect to the ClickHouse server.
61
+
-[Privileges](/docs/en/sql-reference/statements/grant.md#privileges) that define the scope of queries the user can execute.
62
+
- Hosts are allowed to connect to the ClickHouse server.
62
63
- Assigned and default roles.
63
64
- Settings with their constraints applied by default at user login.
64
65
- Assigned settings profiles.
@@ -78,15 +79,15 @@ Management queries:
78
79
Settings can be configured differently: for a user account, in its granted roles and in settings profiles. At user login, if a setting is configured for different access entities, the value and constraints of this setting are applied as follows (from higher to lower priority):
79
80
80
81
1. User account settings.
81
-
2. The settings of default roles of the user account. If a setting is configured in some roles, then order of the setting application is undefined.
82
+
2. The settings for the default roles of the user account. If a setting is configured in some roles, then order of the setting application is undefined.
82
83
3. The settings from settings profiles assigned to a user or to its default roles. If a setting is configured in some profiles, then order of setting application is undefined.
83
-
4. Settings applied to all the server by default or from the [default profile](/docs/en/operations/server-configuration-parameters/settings.md#default-profile).
84
+
4. Settings applied to the entire server by default or from the [default profile](/docs/en/operations/server-configuration-parameters/settings.md#default-profile).
84
85
85
86
### Role {#role-management}
86
87
87
-
Role is a container for access entities that can be granted to a user account.
88
+
A role is a container for access entities that can be granted to a user account.
@@ -109,7 +110,7 @@ Privileges can be granted to a role by the [GRANT](/docs/en/sql-reference/statem
109
110
Row policy is a filter that defines which of the rows are available to a user or a role. Row policy contains filters for one particular table, as well as a list of roles and/or users which should use this row policy.
110
111
111
112
:::note
112
-
Row policies makes sense only for users with readonly access. If user can modify table or copy partitions between tables, it defeats the restrictions of row policies.
113
+
Row policies makes sense only for users with readonly access. If users can modify table or copy partitions between tables, it defeats the restrictions of row policies.
113
114
:::
114
115
115
116
Management queries:
@@ -149,7 +150,7 @@ Management queries:
149
150
150
151
### Enabling SQL-driven Access Control and Account Management {#enabling-access-control}
151
152
152
-
- Setup a directory for configurations storage.
153
+
- Setup a directory for configuration storage.
153
154
154
155
ClickHouse stores access entity configurations in the folder set in the [access_control_path](/docs/en/operations/server-configuration-parameters/settings.md#access_control_path) server configuration parameter.
155
156
@@ -161,7 +162,7 @@ Management queries:
161
162
## Defining SQL Users and Roles
162
163
163
164
:::tip
164
-
If you are working in ClickHouse Cloud please see [Cloud access management](/docs/en/cloud/security/cloud-access-management).
165
+
If you are working in ClickHouse Cloud, please see [Cloud access management](/docs/en/cloud/security/cloud-access-management).
165
166
:::
166
167
167
168
This article shows the basics of defining SQL users and roles and applying those privileges and permissions to databases, tables, rows, and columns.
@@ -177,9 +178,9 @@ This article shows the basics of defining SQL users and roles and applying those
177
178
```
178
179
179
180
:::note
180
-
The `default` user is the only user that gets created with a fresh install and is also the account used for internode communications, by default.
181
+
The `default` user is the only user that gets created with a fresh install, and is also the account used for internode communications, by default.
181
182
182
-
In production, it is recommended to disable this user once the inter-node communication has been configured with a SQL admin user and inter-node communications have been set with `<secret>`, cluster credentials, and/or internode HTTP and transport protocol credentials since the `default` account is used for internode communication.
183
+
In production, it is recommended to disable this user once the inter-node communication has been configured with a SQL admin user and internode communications have been set with `<secret>`, cluster credentials, and/or internode HTTP and transport protocol credentials since the `default` account is used for internode communication.
183
184
:::
184
185
185
186
2. Restart the nodes to apply the changes.
@@ -237,7 +238,7 @@ For example:
237
238
```sql
238
239
GRANT ALTER ON my_db.* WITH GRANT OPTION
239
240
```
240
-
In order to GRANT or REVOKE privileges the user must have those privileges themselves first.
241
+
To `GRANT` or `REVOKE` privileges, the user must have those privileges themselves first.
0 commit comments