用户目录对象

以下对象与userdirectory API直接相关。

用户目录

用户目录对象具有以下属性。

Property Type Description
userdirectoryid ID 用户目录的 ID。

如果删除了某个用户目录,则所有链接到该已删除用户目录的用户,其 User object 属性 userdirectoryid 的值将被设置为 "0"。

Property behavior:
- read-only
- required for update operations
idp_type integer 用户目录所使用的身份提供方认证协议类型。
请注意,类型为 SAML 的用户目录只能存在一个。

Possible values:
1 - LDAP 类型的用户目录;
2 - SAML 类型的用户目录。

Property behavior:
- required for create operations
group_name string LDAP/SAML 用户目录属性,包含用于在 LDAP/SAML 用户目录与 Zabbix 之间映射组的组名。

Example: cn

Property behavior:
- required if provision_status is set to "Enabled" and saml_jit_status of Authentication object is set to "Enabled for configured SAML IdPs"
user_username string LDAP/SAML 用户目录属性(如果 scim_status 设置为 "SCIM provisioning is enabled",则也是 SCIM 属性),包含用户的名称;在为用户执行预配时,该值将用作 User object 属性 name 的值。

Examples: cn, commonName, displayName, name
user_lastname string LDAP/SAML 用户目录属性(如果 scim_status 设置为 "SCIM provisioning is enabled",则也是 SCIM 属性),包含用户的姓氏;在为用户执行预配时,该值将用作 User object 属性 surname 的值。

Examples: sn, surname, lastName
provision_status integer 用户目录的预配状态。

Possible values:
0 - (default) Disabled(通过此用户目录创建的用户的预配已禁用);
1 - Enabled(通过此用户目录创建的用户的预配已启用;此外,LDAP 或 SAML 预配的状态(Authentication objectldap_jit_statussaml_jit_status)必须已启用)。
provision_groups array 预配组映射对象数组,用于将 LDAP/SAML 用户组模式映射到 Zabbix 用户组和用户角色。

Property behavior:
- required if provision_status is set to "Enabled"
provision_media array 媒体类型映射对象数组,用于将用户的 LDAP/SAML 媒体属性(例如电子邮件)映射到 Zabbix 用户媒体,以便发送通知。
LDAP-specific properties:
name string 用户目录的唯一名称。

Property behavior:
- required if idp_type is set to "User directory of type LDAP"
host string LDAP 服务器的主机名、IP 或 URI。
URI 必须包含 schema(ldap://ldaps://)、主机和端口(可选)。

Examples:
host.example.com
127.0.0.1
ldap://ldap.example.com:389

Property behavior:
- required if idp_type is set to "User directory of type LDAP"
port integer LDAP 服务器的端口。

Property behavior:
- required if idp_type is set to "User directory of type LDAP"
base_dn string LDAP 用户目录中用户账户的基础路径。

Examples:
ou=Users,dc=example,dc=org
ou=Users,ou=system (for OpenLDAP)
DC=company,DC=com (for Microsoft Active Directory)
uid=%{user},dc=example,dc=com (for direct user binding; placeholder "%{user}" is mandatory)

Property behavior:
- required if idp_type is set to "User directory of type LDAP"
search_attribute string 用于根据登录请求中提供的信息标识用户账户的 LDAP 用户目录属性。

Examples:
uid (for OpenLDAP)
sAMAccountName (for Microsoft Active Directory)

Property behavior:
- required if idp_type is set to "User directory of type LDAP"
bind_dn string 用于绑定并在 LDAP 服务器上执行搜索的 LDAP 服务器账户。

对于直接用户绑定和匿名绑定,bind_dn 必须为空。

Examples:
uid=ldap_search,ou=system (for OpenLDAP)
CN=ldap_search,OU=user_group,DC=company,DC=com (for Microsoft Active Directory)
CN=Admin,OU=Users,OU=Zabbix,DC=zbx,DC=local

Property behavior:
- supported if idp_type is set to "User directory of type LDAP"
bind_password string 用于绑定并在 LDAP 服务器上执行搜索的 LDAP 服务器账户密码。

对于直接用户绑定和匿名绑定,bind_password 必须为空。

Property behavior:
- supported if idp_type is set to "User directory of type LDAP"
description string 用户目录的描述。

Property behavior:
- supported if idp_type is set to "User directory of type LDAP"
group_basedn string LDAP 用户目录中组的基础路径;用于配置 LDAP 用户目录中的用户成员资格检查。

如果设置了 group_membership,则在预配用户时会忽略此项。

Example: ou=Groups,dc=example,dc=com

Property behavior:
- supported if idp_type is set to "User directory of type LDAP"
group_filter string 用于检索用户所属的 LDAP 用户目录组的过滤字符串;用于配置 LDAP 用户目录中的用户成员资格检查。

如果设置了 group_membership,则在预配用户时会忽略此项。

Supported group_filter placeholders:
%{attr} - search attribute(由 search_attribute 属性值替换);
%{groupattr} - group attribute(由 group_member 属性值替换);
%{host} - LDAP 服务器的主机名、IP 或 URI(由 host 属性值替换);
%{user} - Zabbix 用户名。

Default: (%{groupattr}=%{user})

Examples:
- (member=uid=%{ref},ou=Users,dc=example,dc=com) will match "User1" if an LDAP group object contains the "member" attribute with the value "uid=User1,ou=Users,dc=example,dc=com", and will return the group that "User1" is a member of;
- (%{groupattr}=cn=%{ref},ou=Users,ou=Zabbix,DC=example,DC=com) will match "User1" if an LDAP group object contains the attribute specified in the group_member property with the value "cn=User1,ou=Users,ou=Zabbix,DC=example,DC=com", and will return the group that "User1" is a member of.

Property behavior:
- supported if idp_type is set to "User directory of type LDAP"
group_member string 包含组成员信息的 LDAP 用户目录属性;用于配置 LDAP 用户目录中的用户成员资格检查。

如果设置了 group_membership,则在预配用户时会忽略此项。

Property behavior:
- supported if idp_type is set to "User directory of type LDAP"
group_membership string 包含用户所属组信息的 LDAP 用户目录属性。

Example: memberOf

Property behavior:
- supported if idp_type is set to "User directory of type LDAP"
search_filter string 自定义过滤字符串,用于根据登录请求中提供的信息在 LDAP 用户目录中定位并验证用户。

Supported search_filter placeholders:
%{attr} - search attribute name (e.g., uid, sAMAccountName);
%{user} - Zabbix 用户名。

Default: (%{attr}=%{user})

Property behavior:
- supported if idp_type is set to "User directory of type LDAP"
start_tls integer 允许使用传输层安全性(TLS)保护与 LDAP 服务器通信的 LDAP 服务器配置选项。

请注意,对于使用 ldaps:// 协议的主机,必须将 start_tls 设置为 "Disabled"。

Possible values:
0 - (default) Disabled;
1 - Enabled.

Property behavior:
- supported if idp_type is set to "User directory of type LDAP"
user_ref_attr string 用于引用用户对象的 LDAP 用户目录属性。user_ref_attr 的值用于从用户目录中指定的属性获取值,并将其替换为 group_filter 字符串中的 %{ref} 占位符。

Examples: cn, uid, member, uniqueMember

Property behavior:
- supported if idp_type is set to "User directory of type LDAP"
SAML-specific properties:
idp_entityid string 标识身份提供方并用于在 SAML 消息中与身份提供方通信的 URI。

Example: https://idp.example.com/idp

Property behavior:
- required if idp_type is set to "User directory of type SAML"
sp_entityid string 标识身份提供方服务提供方的 URL 或任意字符串。

Examples:
https://idp.example.com/sp
zabbix

Property behavior:
- required if idp_type is set to "User directory of type SAML"
username_attribute string SAML 用户目录属性(如果 scim_status 设置为 "SCIM provisioning is enabled",则也是 SCIM 属性),包含用户的用户名;在认证时,该值会与 User object 属性 username 的值进行比较。

Examples: uid, userprincipalname, samaccountname, username, userusername, urn:oid:0.9.2342.19200300.100.1.1, urn:oid:1.3.6.1.4.1.5923.1.1.1.13, urn:oid:0.9.2342.19200300.100.1.44

Property behavior:
- required if idp_type is set to "User directory of type SAML"
sso_url string 身份提供方的 SAML 单点登录服务 URL,Zabbix 将向其发送 SAML 认证请求。

Example: http://idp.example.com/idp/sso/saml

Property behavior:
- required if idp_type is set to "User directory of type SAML"
slo_url string 身份提供方的 SAML 单点登出服务 URL,Zabbix 将向其发送 SAML 登出请求。

Example: https://idp.example.com/idp/slo/saml

Property behavior:
- supported if idp_type is set to "User directory of type SAML"
encrypt_nameid integer 是否应加密 SAML name ID。

Possible values:
0 - (default) 不加密 name ID;
1 - 加密 name ID。

Property behavior:
- supported if idp_type is set to "User directory of type SAML"
encrypt_assertions integer 是否应加密 SAML 断言。

Possible values:
0 - (default) 不加密断言;
1 - 加密断言。

Property behavior:
- supported if idp_type is set to "User directory of type SAML"
nameid_format string SAML 身份提供方服务提供方的 Name ID 格式。

Examples:
urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
urn:oasis:names:tc:SAML:2.0:nameid-format:transient
urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos
urn:oasis:names:tc:SAML:2.0:nameid-format:entity

Property behavior:
- supported if idp_type is set to "User directory of type SAML"
scim_status integer 是否启用或禁用 SAML 的 SCIM 预配。

Possible values:
0 - (default) SCIM 预配已禁用;
1 - SCIM 预配已启用。

Property behavior:
- supported if idp_type is set to "User directory of type SAML"
sign_assertions integer 是否应使用 SAML 签名对 SAML 断言进行签名。

Possible values:
0 - (default) 不对断言签名;
1 - 对断言签名。

Property behavior:
- supported if idp_type is set to "User directory of type SAML"
sign_authn_requests integer 是否应使用 SAML 签名对 SAML AuthN 请求进行签名。

Possible values:
0 - (default) 不对 AuthN 请求签名;
1 - 对 AuthN 请求签名。

Property behavior:
- supported if idp_type is set to "User directory of type SAML"
sign_messages integer 是否应使用 SAML 签名对 SAML 消息进行签名。

Possible values:
0 - (default) 不对消息签名;
1 - 对消息签名。

Property behavior:
- supported if idp_type is set to "User directory of type SAML"
sign_logout_requests integer 是否应使用 SAML 签名对 SAML 登出请求进行签名。

Possible values:
0 - (default) 不对登出请求签名;
1 - 对登出请求签名。

Property behavior:
- supported if idp_type is set to "User directory of type SAML"
sign_logout_responses integer 是否应使用 SAML 签名对 SAML 登出响应进行签名。

Possible values:
0 - (default) 不对登出响应签名;
1 - 对登出响应签名。

Property behavior:
- supported if idp_type is set to "User directory of type SAML"

媒介类型映射

媒介类型映射对象具有以下属性。

属性 类型 描述
userdirectory_mediaid ID 媒介类型映射 ID。

属性行为:
- 只读
name string 在媒介类型映射列表中显示的名称。

属性行为:
- 必填
mediatypeid ID 要创建的媒介类型 ID;用作 Media object 属性 mediatypeid 的值。

属性行为:
- 必填
attribute string 包含用户媒介的 LDAP/SAML 用户目录属性(如果 scim_status 设置为“已启用 SCIM 配置”,也可以是 SCIM 属性,例如 [email protected]),该值将用作 Media object 属性 sendto 的值。

如果该属性存在于从 LDAP/SAML 身份提供方接收的数据中,且其值非空,则会为已配置的用户触发媒介创建。

属性行为:
- 必填
active integer 为已配置的用户创建媒介时,用户媒介 active 属性的值。

可能的值:
0 - (默认) 已启用;
1 - 已禁用。
severity integer 为已配置的用户创建媒介时,用户媒介 severity 属性的值。

默认值:63。
period string 为已配置的用户创建媒介时,用户媒介 period 属性的值。

默认值:1-7,00:00-24:00。

Provisioning 组映射

Provisioning 组映射具有以下属性。

属性 类型 描述
name string LDAP/SAML 用户目录中的组全名(例如 Zabbix administrators)(如果 scim_status 设置为“已启用 SCIM provisioning”,也包括 SCIM)。
支持通配符字符“*”。
在所有 provisioning 组映射中必须唯一。

属性行为
- 必填
roleid ID 要分配给用户的用户角色 ID。

如果匹配到多个 provisioning 组映射,则将最高用户类型(UserAdminSuper admin)的角色分配给该用户。如果存在多个具有相同用户类型的角色,则将第一个角色(按字母顺序排序)分配给该用户。

属性行为
- 必填
user_groups array Zabbix 用户组 ID 对象数组。每个对象具有以下属性:
usrgrpid - (ID) 要分配给用户的 Zabbix 用户组 ID。

如果匹配到多个 provisioning 组映射,则会将所有匹配映射中的 Zabbix 用户组分配给该用户。

属性行为
- 必填