Skip to content

Commit cade5a3

Browse files
[enhance](auth) introduction of ldaps support via configuration property (#3351)
This PR adds documentation for the LDAPS feature introduced in code PR #60275. Changes: Added documentation for the new ldap_use_ssl configuration property in ldap.conf. Added a note about configuring the Java trustStore for SSL certificate validation when LDAPS is enabled. Updated the configuration examples in the relevant documentation files. Documentation version coverage: The changes have been applied to mentioned directories to cover the requested branches: 1. docs/ (latest), 2. versioned_docs/version-3.1/, 3. versioned_docs/version-4.0/ Related PR: apache/doris#60275 Issue: close apache/doris#60236
1 parent 5ca3fc0 commit cade5a3

16 files changed

Lines changed: 760 additions & 194 deletions

File tree

docs/admin-manual/auth/authentication/ldap.md

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"title": "LDAP",
44
"language": "en",
5-
"description": "Detailed guide on Apache Doris federated authentication: unified identity verification and group authorization through LDAP integration, covering configuration steps, login methods, permission mapping rules, and common troubleshooting."
5+
"description": "Detailed guide on Apache Doris federated authentication: unified identity verification and group authorization through LDAP/LDAPS integration, covering configuration steps, login methods, permission mapping rules, and common troubleshooting."
66
}
77
---
88

@@ -56,6 +56,8 @@ In LDAP, data is organized in a tree structure. Here's an example of a typical L
5656
ldap_group_basedn = ou=group,o=emr
5757
```
5858
59+
> To enable LDAPS (encrypted connection to the LDAP server), see the [LDAPS (Encrypted Connection)](#ldaps-encrypted-connection) section below.
60+
5961
3. After starting `fe`, log in to Doris with `root` or `admin` account and set the LDAP admin password:
6062
6163
```sql
@@ -233,6 +235,52 @@ If user jack belongs to LDAP groups `doris_rd`, `doris_qa`, `doris_pm`, and Dori
233235
> - Which `group` a `user` belongs to is independent of the LDAP tree's organizational structure. `user2` in the example above doesn't necessarily belong to `group2`.
234236
> - To make `user2` belong to `group2`, you need to explicitly add `user2` to the `member` attribute of `group2`.
235237
238+
## LDAPS (Encrypted Connection)
239+
240+
:::info Supported since version 4.0.5
241+
:::
242+
243+
By default, Doris communicates with the LDAP server over plain LDAP (unencrypted). Starting from version 4.0.5, Doris supports LDAPS (LDAP over SSL/TLS) to encrypt the connection between Doris FE and the LDAP server.
244+
245+
### Enabling LDAPS
246+
247+
To enable LDAPS, add the following configuration to `fe/conf/ldap.conf`:
248+
249+
```
250+
ldap_use_ssl = true
251+
```
252+
253+
When `ldap_use_ssl` is set to `true`, Doris uses the `ldaps://` protocol to connect to the LDAP server. You should also update the port to the standard LDAPS port (typically `636`):
254+
255+
```
256+
ldap_host = ldap-host
257+
ldap_port = 636
258+
ldap_use_ssl = true
259+
```
260+
261+
### Configuring Certificate Trust
262+
263+
When using LDAPS, the LDAP server's SSL certificate must be trusted by the Doris FE JVM. If your LDAP server uses a certificate signed by a well-known public CA, no additional configuration is needed.
264+
265+
If using a custom or self-signed Certificate Authority (CA), you must import the CA certificate into a Java trustStore and configure the JVM to use it. Add the following parameters to `JAVA_OPTS` in `fe/conf/fe.conf`:
266+
267+
```
268+
# Example for JDK 17
269+
JAVA_OPTS_FOR_JDK_17 = "-Djavax.net.ssl.trustStore=/path/to/your/cacerts -Djavax.net.ssl.trustStorePassword=changeit ..."
270+
```
271+
272+
> **Steps to import a self-signed CA certificate:**
273+
>
274+
> 1. Obtain the CA certificate file (e.g., `ca.crt`).
275+
> 2. Import it into a Java trustStore using `keytool`:
276+
>
277+
> ```shell
278+
> keytool -importcert -alias ldap-ca -keystore /path/to/your/cacerts -file /path/to/ca.crt -storepass changeit -noprompt
279+
> ```
280+
>
281+
> 3. Configure the trustStore path in `JAVA_OPTS` as shown above.
282+
> 4. Restart the Doris FE for the changes to take effect.
283+
236284
## Cache Management
237285

238286
To avoid frequent access to LDAP services, Doris caches LDAP information in memory.
@@ -250,7 +298,8 @@ You can refresh the cache with the `refresh ldap` statement. See [REFRESH-LDAP](
250298

251299
## Known Limitations
252300

253-
- 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`, and between `fe` and LDAP service.
301+
- Doris's LDAP functionality only supports cleartext password verification for the client-to-FE segment, meaning that when users log in, passwords are transmitted in plaintext between `client` and `fe`. SSL/TLS encryption between the client and Doris FE must be configured separately (see [Client Connection](#step-2-client-connection)).
302+
- For the FE-to-LDAP segment, the connection is unencrypted by default (`ldap_use_ssl = false`). To encrypt this segment, set `ldap_use_ssl = true` to use LDAPS (see [LDAPS (Encrypted Connection)](#ldaps-encrypted-connection)).
254303

255304
## FAQ
256305

@@ -266,3 +315,12 @@ Check the following items step by step:
266315
2. Check whether the expected `group` is located under the organizational structure corresponding to `ldap_group_basedn`.
267316
3. Check whether the expected `group` contains the `member` attribute.
268317
4. Check whether the `member` attribute of the expected `group` contains the current user's `dn`.
318+
319+
**Q: LDAPS connection fails, how to troubleshoot?**
320+
321+
Check the following items step by step:
322+
323+
1. Confirm that `ldap_use_ssl = true` is set in `fe/conf/ldap.conf`.
324+
2. Confirm that `ldap_port` is set to the correct LDAPS port (typically `636`).
325+
3. Verify that the LDAP server's SSL certificate is trusted by the JVM. Check the `fe.log` for SSL handshake errors such as `SSLHandshakeException` or `PKIX path building failed`.
326+
4. If using a self-signed CA, ensure the CA certificate has been imported into the trustStore and the trustStore path is correctly configured in `JAVA_OPTS`.

docs/lakehouse/catalogs/iceberg-catalog.mdx

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ Support for Nested Namespace needs to be explicitly enabled. For details, please
392392
'warehouse' = 'gs://bucket/iceberg_warehouse',
393393
'gs.access_key' = '<ak>',
394394
'gs.secret_key' = '<sk>',
395-
'fs.gcs.support'='true'
395+
'fs.gcs.support' = 'true'
396396
);
397397
```
398398
</TabItem>
@@ -406,7 +406,7 @@ Support for Nested Namespace needs to be explicitly enabled. For details, please
406406
'azure.account_name' = '<account_name>',
407407
'azure.account_key' = '<account_key>',
408408
'azure.endpoint' = 'https://<account_name>.blob.core.windows.net',
409-
'fs.azure.support'='true'
409+
'fs.azure.support' = 'true'
410410
);
411411
```
412412
</TabItem>
@@ -546,7 +546,7 @@ Support for Nested Namespace needs to be explicitly enabled. For details, please
546546
's3.access_key' = '<ak>',
547547
's3.secret_key' = '<sk>'
548548
);
549-
```
549+
```
550550
</TabItem>
551551
</Tabs>
552552
</details>
@@ -651,7 +651,7 @@ Support for Nested Namespace needs to be explicitly enabled. For details, please
651651
```sql
652652
CREATE CATALOG iceberg_dlf_catalog_catalog PROPERTIES (
653653
'type' = 'iceberg',
654-
'iceberg.catalog.type'='dlf',
654+
'iceberg.catalog.type' = 'dlf',
655655
'warehouse' = 'oss://bucket/iceberg-dlf-oss-warehouse',
656656
'dlf.uid' = '203225413946383283',
657657
'dlf.catalog_id' = 'p2_regression_case',
@@ -671,7 +671,7 @@ Support for Nested Namespace needs to be explicitly enabled. For details, please
671671
```sql
672672
CREATE CATALOG iceberg_dlf_catalog_catalog PROPERTIES (
673673
'type' = 'iceberg',
674-
'iceberg.catalog.type'='dlf',
674+
'iceberg.catalog.type' = 'dlf',
675675
'warehouse' = 'oss://bucket/iceberg-dlf-oss-warehouse',
676676
'dlf.uid' = '203225413946383283',
677677
'dlf.catalog.id' = 'catalog_id',
@@ -1071,7 +1071,7 @@ This is an experimental feature, supported since version 4.1.0.
10711071
'warehouse' = 'hdfs://127.0.0.1:8520/iceberg-fs-hdfs-warehouse',
10721072
'fs.defaultFS' = 'hdfs://127.0.0.1:8520',
10731073
'hadoop.security.authentication' = 'kerberos',
1074-
'hadoop.kerberos.principal'='hive/presto-master.docker.cluster@LABS.TERADATA.COM',
1074+
'hadoop.kerberos.principal' = 'hive/presto-master.docker.cluster@LABS.TERADATA.COM',
10751075
'hadoop.kerberos.keytab' = '/keytabs/hive-presto-master.keytab'
10761076
);
10771077

@@ -1145,7 +1145,7 @@ This is an experimental feature, supported since version 4.1.0.
11451145
'type' = 'iceberg',
11461146
'iceberg.catalog.type' = 'hadoop',
11471147
'warehouse' = 'gs://bucket/iceberg_warehouse',
1148-
'fs.gcs.support'='true',
1148+
'fs.gcs.support' = 'true',
11491149
'gs.access_key' = '<ak>',
11501150
'gs.secret_key' = '<sk>'
11511151
);
@@ -1155,9 +1155,9 @@ This is an experimental feature, supported since version 4.1.0.
11551155
```sql
11561156
CREATE CATALOG test_iceberg_fs_on_minio PROPERTIES (
11571157
'type' = 'iceberg',
1158-
'iceberg.catalog.type'='hadoop',
1158+
'iceberg.catalog.type' = 'hadoop',
11591159
'warehouse' = 's3://warehouse/wh',
1160-
'fs.minio.support'='true',
1160+
'fs.minio.support' = 'true',
11611161
'minio.endpoint' = 'http://127.0.0.1:19001',
11621162
'minio.access_key' = 'admin',
11631163
'minio.secret_key' = 'password',
@@ -1319,20 +1319,22 @@ This is an experimental feature, supported since version 4.1.0.
13191319

13201320
<details >
13211321
<summary>3.0.6+ Version</summary>
1322-
<TabItem value='FileSystem Catalog' label='FileSystem Catalog' default>
1323-
Please refer to the [S3 Tables Integration](../best-practices/doris-aws-s3tables.md) documentation.
1324-
```sql
1325-
CREATE CATALOG test_s3tables_catalog PROPERTIES (
1326-
'type' = 'iceberg',
1327-
'iceberg.catalog.type' = 's3tables',
1328-
'warehouse' = 'arn:aws:s3tables:ap-east-1:9527:bucket/doris-s3-table-bucket',
1329-
's3.region' = 'ap-east-1',
1330-
's3.endpoint' = 'https://s3.ap-east-1.amazonaws.com',
1331-
's3.access_key' = '<ak>',
1332-
's3.secret_key' = '<sk>'
1333-
);
1334-
```
1335-
</TabItem>
1322+
<Tabs>
1323+
<TabItem value='FileSystem Catalog' label='FileSystem Catalog' default>
1324+
Please refer to the [S3 Tables Integration](../best-practices/doris-aws-s3tables.md) documentation.
1325+
```sql
1326+
CREATE CATALOG test_s3tables_catalog PROPERTIES (
1327+
'type' = 'iceberg',
1328+
'iceberg.catalog.type' = 's3tables',
1329+
'warehouse' = 'arn:aws:s3tables:ap-east-1:9527:bucket/doris-s3-table-bucket',
1330+
's3.region' = 'ap-east-1',
1331+
's3.endpoint' = 'https://s3.ap-east-1.amazonaws.com',
1332+
's3.access_key' = '<ak>',
1333+
's3.secret_key' = '<sk>'
1334+
);
1335+
```
1336+
</TabItem>
1337+
</Tabs>
13361338
</details>
13371339

13381340
## Query Operations
@@ -1395,9 +1397,9 @@ SELECT * FROM iceberg_table FOR VERSION AS OF 123456789;
13951397

13961398
### Branch and Tag
13971399

1398-
> Since 3.1.0
1400+
> Since 3.1.0.
13991401
>
1400-
> For creating, dropping and managing branch and tag, please refer to [Managing Branch & Tag]
1402+
> For creating, dropping and managing branch and tag, please refer to the [Managing Branch & Tag] section.
14011403
14021404
Reading specific branches and tags of Iceberg tables is supported.
14031405

@@ -2906,7 +2908,7 @@ You can use the following SQL to analyze the data distribution and delete file c
29062908
CASE
29072909
WHEN file_size_in_bytes BETWEEN 0 AND 8 * 1024 * 1024 THEN '0-8M'
29082910
WHEN file_size_in_bytes BETWEEN 8 * 1024 * 1024 + 1 AND 32 * 1024 * 1024 THEN '8-32M'
2909-
WHEN file_size_in_bytes BETWEEN 2 * 1024 * 1024 + 1 AND 128 * 1024 * 1024 THEN '32-128M'
2911+
WHEN file_size_in_bytes BETWEEN 32 * 1024 * 1024 + 1 AND 128 * 1024 * 1024 THEN '32-128M'
29102912
WHEN file_size_in_bytes BETWEEN 128 * 1024 * 1024 + 1 AND 512 * 1024 * 1024 THEN '128-512M'
29112913
WHEN file_size_in_bytes > 512 * 1024 * 1024 THEN '> 512M'
29122914
ELSE 'Unknown'

i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/auth/authentication/ldap.md

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"title": "LDAP",
44
"language": "zh-CN",
5-
"description": "详解 Apache Doris 联邦认证:通过集成 LDAP 实现统一身份验证与组授权,涵盖配置步骤、登录方式、权限映射规则及常见问题排查。"
5+
"description": "详解 Apache Doris 联邦认证:通过集成 LDAP/LDAPS 实现统一身份验证与组授权,涵盖配置步骤、登录方式、权限映射规则及常见问题排查。"
66
}
77
---
88

@@ -44,7 +44,7 @@ Doris 支持接入第三方 LDAP 服务,提供验证登录和组授权两大
4444
### 第一步:配置 Doris
4545

4646
1.`fe/conf/fe.conf` 中设置认证方式:`authentication_type=ldap`
47-
2.`fe/conf/ldap.conf` 中配置 LDAP 服务的连接信息
47+
2.`fe/conf/ldap.conf` 中配置 LDAP 服务的连接信息
4848

4949
```
5050
ldap_authentication_enabled = true
@@ -56,6 +56,8 @@ Doris 支持接入第三方 LDAP 服务,提供验证登录和组授权两大
5656
ldap_group_basedn = ou=group,o=emr
5757
```
5858
59+
> 如需启用 LDAPS(加密连接至 LDAP 服务器),请参阅下文 [LDAPS(加密连接)](#ldaps加密连接) 章节。
60+
5961
3. 启动 `fe` 后,使用 `root` 或 `admin` 账号登录 Doris,设置 LDAP 管理员密码:
6062
6163
```sql
@@ -233,6 +235,52 @@ member: uid=jack,ou=aidp,dc=domain,dc=com
233235
> - `user` 属于哪个 `group` 与 LDAP 树的组织结构无关。上文示例中的 `user2` 并不一定属于 `group2`
234236
> - 若想让 `user2` 属于 `group2`,需要在 `group2``member` 属性中显式添加 `user2`
235237
238+
## LDAPS(加密连接)
239+
240+
:::info 自 4.0.5 版本开始支持
241+
:::
242+
243+
默认情况下,Doris 通过明文 LDAP 协议与 LDAP 服务器通信。自 4.0.5 版本起,Doris 支持 LDAPS(LDAP over SSL/TLS),用于加密 Doris FE 与 LDAP 服务器之间的连接。
244+
245+
### 启用 LDAPS
246+
247+
`fe/conf/ldap.conf` 中添加以下配置以启用 LDAPS:
248+
249+
```
250+
ldap_use_ssl = true
251+
```
252+
253+
`ldap_use_ssl` 设置为 `true` 时,Doris 使用 `ldaps://` 协议连接 LDAP 服务器。同时应将端口更新为标准 LDAPS 端口(通常为 `636`):
254+
255+
```
256+
ldap_host = ldap-host
257+
ldap_port = 636
258+
ldap_use_ssl = true
259+
```
260+
261+
### 配置证书信任
262+
263+
使用 LDAPS 时,LDAP 服务器的 SSL 证书必须被 Doris FE 的 JVM 所信任。如果 LDAP 服务器使用的证书由知名公共 CA 签发,则无需额外配置。
264+
265+
如果使用自定义或自签名 CA,需要将 CA 证书导入 Java trustStore,并配置 JVM 使用该 trustStore。在 `fe/conf/fe.conf``JAVA_OPTS` 中添加以下参数:
266+
267+
```
268+
# JDK 17 示例
269+
JAVA_OPTS_FOR_JDK_17 = "-Djavax.net.ssl.trustStore=/path/to/your/cacerts -Djavax.net.ssl.trustStorePassword=changeit ..."
270+
```
271+
272+
> **导入自签名 CA 证书的步骤:**
273+
>
274+
> 1. 获取 CA 证书文件(例如 `ca.crt`)。
275+
> 2. 使用 `keytool` 将其导入 Java trustStore:
276+
>
277+
> ```shell
278+
> keytool -importcert -alias ldap-ca -keystore /path/to/your/cacerts -file /path/to/ca.crt -storepass changeit -noprompt
279+
> ```
280+
>
281+
> 3. 按上述方式在 `JAVA_OPTS` 中配置 trustStore 路径。
282+
> 4. 重启 Doris FE 使配置生效。
283+
236284
## 缓存管理
237285

238286
为了避免频繁访问 LDAP 服务,Doris 会将 LDAP 信息缓存到内存中。
@@ -250,7 +298,8 @@ member: uid=jack,ou=aidp,dc=domain,dc=com
250298

251299
## 已知限制
252300

253-
- 目前 Doris 的 LDAP 功能仅支持明文密码验证,即用户登录时,密码在 `client``fe` 之间、`fe` 与 LDAP 服务之间均以明文形式传输。
301+
- Doris 的 LDAP 功能在客户端到 FE 的链路上仅支持明文密码验证,即用户登录时,密码在 `client``fe` 之间以明文形式传输。客户端与 Doris FE 之间的 SSL/TLS 加密需要单独配置(详见[客户端连接](#第二步客户端连接))。
302+
- FE 到 LDAP 服务器的链路默认使用明文传输(`ldap_use_ssl = false`)。如需加密该链路,请设置 `ldap_use_ssl = true` 以启用 LDAPS(详见 [LDAPS(加密连接)](#ldaps加密连接))。
254303

255304
## 常见问题
256305

@@ -266,3 +315,12 @@ member: uid=jack,ou=aidp,dc=domain,dc=com
266315
2. 检查预期的 `group` 是否位于 `ldap_group_basedn` 对应的组织结构下。
267316
3. 检查预期的 `group` 是否包含 `member` 属性。
268317
4. 检查预期 `group``member` 属性中是否包含当前用户的 `dn`
318+
319+
**Q:LDAPS 连接失败,如何排查?**
320+
321+
按以下步骤逐项检查:
322+
323+
1. 确认 `fe/conf/ldap.conf` 中已设置 `ldap_use_ssl = true`
324+
2. 确认 `ldap_port` 已设置为正确的 LDAPS 端口(通常为 `636`)。
325+
3. 检查 LDAP 服务器的 SSL 证书是否被 JVM 信任。查看 `fe.log` 中是否有 `SSLHandshakeException``PKIX path building failed` 等 SSL 握手错误。
326+
4. 如果使用自签名 CA,确认 CA 证书已导入 trustStore,且 `JAVA_OPTS` 中的 trustStore 路径配置正确。

0 commit comments

Comments
 (0)