security_config
The security_config section defines authentication modes, the initial configuration of local users and groups, and their access rights.
security_config:
# authentication mode configuration
enforce_user_token_requirement: false
enforce_user_token_check_requirement: false
default_user_sids: <authentication token for anonymous requests>
all_authenticated_users: <group name for all authenticated users>
all_users_group: <group name for all users>
# initial security configuration
default_users: <default user list>
default_groups: <default group list>
default_access: <default access rights on the cluster scheme root>
# access list configuration
viewer_allowed_sids: <list of SIDs that are allowed to view the cluster state>
monitoring_allowed_sids: <list of SIDs that are allowed to monitor and change the cluster state>
administration_allowed_sids: <list of SIDs that are allowed cluster administration>
register_dynamic_node_allowed_sids: <list of SIDs that are allowed to register database nodes in the cluster>
# built-in security configuration
disable_builtin_security: false
disable_builtin_groups: false
disable_builtin_access: false
Configuring Authentication Mode
|
Parameter |
Description |
|
|
Selects user authentication mode.
If the Default value: |
|
|
Forbids ignoring authentication errors in the Default value: |
|
|
Specifies a list of SIDs for authenticating incoming requests without an auth token.
If the Default value: empty. |
|
|
Specifies the name of the virtual group that includes all authenticated users. This virtual group is created automatically by YDB. You cannot delete this virtual group, list its members, or modify them. Tip You can get information about access rights on scheme objects in the system views. For more information see, {#T}. Default value: |
|
|
Specifies the name of the group that includes all local users. If The Default value: empty. |
The following diagram displays the relationship between authentication mode parameters described above:
Bootstrapping Security
The default_users, default_groups, and default_access parameters affect the initial YDB cluster configuration that occurs when YDB starts for the first time. During subsequent runs, the initial configuration is not repeated, and these parameters are ignored.
See Initial cluster security configuration and the related domains_config parameters.
|
Parameter |
Description |
|
|
The list of users to be created when the YDB cluster starts for the first time. The list consists of login-password pairs. The first user in the list is a superuser. Warning Passwords are specified in plain text, so it is unsafe to use them for an extended period. You must change these passwords in YDB after the first start. For example, use the Example:
Errors in the |
|
|
The list of groups to be created when the YDB cluster starts for the first time. The list includes groups and their members. Warning These groups are created for the entire YDB cluster. Example:
The order of groups in this list matters: groups are created in the order in which they appear in the Failures to add users to groups are logged but do not affect the YDB cluster startup. |
|
|
The list of access rights to be granted on the cluster scheme root. Access rights are specified using the short access control notation. Example:
|
Errors in access right entries are logged but do not affect YDB cluster startup. Access rights with errors will not be granted.
Configuring Administrative and Other Privileges
Access control in YDB is divided into two segments:
- Access control lists for scheme objects
- Access level lists to define additional privileges or restrictions
Both segments are used in combination: a subject is granted the privilege to perform an action only if both segments allow it. The action is not allowed if either segment denies it.
Access levels are defined by the viewer_allowed_sids, monitoring_allowed_sids, and administration_allowed_sids lists in the cluster configuration. The access levels of subjects determine their privileges to manage scheme objects as well as privileges that are not related to scheme objects.
|
Parameter |
Description |
|
|
The list of SIDs with the viewer access level. This level allows viewing the cluster state, which is not publicly accessible (including most pages in the Embedded UI). No changes are allowed. |
|
|
The list of SIDs with the operator access level. This level grants additional privileges to monitor and modify the cluster state. For example, it allows performing a backup, restoring a database, or executing YQL statements in the Embedded UI. |
|
|
The list of SIDs with the administrator access level. This level grants privileges to administer the YDB cluster and its databases. |
|
|
The list of SIDs that are allowed to register database nodes. For technical reasons, this list must include |
Warning
The access level lists are empty by default.
An empty list grants its access level to any user, including anonymous users.
If all three lists are empty, any user has the administrative access level.
For a secure YDB deployment, plan the access model beforehand and define the group lists before starting the cluster for the first time.
The access level lists can include the SIDs of users or user groups. A user belongs to an access level list if the list includes the SID of the user or the SID of a group to which the user or its subgroup (recursively) belongs.
It is recommended to add user groups and separate service accounts to the *_allowed_sids access level lists. This way, granting access levels to individual users does not require changing the YDB cluster configuration.
Note
Access level lists are layers of additional privileges:
- An access subject that is not included in any access level list can view only publicly available information about the cluster (for example, a list of databases on the cluster or a list of cluster nodes).
- Each of the
viewer_allowed_sids,monitoring_allowed_sids, andadministration_allowed_sidslists adds privileges to the access subject. For the maximum level of privileges, an access subject must be added to all three access level lists. - Adding an access subject to the
monitoring_allowed_sidsoradministration_allowed_sidslist without adding it toviewer_allowed_sidshas no effect.
For example:
- An operator (the SID of the user or the group to which the user belongs) must be added to
viewer_allowed_sidsandmonitoring_allowed_sids. - An administrator must be added to
viewer_allowed_sids,monitoring_allowed_sids, andadministration_allowed_sids.
Built-in Security Configuration
The disable_builtin_security, disable_builtin_groups, and disable_builtin_access flags affect the built-in security configuration that occurs when YDB starts for the first time.
|
Parameter |
Description |
|
|
Disable the built-in security configuration. This flag is not saved in the cluster configuration. Default value: |
|
|
Do not create built-in user groups even if the default user groups are not specified in the Default value: |
|
|
Do not add access rights at the root of the cluster scheme for the built-in user groups even if the default access rights are not specified in the Default value: |