用户目录 object

以下 objects 直接与 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 object 中的 ldap_jit_statussaml_jit_status)必须已启用)。
provision_groups array 用于将 LDAP/SAML 用户组模式映射到 Zabbix 用户组和用户角色的 provisioning groups mappings 对象数组。

Property behavior:
- required if provision_status is set to "Enabled"
provision_media array 用于将用户的 LDAP/SAML 媒体属性(例如电子邮件)映射到 Zabbix 用户媒体以发送通知的 media type mappings 对象数组。
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(适用于 OpenLDAP)
DC=company,DC=com(适用于 Microsoft Active Directory)
uid=%{user},dc=example,dc=com(用于直接用户绑定;占位符 "%{user}" 为必填)

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

Examples:
uid(适用于 OpenLDAP)
sAMAccountName(适用于 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(适用于 OpenLDAP)
CN=ldap_search,OU=user_group,DC=company,DC=com(适用于 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 属性值);
%{groupattr} - 组属性(替换为 group_member 属性值);
%{host} - LDAP 服务器的主机名、IP 或 URI(替换为 host 属性值);
%{user} - Zabbix 用户用户名。

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

Examples:
- (member=uid=%{ref},ou=Users,dc=example,dc=com) 如果某个 LDAP 组对象包含值为 "uid=User1,ou=Users,dc=example,dc=com" 的 "member" 属性,则会匹配 "User1",并返回 "User1" 所属的组;
- (%{groupattr}=cn=%{ref},ou=Users,ou=Zabbix,DC=example,DC=com) 如果某个 LDAP 组对象包含 group_member 属性中指定的属性,且其值为 "cn=User1,ou=Users,ou=Zabbix,DC=example,DC=com",则会匹配 "User1",并返回 "User1" 所属的组。

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} - 搜索属性名(例如 uidsAMAccountName);
%{user} - Zabbix 用户用户名。

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

Property behavior:
- supported if idp_type is set to "User directory of type LDAP"
start_tls integer LDAP 服务器配置选项,允许使用传输层安全性(TLS)来保护与 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 标识身份提供方的 URI,用于在 SAML 消息中与身份提供方通信。

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"

媒体类型映射

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

Property Type Description
userdirectory_mediaid ID 媒体类型映射 ID。

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

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

属性行为
- 必填
attribute string LDAP/SAML 用户目录属性(如果 scim_status 设置为 "SCIM provisioning is enabled",也包括 SCIM 属性),其中包含用户的媒体信息(例如 [email protected]),并用作 Media object 属性 sendto 的值。

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

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

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

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

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

配置组映射

配置组映射具有以下属性。

Property Type Description
name string LDAP/SAML 用户目录中某个组的完整名称(例如,Zabbix administrators)(如果 scim_status 设置为“已启用 SCIM 配置”,SCIM 中也适用)。
支持通配符字符 "*"。
在所有配置组映射中必须唯一。

Property behavior:
- required
roleid ID 要分配给用户的用户角色 ID。

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

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

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

Property behavior:
- required