This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.16.5.5. 使用增强 Active Directory 模式同步组
在增强 Active Directory 模式中,用户(Jane 和 Jim)和组都作为第一类条目存在于 LDAP 服务器中,组成员资格则存储在用户的属性中。以下 ldif
片段定义了这个模式的用户和组:
使用增强 Active Directory 模式的 LDAP 条目: increaseded_active_directory.ldif
先决条件
- 创建配置文件。
流程
使用
augmented_active_directory_config.yaml
文件运行同步:oc adm groups sync --sync-config=augmented_active_directory_config.yaml --confirm
$ oc adm groups sync --sync-config=augmented_active_directory_config.yaml --confirm
Copy to Clipboard Copied! Toggle word wrap Toggle overflow OpenShift Container Platform 创建以下组记录作为上述同步操作的结果:
使用
augmented_active_directory_config.yaml
文件创建的 OpenShift 组Copy to Clipboard Copied! Toggle word wrap Toggle overflow
16.5.5.1. LDAP 嵌套成员资格同步示例 复制链接链接已复制到粘贴板!
OpenShift Container Platform 中的组不嵌套。在消耗数据之前,LDAP 服务器必须平展组成员资格。Microsoft 的 Active Directory Server 通过 LDAP_MATCHING_RULE_IN_CHAIN
规则支持这一功能,其 OID 为 1.2.840.113556.1.4.1941
。另外,使用此匹配规则时只能同步明确列在白名单中的组。
本节中的示例使用了增强 Active Directory 模式,它将同步一个名为 admins
的组,该组有一个用户 Jane
和一个组 otheradmins
。otheradmins
组具有一个用户成员:Jim
。这个示例阐述了:
- 如何将组和用户添加到 LDAP 服务器中。
- LDAP 同步配置文件的概貌。
- 同步之后 OpenShift Container Platform 中会生成什么组记录。
在增强 Active Directory 模式中,用户(Jane
和 Jim
)和组都作为第一类条目存在于 LDAP 服务器中,组成员资格则存储在用户或组的属性中。以下 ldif
片段定义了这个模式的用户和组:
使用增强 Active Directory 模式和嵌套成员的 LDAP 条目: increaseded_active_directory_nested.ldif
与 Active Directory 同步嵌套的组时,您必须提供用户条目和组条目的 LDAP 查询定义,以及在内部 OpenShift Container Platform 组记录中代表它们的属性。另外,此配置也需要进行某些修改:
-
oc adm groups sync
命令必须明确将组列在白名单中。 -
用户的
groupMembershipAttributes
必须包含"memberOf:1.2.840.113556.1.4.1941:"
,以遵守LDAP_MATCHING_RULE_IN_CHAIN
规则。 -
groupUIDAttribute
必须设为dn
。 groupsQuery
:-
不得设置
filter
。 -
必须设置有效的
derefAliases
。 -
不应设置
basedn
,因为此值将被忽略。 -
不应设置
scope
,因为此值将被忽略。
-
不得设置
为明确起见,您在 OpenShift Container Platform 中创建的组应尽可能将可分辨名称以外的属性用于面向用户或管理员的字段。例如,通过电子邮件标识 OpenShift Container Platform 组的用户,并将该组的名称用作通用名称。以下配置文件创建了这些关系:
使用增强 Active Directory 模式和嵌套成员的 LDAP 同步配置: increaseded_active_directory_config_nested.yaml
先决条件
- 创建配置文件。
流程
使用
augmented_active_directory_config_nested.yaml
文件运行同步:oc adm groups sync \ 'cn=admins,ou=groups,dc=example,dc=com' \ --sync-config=augmented_active_directory_config_nested.yaml \ --confirm
$ oc adm groups sync \ 'cn=admins,ou=groups,dc=example,dc=com' \ --sync-config=augmented_active_directory_config_nested.yaml \ --confirm
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意必须明确将
cn=admins,ou=groups,dc=example,dc=com
组列在白名单中。OpenShift Container Platform 创建以下组记录作为上述同步操作的结果:
使用
augmented_active_directory_config_nested.yaml
文件创建的 OpenShift 组Copy to Clipboard Copied! Toggle word wrap Toggle overflow