Apache trino的ldap认证开启

作者:櫰木

1、背景

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

2、配置

前置条件。

trino 集群已经部署完成

ldap 服务

openjdk 版本大于11.0.17

生成证书

bash 复制代码
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= [email protected]−base−dn=cn=accounts,dc=dtstack,dc=comldap.user−bind−pattern=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

相关推荐
wusam4 小时前
Linux系统管理与编程20:Apache
linux·运维·服务器·apache·shell编程
Johny_Zhao11 小时前
Ubuntu安装部署Zabbix网络监控平台和设备配置添加
linux·网络·mysql·网络安全·信息安全·云计算·apache·zabbix·shell·yum源·系统运维·itsm
搬砖的工人12 小时前
Docker环境下的Apache NiFi安装实践踩坑记录
docker·容器·apache
曼岛_18 小时前
[Java实战]Spring Boot 3 整合 Apache Shiro(二十一)
java·spring boot·apache
网安INF4 天前
Apache Shiro 1.2.4 反序列化漏洞(CVE-2016-4437)
java·网络安全·apache
大数据追光猿4 天前
【大数据】服务器上部署Apache Paimon
大数据·服务器·docker·架构·apache
斯普信专业组5 天前
基于Kubernetes的Apache Pulsar云原生架构解析与集群部署指南(上)
云原生·kubernetes·apache
C-20025 天前
使用Deployment部署运行Nginx和Apache服务
运维·kubernetes·apache
斯普信专业组5 天前
基于Kubernetes的Apache Pulsar云原生架构解析与集群部署指南(下)
云原生·kubernetes·apache
沉默的松饼5 天前
《开源先锋Apache软件基金会:历史沿革、顶级项目与行业影响》
apache