Apache trino的ldap认证开启

作者:櫰木

1、背景

由于trino 默认没有开启用户认证体系,需要ldap用户进行认证。开启tls和ldap用户认证,提高安全性。

2、配置

前置条件。

trino 集群已经部署完成

ldap 服务

openjdk 版本大于11.0.17

生成证书

keytool -genkeypair -validity 36500 -ext SAN=IP:172.16.104.226,DNS:hd1.dtstack.com -alias trino -keypass admin@123 -storepass admin@123 -keyalg RSA -dname CN=hd1.dtstack.com,OU=,O=,L=,ST=,C= -keystore trino.jks

将证书复制每个节点的到trino目录

配置每个节点配置以下内容

config.properties

http-server.https.enabled=true
http-server.https.port=8443
http-server.https.keystore.path=/opt/trino/etc/trino.jks
http-server.https.keystore.key=admin@123
internal-communication.shared-secret=abc123
internal-communication.https.required=true

http-server.https.secure-random-algorithm=SHA1PRNG
http-server.authentication.allow-insecure-over-http=true

配置认证配置文件 (本次使用的是openldap)

etc/password-authenticator.properties

password-authenticator.name=ldap
ldap.url=ldap://hd.dtstack.com:389
#ldap.ssl.truststore.path=/path/to/ldap_server.pem
#ldap.user-bind-pattern=
#ldap.user-bind-pattern= U S E R @ D T S T A C K . C O M l d a p . u s e r − b a s e − d n = c n = a c c o u n t s , d c = d t s t a c k , d c = c o m l d a p . u s e r − b i n d − p a t t e r n = u i d = {USER}@DTSTACK.COM ldap.user-base-dn=cn=accounts,dc=dtstack,dc=com ldap.user-bind-pattern=uid= USER@DTSTACK.COMldap.userbasedn=cn=accounts,dc=dtstack,dc=comldap.userbindpattern=uid={USER},cn=users,cn=accounts,dc=dtstack,dc=com
#ldap.bind-dn=uid=admin,cn=users,cn=accounts,dc=dtstack,dc=com
#ldap.bind-password=admin123
ldap.allow-insecure=true

重启对应服务

3、验证

通过https登录访问coordinator节点
请添加图片描述

使用trinocli进行测试

trino-cli --server https://hd1.dtstack.com:8443 --keystore-path /opt/trino/etc/trino.jks --keystore-password admin@123 --catalog hive --user test --password

更多技术信息请查看云掣官网https://yunche.pro/?t=yrgw

相关推荐

  1. Grafana 配置实时开通LDAP认证-基于AD

    2024-07-17 12:30:01       55 阅读
  2. AWS Directory Service 开启ldaps

    2024-07-17 12:30:01       51 阅读
  3. svn ldap认证临时切换到本地认证

    2024-07-17 12:30:01       20 阅读
  4. 【DevOps工具篇】Keycloak中设置LDAP认证

    2024-07-17 12:30:01       37 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-17 12:30:01       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-17 12:30:01       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-17 12:30:01       58 阅读
  4. Python语言-面向对象

    2024-07-17 12:30:01       69 阅读

热门阅读

  1. SQL Error: 1406, SQLState: 22001

    2024-07-17 12:30:01       25 阅读
  2. cn.hutool.core.util.IdUtil.getSnowflake

    2024-07-17 12:30:01       26 阅读
  3. redistemplate介绍与演示

    2024-07-17 12:30:01       19 阅读
  4. Fixing a Binary String

    2024-07-17 12:30:01       28 阅读
  5. vue搜索框过滤--- computed、watch区别

    2024-07-17 12:30:01       26 阅读
  6. 洛阳建筑设计资质延期续期流程与所需材料

    2024-07-17 12:30:01       19 阅读
  7. ETG2000 5.3.9.2 Offline Dictionary DictionaryFile路径

    2024-07-17 12:30:01       24 阅读
  8. 数学归纳法

    2024-07-17 12:30:01       19 阅读
  9. Python基础:register buffer

    2024-07-17 12:30:01       23 阅读
  10. android.app.application can not be cast to android.app.Activity

    2024-07-17 12:30:01       21 阅读
  11. 优化Conda环境:深入掌握conda clean命令的清理艺术

    2024-07-17 12:30:01       23 阅读
  12. 探索Conda的搜索能力:挖掘Python包的宝藏

    2024-07-17 12:30:01       28 阅读
  13. conda 环境打包与使用

    2024-07-17 12:30:01       30 阅读