Bra*_*ace 4 openldap configuration proxied-authorization
我在使用代理授权进行更新时遇到了一些麻烦。我使用UnboundID的LDAP SDK连接到OpenLDAP的,并发送ProxiedAuthorizationV2RequestControl为dn: uid=me,dc=People,dc=example,dc=com
与更新。我已经测试并验证目标用户有权执行操作,但我得到
访问权限不足
当我尝试通过代理身份验证执行此操作时。
我已经配置olcAuthzPolicy=both
在cn=config
与authzTo={0}ldap:///dc=people,dc=example,dc=com??subordinate?(objectClass=inetOrgPerson)
原始用户。authzTo 似乎正在工作;当我改变它时,我得到
无权冒充身份
当我尝试更新时(也用于搜索)。
我ldapwhoami -U portal -Y DIGEST-MD5 -X u:mace -H ldap://yorktown -Z
现在可以在没有 saslauthd 的情况下工作。我只需要将代理用户(门户)的密码存储为纯文本。但是当我尝试更新任何内容时,我仍然遇到“访问权限不足”的问题。
dn: uid=portal,ou=Special Accounts,dc=example,dc=com
objectClass: inetOrgPerson
cn: portal
sn: portal
uid: portal
userPassword: test
authzTo: {0}ldap:///dc=People,dc=example,dc=com??sub?(objectClass=inetOrgPerson)
Run Code Online (Sandbox Code Playgroud)
dn: employeeNumber=1400,dc=People,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: sambaSamAccount
objectClass: shadowAccount
uid: mace
...
Run Code Online (Sandbox Code Playgroud)
下面是从更新登录尝试,尝试添加employeeNumber=1385
作为member
的cn=Data Management
。它似乎正确地查看了嵌套的组,但是一旦它在cn=administrators
.
op tag 0x66, time 1299022001
conn=31595 op=2 do_modify
conn=31595 op=2 do_modify: dn (cn=Data Management,dc=Roles,dc=example,dc=com)
>>> dnPrettyNormal: <cn=Data Management,dc=Roles,dc=example,dc=com>
<<< dnPrettyNormal: <cn=Data Management,dc=Roles,dc=example,dc=com>, <cn=data management,dc=roles,dc=example,dc=com>
conn=31595 op=2 modifications:
replace: member
multiple values
conn=31595 op=2 MOD dn="cn=Data Management,dc=Roles,dc=example,dc=com"
conn=31595 op=2 MOD attr=member
>>> dnPretty: <employeeNumber=1020,dc=People,dc=example,dc=com>
<<< dnPretty: <employeeNumber=1020,dc=People,dc=example,dc=com>
>>> dnPretty: <employeeNumber=1385,dc=People,dc=example,dc=com>
<<< dnPretty: <employeeNumber=1385,dc=People,dc=example,dc=com>
>>> dnNormalize: <employeeNumber=1020,dc=People,dc=example,dc=com>
<<< dnNormalize: <employeeNumber=1020,dc=people,dc=example,dc=com>
>>> dnNormalize: <employeeNumber=1385,dc=People,dc=example,dc=com>
<<< dnNormalize: <employeeNumber=1385,dc=people,dc=example,dc=com>
dnMatch -1 "employeeNumber=1020,dc=people,dc=example,dc=com" "employeeNumber=1385,dc=people,dc=example,dc=com"
bdb_dn2entry("cn=data management,dc=roles,dc=example,dc=com")
==> unique_modify <cn=Data Management,dc=Roles,dc=example,dc=com>
bdb_modify: cn=Data Management,dc=Roles,dc=example,dc=com
bdb_dn2entry("cn=data management,dc=roles,dc=example,dc=com")
bdb_modify_internal: 0x00000043: cn=Data Management,dc=Roles,dc=example,dc=com
>>> dnNormalize: <cn=Administrators,ou=LDAP,dc=Applications,dc=example,dc=com>
<<< dnNormalize: <cn=administrators,ou=ldap,dc=applications,dc=example,dc=com>
=> bdb_entry_get: ndn: "cn=administrators,ou=ldap,dc=applications,dc=example,dc=com"
=> bdb_entry_get: oc: "(null)", at: "member"
bdb_dn2entry("cn=administrators,ou=ldap,dc=applications,dc=example,dc=com")
bdb_entry_get: rc=0
>>> dnNormalize: <cn=system administrators,dc=roles,dc=example,dc=com>
<<< dnNormalize: <cn=system administrators,dc=roles,dc=example,dc=com>
=> bdb_entry_get: ndn: "cn=system administrators,dc=roles,dc=example,dc=com"
=> bdb_entry_get: oc: "(null)", at: "member"
bdb_dn2entry("cn=system administrators,dc=roles,dc=example,dc=com")
bdb_entry_get: rc=0
>>> dnNormalize: <employeeNumber=1306,dc=people,dc=example,dc=com>
<<< dnNormalize: <employeeNumber=1306,dc=people,dc=example,dc=com>
=> bdb_entry_get: ndn: "employeeNumber=1306,dc=people,dc=example,dc=com"
=> bdb_entry_get: oc: "(null)", at: "member"
bdb_dn2entry("employeeNumber=1306,dc=people,dc=example,dc=com")
bdb_entry_get: rc=16
>>> dnNormalize: <employeeNumber=1329,dc=people,dc=example,dc=com>
<<< dnNormalize: <employeeNumber=1329,dc=people,dc=example,dc=com>
=> bdb_entry_get: ndn: "employeeNumber=1329,dc=people,dc=example,dc=com"
=> bdb_entry_get: oc: "(null)", at: "member"
bdb_dn2entry("employeeNumber=1329,dc=people,dc=example,dc=com")
bdb_entry_get: rc=16
>>> dnNormalize: <employeeNumber=1401,dc=people,dc=example,dc=com>
<<< dnNormalize: <employeeNumber=1401,dc=people,dc=example,dc=com>
=> bdb_entry_get: ndn: "employeeNumber=1401,dc=people,dc=example,dc=com"
=> bdb_entry_get: oc: "(null)", at: "member"
bdb_dn2entry("employeeNumber=1401,dc=people,dc=example,dc=com")
bdb_entry_get: rc=16
>>> dnNormalize: <employeeNumber=1400,dc=people,dc=example,dc=com>
<<< dnNormalize: <employeeNumber=1400,dc=people,dc=example,dc=com>
=> bdb_entry_get: ndn: "employeeNumber=1400,dc=people,dc=example,dc=com"
=> bdb_entry_get: oc: "(null)", at: "member"
bdb_dn2entry("employeeNumber=1400,dc=people,dc=example,dc=com")
bdb_entry_get: rc=16
bdb_modify: modify failed (50)
send_ldap_result: conn=31595 op=2 p=3
send_ldap_result: err=50 matched="" text=""
send_ldap_response: msgid=3 tag=103 err=50
conn=31595 op=2 RESULT tag=103 err=50 text=
Run Code Online (Sandbox Code Playgroud)
大约一年前我经历过,使用代理授权让我发疯。所以我可能没有明确的答案,但也许我可以提供帮助。
首先:增加 slapd 的日志级别!它很冗长,但它有帮助。第二:使用ldapwhoami测试代理授权。您可以使用 -X 选项指定目标用户,并在 -U 中指定代理用户。
# ldapwhoami -U proxyuser -Y DIGEST-MD5 -X u:targetuser -H ldap://localhost
Run Code Online (Sandbox Code Playgroud)
您应该在配置中启用两个参数。该olcAuthzPolicy(你有)和olcAuthzRegexp(用于构建SASL验证字符串)。这是我的配置:
olcAuthzRegexp: "^uid=([^,]+).*,cn=[^,]*,cn=auth$"
"ldap:///dc=example,dc=net??sub?(uid=$1)"
olcAuthzPolicy: to
Run Code Online (Sandbox Code Playgroud)
最后,正如您所说,您的 proxyuser 应该有一个authzTo属性。这是我的代理用户之一的定义:
dn: cn=proxyuser,dc=example,dc=net
uid: proxyuser
mail: proxyuser@example.net
sn: proxyuser
cn: proxyuser
objectClass: inetOrgPerson
objectClass: top
structuralObjectClass: inetOrgPerson
authzTo: {0}ldap:///dc=example,dc=net??sub?(objectClass=inetOrgPerson)
userPassword:: iodqwhdowihw0123hef92e=
Run Code Online (Sandbox Code Playgroud)
现在应该足以使代理授权工作(再次使用 ldapwhoami 对其进行测试)。我在我的 wiki(SASL 和代理授权)上写了一个章节,因为我需要它从 cyrus-imapd 和 postfix 连接到 openldap。有关更多信息,请查看它:http : //wiki.linuxwall.info/doku.php/en : ressources : dossiers : openldap : openldap_debian#sasl
归档时间: |
|
查看次数: |
2603 次 |
最近记录: |