Skip to content

Commit 1f59abb

Browse files
add docs for allow_empty_pass option for 3.x and 4.x versions
1 parent 8f7e8af commit 1f59abb

File tree

2 files changed

+34
-0
lines changed
  • versioned_docs
    • version-3.x/admin-manual/auth/authentication
    • version-4.x/admin-manual/auth/authentication

2 files changed

+34
-0
lines changed

versioned_docs/version-3.x/admin-manual/auth/authentication/ldap.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ In LDAP, data is organized in a tree structure. Here's an example of a typical L
5757
ldap_group_basedn = ou=group,o=emr
5858
# specify ldap_use_ssl to true to use to secured LDAPS protocol, specify false or comment property to use default behavior with plain LDAP
5959
ldap_use_ssl = true
60+
# specify ldap_allow_empty_pass to false to prohibit login with non specified LDAP password, specify true or comment property to use default behavior and allow login with empty LDAP password
61+
ldap_allow_empty_pass = false
6062
```
6163
6264
> Important for LDAPS:
@@ -146,6 +148,12 @@ LDAP authentication means password verification through LDAP service to suppleme
146148
2. If the user doesn't exist in LDAP, it falls back to Doris local password verification.
147149
3. If the LDAP password is correct but there's no corresponding account in Doris, a temporary user is created for login.
148150
151+
> Note on Empty Passwords:
152+
>
153+
> By default, Doris allows login with an empty password if the user exists in LDAP (`ldap_allow_empty_pass = true`).
154+
> This behavior can be disabled by setting `ldap_allow_empty_pass = false` in `ldap.conf`.
155+
> With such setting Doris will reject all login attempts with empty password and return an error message.
156+
149157
### Login Behavior Overview
150158
151159
After enabling LDAP, login behaviors under different user states are as follows:
@@ -154,8 +162,10 @@ After enabling LDAP, login behaviors under different user states are as follows:
154162
| --------- | ---------- | ------------- | ------------ | -------------- |
155163
| Exists | Exists | LDAP password | Success | Doris user |
156164
| Exists | Exists | Doris password | Failed | - |
165+
| Exists | Exists | Empty password | Success if `ldap_allow_empty_pass = true`, otherwise Failed | Doris user (if allowed) |
157166
| Not exists | Exists | Doris password | Success | Doris user |
158167
| Exists | Not exists | LDAP password | Success | LDAP temporary user |
168+
| Exists | Not exists | Empty password | Success if `ldap_allow_empty_pass = true`, otherwise Failed | LDAP temporary user (if allowed) |
159169
160170
> **About Temporary Users:**
161171
>
@@ -164,6 +174,12 @@ After enabling LDAP, login behaviors under different user states are as follows:
164174
> - Temporary user permissions are determined by LDAP group authorization (see "Group Authorization" section below).
165175
> - If temporary users have no corresponding group permissions, they default to `select_priv` on `information_schema`.
166176
177+
> **About Empty Password Security:**
178+
>
179+
> The `ldap_allow_empty_pass` configuration provides additional security control:
180+
> - When `true` (default): Users can accidentally or intentionally log in without a password, which might be convenient for development environments but poses security risks in production.
181+
> - When `false`: Empty passwords are strictly rejected, ensuring all users must provide valid credentials. This is recommended for production environments to prevent unauthorized access.
182+
167183
### Login Examples
168184
169185
The following examples assume LDAP authentication is enabled, configured with `ldap_user_filter = (&(uid={login}))`, and the client has set `LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN=1`.
@@ -268,6 +284,7 @@ You can refresh the cache with the `refresh ldap` statement. See [REFRESH-LDAP](
268284
- Currently, Doris's LDAP functionality only supports cleartext password verification, meaning that when users log in, passwords are transmitted in plaintext between `client` and `fe`, but connection between `fe` and LDAP service can be secured optionally.
269285
- **For `ldap_use_ssl = false` (default behavior)**: Passwords are transmitted in plain text between the Doris FE and the LDAP server.
270286
- **To secure the connection**: Set `ldap_use_ssl = true` to encrypt traffic between Doris FE and the LDAP server. Note that SSL/TLS encryption between the **client and Doris FE** must be configured separately.
287+
- **Empty password behavior:** By default, Doris allows login with an empty password if the user exists in LDAP (`ldap_allow_empty_pass = true`). This can be disabled by setting `ldap_allow_empty_pass = false` in `ldap.conf`.
271288

272289
## FAQ
273290

versioned_docs/version-4.x/admin-manual/auth/authentication/ldap.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ In LDAP, data is organized in a tree structure. Here's an example of a typical L
5757
ldap_group_basedn = ou=group,o=emr
5858
# specify ldap_use_ssl to true to use to secured LDAPS protocol, specify false or comment property to use default behavior with plain LDAP
5959
ldap_use_ssl = true
60+
# specify ldap_allow_empty_pass to false to prohibit login with non specified LDAP password, specify true or comment property to use default behavior and allow login with empty LDAP password
61+
ldap_allow_empty_pass = false
6062
```
6163
6264
> Important for LDAPS:
@@ -146,6 +148,12 @@ LDAP authentication means password verification through LDAP service to suppleme
146148
2. If the user doesn't exist in LDAP, it falls back to Doris local password verification.
147149
3. If the LDAP password is correct but there's no corresponding account in Doris, a temporary user is created for login.
148150
151+
> Note on Empty Passwords:
152+
>
153+
> By default, Doris allows login with an empty password if the user exists in LDAP (`ldap_allow_empty_pass = true`).
154+
> This behavior can be disabled by setting `ldap_allow_empty_pass = false` in `ldap.conf`.
155+
> With such setting Doris will reject all login attempts with empty password and return an error message.
156+
149157
### Login Behavior Overview
150158
151159
After enabling LDAP, login behaviors under different user states are as follows:
@@ -154,8 +162,10 @@ After enabling LDAP, login behaviors under different user states are as follows:
154162
| --------- | ---------- | ------------- | ------------ | -------------- |
155163
| Exists | Exists | LDAP password | Success | Doris user |
156164
| Exists | Exists | Doris password | Failed | - |
165+
| Exists | Exists | Empty password | Success if `ldap_allow_empty_pass = true`, otherwise Failed | Doris user (if allowed) |
157166
| Not exists | Exists | Doris password | Success | Doris user |
158167
| Exists | Not exists | LDAP password | Success | LDAP temporary user |
168+
| Exists | Not exists | Empty password | Success if `ldap_allow_empty_pass = true`, otherwise Failed | LDAP temporary user (if allowed) |
159169
160170
> **About Temporary Users:**
161171
>
@@ -164,6 +174,12 @@ After enabling LDAP, login behaviors under different user states are as follows:
164174
> - Temporary user permissions are determined by LDAP group authorization (see "Group Authorization" section below).
165175
> - If temporary users have no corresponding group permissions, they default to `select_priv` on `information_schema`.
166176
177+
> **About Empty Password Security:**
178+
>
179+
> The `ldap_allow_empty_pass` configuration provides additional security control:
180+
> - When `true` (default): Users can accidentally or intentionally log in without a password, which might be convenient for development environments but poses security risks in production.
181+
> - When `false`: Empty passwords are strictly rejected, ensuring all users must provide valid credentials. This is recommended for production environments to prevent unauthorized access.
182+
167183
### Login Examples
168184
169185
The following examples assume LDAP authentication is enabled, configured with `ldap_user_filter = (&(uid={login}))`, and the client has set `LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN=1`.
@@ -268,6 +284,7 @@ You can refresh the cache with the `refresh ldap` statement. See [REFRESH-LDAP](
268284
- Currently, Doris's LDAP functionality only supports cleartext password verification, meaning that when users log in, passwords are transmitted in plaintext between `client` and `fe`, but connection between `fe` and LDAP service can be secured optionally.
269285
- **For `ldap_use_ssl = false` (default behavior)**: Passwords are transmitted in plain text between the Doris FE and the LDAP server.
270286
- **To secure the connection**: Set `ldap_use_ssl = true` to encrypt traffic between Doris FE and the LDAP server. Note that SSL/TLS encryption between the **client and Doris FE** must be configured separately.
287+
- **Empty password behavior:** By default, Doris allows login with an empty password if the user exists in LDAP (`ldap_allow_empty_pass = true`). This can be disabled by setting `ldap_allow_empty_pass = false` in `ldap.conf`.
271288

272289
## FAQ
273290

0 commit comments

Comments
 (0)