Skip to content

Commit 11ab80b

Browse files
committed
SysView Auth Documentation (en) (#15413)
1 parent f23d4ea commit 11ab80b

File tree

2 files changed

+121
-10
lines changed

2 files changed

+121
-10
lines changed

ydb/docs/en/core/concepts/glossary.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@ An access subject can be a [user](#access-user) or a [group](#access-group).
280280

281281
An **[access right](../security/authorization.md#right)** is an entity that represents permission for an [access subject](#access-subject) to perform a specific set of operations in a cluster or database on a specific [access object](#access-object).
282282

283+
### Access right inheritance {#access-right-inheritance}
284+
285+
**Access right inheritance** refers to the mechanism by which [access rights](#access-right) are automatically passed down from parent [access objects](#access-object) to child access objects within a database structure. This ensures that permissions granted at a higher level in the hierarchy are applied to all sub-levels beneath it, unless [explicitly overridden](../reference/ydb-cli/commands/scheme-permissions.md#clear-inheritance).
286+
283287
### Access control list {#access-control-list}
284288

285289
An **access control list** or **ACL** is a list of all [rights](#access-right) granted to [access subjects](#access-subject) (users and groups) for a specific [access object](#access-object).

ydb/docs/en/core/dev/system-views.md

Lines changed: 117 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ DB system views contain:
1010
* [Top queries by certain characteristics](#top-queries).
1111
* [Query details](#query-metrics).
1212
* [History of overloaded partitions](#top-overload-partitions).
13+
* [Access control entities](#auth).
1314

1415
{% note info %}
1516

@@ -29,8 +30,8 @@ Cumulative fields (`RowReads`, `RowUpdates`, and so on) store the accumulated va
2930

3031
Table structure:
3132

32-
| Field | Description |
33-
| --- | --- |
33+
| Column | Description |
34+
|--------|-------------|
3435
| `OwnerId` | ID of the SchemeShard serving the table.<br/>Type: `Uint64`.<br/>Key: `0`. |
3536
| `PathId` | ID of the SchemeShard path.<br/>Type: `Uint64`.<br/>Key: `1`. |
3637
| `PartIdx` | Partition sequence number.<br/>Type: `Uint64`.<br/>Key: `2`. |
@@ -99,10 +100,10 @@ Fields that provide information about the used CPU time (...`CPUTime`) are expre
99100

100101
Query text limit is 4 KB.
101102

102-
All tables have the same set of fields:
103+
All tables have the same structure:
103104

104-
| Field | Description |
105-
| --- | --- |
105+
| Column | Description |
106+
|--------|-------------|
106107
| `IntervalEnd` | The end of a one-minute or one-hour interval.<br/>Type: `Timestamp`.<br/>Key: `0`. |
107108
| `Rank` | Rank of a top query.<br/>Type: `Uint32`.<br/>Key: `1`. |
108109
| `QueryText` | Query text.<br/>Type: `Utf8`. |
@@ -180,8 +181,8 @@ Restrictions:
180181

181182
Table structure:
182183

183-
| Field | Description |
184-
| ---|--- |
184+
| Column | Description |
185+
|--------|-------------|
185186
| `IntervalEnd` | The end of a one-minute interval.<br/>Type: `Timestamp`.<br/>Key: `0`. |
186187
| `Rank` | Query rank within an interval (by the SumCPUTime field).<br/>Type: `Uint32`.<br/>Key: `1`. |
187188
| `QueryText` | Query text.<br/>Type: `Utf8`. |
@@ -250,10 +251,10 @@ The following system views (tables) store the history of points in time when the
250251

251252
These tables contain partitions with peak loads of more than 70% (`CPUCores` > 0.7). Partitions within a single interval are ranked by peak load value.
252253

253-
Both tables have the same set of fields:
254+
All tables have the same structure:
254255

255-
| Field | Description |
256-
| --- | --- |
256+
| Column | Description |
257+
|--------|-------------|
257258
| `IntervalEnd` | The end of a one-minute or one-hour interval.<br/>Type: `Timestamp`.<br/>Key: `0`. |
258259
| `Rank` | Partition rank within an interval (by CPUCores).<br/>Type: `Uint32`.<br/>Key: `1`. |
259260
| `TabletId` | ID of the tablet serving the partition.<br/>Type: `Uint64`. |
@@ -301,3 +302,109 @@ ORDER BY IntervalEnd desc, CPUCores desc
301302
```
302303

303304
* `"YYYY-MM-DDTHH:MM:SS.UUUUUUZ"`: Time in the UTC 0 zone (`YYYY` stands for year, `MM`, for month, `DD`, for date, `hh`, for hours, `mm`, for minutes, `ss`, for seconds, and `uuuuuu`, for microseconds). For example, `"2023-01-26T13:00:00.000000Z"`.
305+
306+
## Access control entities {#auth}
307+
308+
The following system views store data for analyzing various [access control entities](../security/authorization.md).
309+
310+
### Auth users
311+
312+
The `auth_users` view lists internal {{ ydb-short-name }} [users](../concepts/glossary.md#access-user). It does not include users authenticated through external systems such as LDAP.
313+
314+
This view can be fully accessed by administrators, while regular users can only view their own details.
315+
316+
Table structure:
317+
318+
| Column | Description |
319+
|--------|-------------|
320+
| `Sid` | [SID](../concepts/glossary.md#sid) of the user.<br />Type: `Utf8`.<br />Key: `0`. |
321+
| `IsEnabled` | Indicates if login is allowed; used for explicit administrator block. Independent of `IsLockedOut`.<br />Type: `Bool`. |
322+
| `IsLockedOut` | Automatically locked out due to exceeding failed login attempts. Independent of `IsEnabled`.<br />Type: `Bool`. |
323+
| `CreatedAt` | Timestamp of user creation.<br />Type: `Timestamp`. |
324+
| `LastSuccessfulAttemptAt` | Timestamp of the last successful login attempt.<br />Type: `Timestamp`. |
325+
| `LastFailedAttemptAt` | Timestamp of the last failed login attempt.<br />Type: `Timestamp`. |
326+
| `FailedAttemptCount` | Number of failed login attempts.<br />Type: `Uint32`. |
327+
| `PasswordHash` | JSON string containing password hash, salt, and hash algorithm.<br />Type: `Utf8`. |
328+
329+
### Auth groups
330+
331+
The `auth_groups` view lists [access groups](../concepts/glossary.md#access-group).
332+
333+
This view can be accessed only by administrators.
334+
335+
Table structure:
336+
337+
| Column | Description |
338+
|--------|-------------|
339+
| `Sid` | [SID](../concepts/glossary.md#sid) of the group.<br />Type: `Utf8`.<br />Key: `0`. |
340+
341+
### Auth group members
342+
343+
The `auth_group_members` view lists membership details within [access groups](../concepts/glossary.md#access-group).
344+
345+
This view can be accessed only by administrators.
346+
347+
Table structure:
348+
349+
| Column | Description |
350+
|--------|-------------|
351+
| `GroupSid` | SID of the group.<br />Type: `Utf8`.<br />Key: `0`. |
352+
| `MemberSid` | SID of the group member.<br />Type: `Utf8`.<br />Key: `1`. |
353+
354+
### Auth permissions
355+
356+
The auth permissions views list assigned [access rights](../concepts/glossary.md#access-right).
357+
358+
Contains two views:
359+
360+
* `auth_permissions`: Directly assigned access rights.
361+
* `auth_effective_permissions`: Effective access rights, accounting for [inheritance](../concepts/glossary.md#access-right-inheritance).
362+
363+
A user can view an [access object](../concepts/glossary.md#access-object) in the results if they have the `ydb.granular.describe_schema` permission on it.
364+
365+
Table structure:
366+
367+
| Column | Description |
368+
|--------|-------------|
369+
| `Path` | Path to the access object.<br />Type: `Utf8`.<br />Key: `0`. |
370+
| `Sid` | SID of the [access subject](../concepts/glossary.md#access-subject).<br />Type: `Utf8`.<br />Key: `1`. |
371+
| `Permission` | Name of the {{ ydb-short-name }} [access right](../yql/reference/syntax/grant.md#permissions-list).<br />Type: `Utf8`.<br />Key: `2`. |
372+
373+
#### Example queries
374+
375+
All the directly assigned permissions for the table located at the path `my_table`:
376+
377+
```yql
378+
SELECT *
379+
FROM `.sys/auth_permissions`
380+
WHERE Path = "my_table"
381+
```
382+
383+
All the effective permissions for the table located at the path `my_table`, including inherited permissions:
384+
385+
```yql
386+
SELECT *
387+
FROM `.sys/auth_effective_permissions`
388+
WHERE Path = "my_table"
389+
```
390+
391+
All permissions directly assigned to the user identified as `user3`:
392+
393+
```yql
394+
SELECT *
395+
FROM `.sys/auth_permissions`
396+
WHERE Sid = "user3"
397+
```
398+
399+
### Auth owners
400+
401+
The `auth_owners` view lists details of [access objects](../concepts/glossary.md#access-object) [ownership](../concepts/glossary.md#access-owner).
402+
403+
A user can view an [access object](../concepts/glossary.md#access-object) in the results if they have the `ydb.granular.describe_schema` permission on it.
404+
405+
Table structure:
406+
407+
| Column | Description |
408+
|--------|-------------|
409+
| `Path` | Path to the access object.<br />Type: `Utf8`.<br />Key: `0`. |
410+
| `Sid` | SID of the access object owner.<br />Type: `Utf8`. |

0 commit comments

Comments
 (0)