Zabbix5 对接 SAML 协议 SSO

Zabbix5 对接 SAML 协议 SSO

  在 Zabbix5.0 开始已经支持 SAML 认证

官文文档:
https://www.zabbix.com/documentation/current/manual/web_interface/frontend_sections/administration/authentication

对接 Keycloak SAML 示例

环境

# Zabbix
http://192.168.20.72/zabbix

# SSO
http://my.keycloak.com/

添加证书文件

首先在 Zabbix 服务器的 /usr/share/zabbix/conf/certs 目录创建 idp.crt 文件

/usr/share/zabbix/conf/certs/idp.crt

文件内容来自 Keycloak “领域设置” --> “秘钥” --> “证书”。

这个修改不需要重启 Zabbix。

创建客户端

然后在 Keycloak 中创建 saml 客户端 test_saml_zabbix

配置如下

IDP发起的SSO URL名称:
http://my.keycloak.com/auth/realms/master/protocol/saml/clients/test_saml_zabbix

断言使用者服务POST绑定URL :
http://192.168.20.72/zabbix/index_sso.php?acs

在客户端模板标签页,移除 role_list。

Mappers 标签页中,添加 User Property 映射器,名称、属性、SAML Attribute Name 三项全部写成 username。

在 Zabbix 中配置 SAML 认证

进入 “管理” --> “认证”,选择“SAML settings”标签。

勾选启用。

配置如下:


# 启用 SAML
Enable SAML authentication
勾选

# 根据实际 Keycloak 地址填写
IdP entity ID
http://my.keycloak.com/auth/realms/master

# Keycloak 中 SAML 客户端的 IDP发起的SSO URL名称
SSO service URL
http://my.keycloak.com/auth/realms/master/protocol/saml/clients/test_saml_zabbix

# Keycloak 中创建的 Mappers
Username attribute
username

# Keycloak 客户端ID
SP entity ID
test_saml_zabbix

# 用户名不区分大小写,根据需要,Zabbix 的默认 Admin 用户,首字母是大写的,可能映射不到。
登录区分大小写
取消勾选

最后,通过 SAML 登录的用户,必须提前在 Zabbix 中创建好。

原文地址:https://www.cnblogs.com/eoalfj/p/13277618.html