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
database_allowed_sids: <list of SIDs that are allowed to view database state>
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>
bootstrap_allowed_sids: <list of SIDs allowed to bootstrap the cluster>
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 level lists are configured in the security_config section. For detailed information about access level lists, their hierarchy, and how they work, see Access level lists in the Authorization documentation.
|
Parameter |
Description |
|
|
The list of SIDs with the database access level. This level is less privileged than viewer. Subjects can only operate within a database scope — backend calls without a specified database are forbidden. Cluster-level requests (e.g., listing cluster nodes) return 403. Database-scoped requests (e.g., database pages in Embedded UI) work normally. Intended for applications or users restricted to a single database. |
|
|
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 monitoring 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 administration access level. This level grants privileges to administer the YDB cluster and its databases. Also used for config changes, scheme operations requiring admin privileges, and other administrative checks. An empty list means any user is treated as an administrator. |
|
|
The list of SIDs that are allowed to perform cluster bootstrap. Used to initially bootstrap the cluster from an uninitialized state (when the auth subsystem is not yet functional). Bootstrap is allowed if the subject is in
|
|
|
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 means "allow any user" — any SID is acceptable (or no SID at all if anonymous access is allowed). Empty administration_allowed_sids grants any user administrator privileges; empty viewer_allowed_sids (with other UI lists empty) allows any user viewer-level access to Embedded UI. If all four hierarchical lists are empty, any user has full administrative access.
For a secure YDB deployment, plan the access model beforehand and define the group lists before starting the cluster for the first time.
Access level lists can contain user or group SIDs. A subject matches a list if it contains their user SID or any of their group SIDs (including nested groups) — a single match is sufficient.
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.
Where the lists are used:
-
database_allowed_sids,viewer_allowed_sids,monitoring_allowed_sids,administration_allowed_sids
To access Embedded UI and viewer HTTP endpoints. -
administration_allowed_sids
For all administrative checks. -
bootstrap_allowed_sids
Only for cluster bootstrap operation. -
register_dynamic_node_allowed_sids
For registering nodes in a cluster (discovery service and cms subsystem).
Note
Access level lists represent 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).
- The
database_allowed_sidslist defines the "database" role: these users are less privileged than viewers and cannot issue any backend call without specifying a database; cluster-wide requests are not allowed. - The
viewer_allowed_sids,monitoring_allowed_sids, andadministration_allowed_sidslists form a hierarchy: administration implies monitoring and viewer; monitoring implies viewer. A subject only needs to be in the one list that matches their role — inclusion in a higher list automatically grants all lower privileges.
For example:
- A user of a database (e.g. an application that must stay database-scoped) should be added only to
database_allowed_sids. - A viewer should be added only to
viewer_allowed_sids. - A monitoring user should be added only to
monitoring_allowed_sids(they automatically get viewer privileges). - An administrator should be added only to
administration_allowed_sids(they automatically get monitoring and viewer privileges).
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: |