Skip to content

Commit 9652ef7

Browse files
lgtm
Co-authored-by: lopatinevgeny <lopatinevgeny@yandex-team.ru>
1 parent 11b05e3 commit 9652ef7

File tree

3 files changed

+50
-5
lines changed

3 files changed

+50
-5
lines changed

ydb/docs/en/core/reference/configuration/index.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,19 +621,54 @@ For a configuration located in 3 availability zones, specify 3 rings. For a conf
621621

622622
{{ ydb-short-name }} supports various user authentication methods. The configuration for authentication providers is specified in the `auth_config` section.
623623

624+
### A Password Complexity Policies {#password-complexity}
625+
626+
{{ ydb-short-name }} allows users to be authenticated by login and password. More details can be found in the section [authentication by login and password](../../security/authentication.md#static-credentials). To enhance security in {{ ydb-short-name }} it is possible to configure the complexity of user passwords. You can enable the password complexity policy due include addition section `password_complexity`.
627+
628+
Syntax of the `password_complexity` section:
629+
630+
```yaml
631+
auth_config:
632+
#...
633+
password_complexity:
634+
min_length: 8
635+
min_lower_case_count: 1
636+
min_upper_case_count: 1
637+
min_numbers_count: 1
638+
min_special_chars_count: 1
639+
special_chars: "!@#$%^&*()_+{}|<>?="
640+
can_contain_username: false
641+
#...
642+
```
643+
644+
| Parameter | Description | Default value
645+
|:---|:---|:---:|
646+
| `min_length` | Minimal length of the password | 0 |
647+
| `min_lower_case_count` | Minimal count of letters in lower case | 0 |
648+
| `min_upper_case_count` | Minimal cont of letters in upper case | 0 |
649+
| `min_numbers_count` | Minimal count of number in the password | 0 |
650+
| `min_special_chars_count` | Minimal count of special chars in the password from list `special_chars`| 0 |
651+
| `special_chars` | Special characters which can be used in the password. Allow use chars from list `!@#$%^&*()_+{}\|<>?=` only. Value (`""`) is equivalent to list `!@#$%^&*()_+{}\|<>?=` | Empty list. Equivalent to all allowed characters: `!@#$%^&*()_+{}\|<>?=` |
652+
| `can_contain_username` | Allow use username in the password | `false` |
653+
654+
{% note info %}
655+
656+
Any changes to the password policy do not affect existing user passwords, so it is not necessary to change current passwords; they will be accepted as they are.
657+
658+
{% endnote %}
659+
624660
### Account lockout after unsuccessful password attempts {#account-lockout}
625661

626662
{{ ydb-short-name }} allows for the blocking of user authentication after unsuccessful password entry attempts. Lockout rules are configured in the `account_lockout` section.
627663

628664
Syntax of the `account_lockout` section:
629-
630665
```yaml
631666
auth_config:
632-
...
667+
#...
633668
account_lockout:
634669
attempt_threshold: 4
635670
attempt_reset_duration: "1h"
636-
...
671+
#...
637672
```
638673

639674
| Parameter | Description | Default value |

ydb/docs/en/core/security/authentication.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ To enable anonymous authentication, use `false` in the `enforce_user_token_requi
3232
## Authenticating by username and password {#static-credentials}
3333

3434
This access type implies that each database user has a username and password.
35-
Only digits and lowercase Latin letters can be used in usernames. Passwords are not restricted; even empty passwords are allowed.
35+
Only digits and lowercase Latin letters can be used in usernames. Allow to set various [criteria](#password-complexity) to password complexity.
3636

3737
The username and hashed password are stored in a table inside the authentication component. The password is hashed using the [Argon2](https://en.wikipedia.org/wiki/Argon2) method. Only the system administrator has access to this table.
3838

@@ -48,6 +48,10 @@ To enable username/password authentication, use `true` in the `enforce_user_toke
4848

4949
To learn how to manage roles and users, see [{#T}](../security/authorization.md).
5050

51+
### Password complexity {#password-complexity}
52+
53+
{{ ydb-short-name }} allows for additional configuration of user password policies. Passwords specified in commands such as CREATE USER and ALTER USER must comply with the current password policy. By default, the following restrictions apply to passwords: passwords of any length are accepted, including empty strings; passwords can contain any number of digits, letters in various cases, and special characters from the list `!@#$%^&*()_+{}|<>?=`. To impose restrictions on password complexity, you need to configure the password_complexity section in the [configuration](../reference/configuration/index.md#password-complexity).
54+
5155
### Protection against password brute force
5256

5357
{{ ydb-short-name }} provides protection against password brute force. The user will be considered locked out if they exceed the number of allowed incorrect password attempts. After the specified period, they will be able to attempt authentication again.

ydb/docs/ru/core/reference/configuration/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,12 @@ auth_config:
857857
| `special_chars` | Специальные символы, которые допустимо использовать в пароле. Допускается указать любое подмножество из следующих символов `!@#$%^&*()_+{}\|<>?=`. Значение (`""`) эквивалентно списку `!@#$%^&*()_+{}\|<>?=` | `""` |
858858
| `can_contain_username` | Может ли пароль содержать имя пользователя | `false` |
859859

860+
{% note info %}
861+
862+
Любые изменения политики паролей не затрагивают уже действующие пароли пользователей, поэтому изменять существующие пароли не требуется, они будут приниматься в текущем виде.
863+
864+
{% endnote %}
865+
860866
### Блокировка пользователя после неуспешных попыток ввода пароля {#account-lockout}
861867

862868
{{ ydb-short-name }} позволяет заблокировать возможность аутентификации пользователя после неудачных попыток ввода пароля. Правила блокировки настраиваются в секции `account_lockout`.
@@ -874,7 +880,7 @@ auth_config:
874880

875881
| Параметр | Описание | Значение по умолчанию |
876882
| :--- | :--- | :---: |
877-
| `attempt_threshold` | Максимальное количество неуспешных попыток ввода правильного пароля. После `attempt_threshold` неуспешных попыток пользователь будет заблокирован на время, заданное в параметре `attempt_reset_duration`. Нулевое значение параметра `attempt_threshold` указывает на отсутствие каких-лио ограничений на число попыток ввода пароля. После успешной аутентификации (ввода правильных имени пользователя и пароля), счетчик неуспешных попыток сбрасывается в значение 0. | 4 |
883+
| `attempt_threshold` | Максимальное количество неуспешных попыток ввода правильного пароля. После `attempt_threshold` неуспешных попыток пользователь будет заблокирован на время, заданное в параметре `attempt_reset_duration`. Нулевое значение параметра `attempt_threshold` указывает на отсутствие каких-либо ограничений на число попыток ввода пароля. После успешной аутентификации (ввода правильных имени пользователя и пароля), счетчик неуспешных попыток сбрасывается в значение 0. | 4 |
878884
| `attempt_reset_duration` | Период времени блокировки пользователя. В течение этого периода пользователь не сможет аутентифицироваться в системе даже если введёт правильные имя пользователя и пароль. Период блокировки отсчитывается с момента последней неверной попытки ввода пароля. Если задан нулевой (`"0s"` - запись, эквивалентная 0 секунд) период блокировки, то пользователь будет считаться заблокированным на неограниченное время. В этом случае снять блокировку должен Администратор системы.<br/><br/>Минимальный интервал времени блокировки 1 секунда. <br/>Поддерживаемые единицы измерения:<ul><li>Секунды. `30s`</li><li>Минуты. `20m`</li><li>Часы. `5h`</li><li>Дни. `3d`</li></ul>Не допускается комбинировать единицы измерения в одной строке. Например такая запись некорректна: `1d12h`. Такую запись нужно заменить на эквивалентную, например `36h`. | "1h" |
879885

880886
### Конфигурация LDAP аутентификации {#ldap-auth-config}

0 commit comments

Comments
 (0)