Skip to content

Commit c9a2434

Browse files
authored
Add TCM access control list and API tokens documentation (#4258)
Resolves #4246 Resolves #4247
1 parent 4f0cbb4 commit c9a2434

File tree

2 files changed

+166
-25
lines changed

2 files changed

+166
-25
lines changed

doc/reference/tooling/tcm/tcm_access_control.rst

Lines changed: 165 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ and users (or user accounts). They work as follows:
1717
- Roles are predefined sets of *administrative* permissions to
1818
assign to users.
1919
- Users have roles that define their access rights to |tcm| functions and objects, and
20-
*cluster* permissions that are assigned for each cluster separately.
20+
*cluster* permissions that are assigned for each cluster individually.
2121

2222
.. note::
2323

2424
|tcm| users, roles, and permissions are not to be confused with similar subjects
25-
of the :ref:`Tarantool access control system <authentication>`. To access Tarantool
25+
of the :ref:`Tarantool access control system <access_control>`. To access Tarantool
2626
instances directly, Tarantool users with corresponding roles are required.
2727

2828
.. _tcm_access_control_permissions:
@@ -56,6 +56,9 @@ There are two types of permissions in |tcm|: *administrative* and *cluster* perm
5656

5757
Cluster permissions are assigned to users individually when creating or editing them.
5858

59+
For a fine-grained control over user access to particular spaces and functions stored
60+
in clusters, there is the :ref:`access control list <tcm_access_control_acl>`.
61+
5962
Permissions are predefined in |tcm|, there is no way to change, add, or delete them.
6063
The complete lists of administrative and cluster permissions in |tcm| are provided
6164
in the :ref:`Permissions reference <tcm_access_control_permissions_ref>`.
@@ -159,9 +162,9 @@ Passwords
159162
---------
160163

161164
|tcm| uses the general term *secret* for user authentication keys. A secret is any
162-
pair of a public and a private key that can be used for authentication. In |tcm| |tcm_version|,
163-
*password* is the only supported secret type. In this case, the public key is a username,
164-
and the private key is a password.
165+
pair of a public and a private key that can be used for authentication. A *password*
166+
combined with a *username* is a secret type used for |tcm| user authentication.
167+
In this case, the public key is a username, and the private key is a password.
165168

166169
Users receive their first passwords during their :ref:`account creation <tcm_access_control_users_manage>`.
167170

@@ -244,6 +247,80 @@ There are the following password policy settings:
244247
- **Digits (0-9)**
245248
- **Symbols (such as !@#$%^&\*()_+№"':,.;=][{}`?>/.)**
246249

250+
.. _tcm_access_control_acl:
251+
252+
Access control list
253+
-------------------
254+
255+
|tcm|'s *access control list* (*ACL*) determines user access to particular data
256+
and functions stored in clusters. You can use it to allow or deny access to specific
257+
stored objects one by one.
258+
259+
Each ACL entry specifies privileges that a |tcm| user has on a particular
260+
space or a function. There are three access privileges that can be granted in the ACL:
261+
read, write, and execute (for stored functions only). The privileges work as follows:
262+
263+
- Spaces:
264+
265+
- ``Read``: the user sees the space and its tuples on the **Tuples** and **Explorer** pages
266+
- ``Write``: the user can add new and edit existing tuples of the space
267+
268+
- Functions:
269+
270+
- ``Read``: the user sees the function on the **Functions** tab of the instance details page.
271+
- ``Write``: the user can edit or delete the function
272+
- ``Execute``: the user can call the function
273+
274+
.. important::
275+
276+
User access to space data and stored functions is primarily defined by the
277+
:ref:`cluster permissions <tcm_access_control_permissions_cluster>` ``cluster.space.data.*`` and ``cluster.func.*``.
278+
ACL only increases the access control granularity to particular objects.
279+
Make sure that users have these permissions before enabling ACL for them.
280+
281+
.. _tcm_access_control_acl_enable:
282+
283+
Enabling ACL for a user
284+
~~~~~~~~~~~~~~~~~~~~~~~
285+
286+
To granularly manage a user's access to particular objects in a cluster, enable
287+
the use of ACL in the user profile:
288+
289+
#. Go to **Users** and click **Edit** in the **Actions** menu of the corresponding table row.
290+
291+
#. In the user's **Clusters** list, add a cluster on which you want to use ACL
292+
or click the pencil icon if the cluster is already on the list.
293+
294+
#. Select the **Use Access Control List (ACL)** checkbox and save changes.
295+
296+
#. Repeat two previous steps for each cluster on which you want to use ACL for this user.
297+
298+
#. Click **Update** to save the user account.
299+
300+
If the user doesn't exist yet, you can do the same when creating it.
301+
302+
.. important::
303+
304+
When ACL use is enabled for a user, this user loses access to all spaces and
305+
functions of the selected cluster except the ones explicitly specified in the ACL.
306+
307+
.. _tcm_access_control_acl_manage:
308+
309+
Managing ACL
310+
~~~~~~~~~~~~
311+
312+
The tools for managing ACL are located on the **ACL** page.
313+
314+
To add an ACL entry:
315+
316+
#. Click **Add**.
317+
#. Select a user to which you want to grant access.
318+
#. Select a cluster that stores the target object: a space or a function.
319+
#. Select the target object type and enter its name.
320+
#. Select the privileges you want to grant.
321+
322+
To delete an ACL entry, click **Delete** in the **Actions** menu of the corresponding table row.
323+
247324
.. _tcm_access_control_sessions:
248325

249326
Sessions
@@ -256,6 +333,52 @@ are listed on the **Sessions** page. To revoke a session, click **Revoke** in th
256333
To revoke all sessions of a user, go to **Users** and click **Revoke all sessions**
257334
in the **Actions** menu of the corresponding table row.
258335

336+
.. _tcm_access_control_api_tokens:
337+
338+
API tokens
339+
----------
340+
341+
|tcm| uses the Bearer HTTP authentication scheme with *API tokens* to authenticate
342+
external applications' requests to |tcm|. For example, these can be Prometheus
343+
jobs that retrieve metrics of connected Tarantool clusters.
344+
345+
Each |tcm| API token belongs to the user that created it and has the same :ref:`access permissions <tcm_access_control_permissions>`.
346+
Thus, if a user has a permission to view a cluster's metrics in |tcm|, this user's
347+
API tokens can be used to read this cluster's metrics with Prometheus.
348+
349+
API tokens have expiration dates that are set during the token creation and cannot
350+
be changed.
351+
352+
.. _tcm_access_control_api_tokens_manage:
353+
354+
Managing API tokens
355+
~~~~~~~~~~~~~~~~~~~
356+
357+
.. note::
358+
359+
Each user, including **Default Admin** and other administrators, can create only
360+
their own tokens. There is no way to create a token for another user.
361+
362+
To create a |tcm| API token:
363+
364+
#. Open the user settings by clicking the user's name in the top-right corner.
365+
#. Go to the **API tokens** tab and click **Add**.
366+
#. Specify the token expiration date and an optional description and click **Add**.
367+
368+
The created token is shown in a dialog.
369+
370+
.. important::
371+
372+
An API token is shown only once after its creation. There is no way to view
373+
it again after you close the dialog. Make sure to copy the token in a safe place.
374+
375+
To delete an API token, click **Delete** in the actions menu of the corresponding
376+
**API tokens** table row.
377+
378+
Administrators can also view information about users' API tokens and delete them
379+
on the **Secrets** page. To open a user's secrets, click **Secrets** in the **Actions**
380+
menu of the corresponding **Users** table row.
381+
259382
.. _tcm_access_control_permissions_ref:
260383

261384
Permissions reference
@@ -326,9 +449,6 @@ The following administrative permissions are available in |tcm|:
326449
* - ``admin.passwordpolicy.write``
327450
- Manage password policy
328451

329-
* - ``admin.devmode.toggle``
330-
- Toggle development mode
331-
332452
* - ``admin.secrets.read``
333453
- View information about users' secrets
334454

@@ -338,11 +458,20 @@ The following administrative permissions are available in |tcm|:
338458
* - ``user.password.change``
339459
- User's permission to change their own password
340460

341-
* - ``admin.lowlevel.state.read``
342-
- Read low-level information from |tcm| storage (for debug purposes)
461+
* - ``user.api-token.read``
462+
- User's permission to read their own API tokens information
463+
464+
* - ``user.api-token.write``
465+
- User's permission to modify their own API tokens
466+
467+
* - ``admin.metrics``
468+
- Read |tcm| metrics
343469

344-
* - ``admin.lowlevel.state.write``
345-
- Write low-level information to |tcm| storage (for debug purposes)
470+
* - ``admin.acl.read``
471+
- View the access control list (ACL)
472+
473+
* - ``admin.acl.write``
474+
- Add and delete ACL entries
346475

347476
.. _tcm_access_control_permissions_cluster:
348477

@@ -367,26 +496,38 @@ The following cluster permissions are available in |tcm|:
367496
* - ``cluster.stateboard.read``
368497
- View cluster stateboard
369498

370-
* - ``cluster.explorer.read``
371-
- Read data from cluster instances
499+
* - ``cluster.func.read``
500+
- View cluster's stored functions
372501

373-
* - ``cluster.explorer.write``
374-
- Write data to cluster instances
502+
* - ``cluster.func.write``
503+
- Edit cluster's stored functions
375504

376-
* - ``cluster.explorer.call``
505+
* - ``cluster.func.call``
377506
- Execute stored functions on cluster instances
378507

379-
* - ``cluster.explorer.eval``
380-
- Execute code on cluster instances
381-
382508
* - ``cluster.space.read``
383509
- Read cluster data schema
384510

385511
* - ``cluster.space.write``
386512
- Modify cluster data schema
387513

388-
* - ``cluster.lowlevel.state.read``
389-
- Read low-level information about cluster configuration (for debug purposes)
514+
* - ``cluster.space.data.read``
515+
- Read stored data from cluster
516+
517+
* - ``cluster.space.data.write``
518+
- Edit stored data on cluster
519+
520+
* - ``cluster.failover.read``
521+
- Read cluster failover information
522+
523+
* - ``cluster.failover.write``
524+
- Write cluster failover commands
525+
526+
* - ``cluster.terminal``
527+
- Connect to cluster instances with ``tt`` terminal from |TCM|
528+
529+
* - ``cluster.sql``
530+
- Execute SQL queries
390531

391-
* - ``cluster.lowlevel.state.write``
392-
- Write low-level information about cluster configuration (for debug purposes)
532+
* - ``cluster.metrics``
533+
- View cluster metrics

prolog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@
4040

4141
.. |tcm| replace:: TCM
4242

43-
.. |tcm_version| replace:: 1.0.0
43+
.. |tcm_version| replace:: 1.1.0
4444

0 commit comments

Comments
 (0)