首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >LDAP只具有ldapmodify & .ldif文件大用户访问权限

LDAP只具有ldapmodify & .ldif文件大用户访问权限
EN

Server Fault用户
提问于 2011-09-29 14:19:52
回答 2查看 10.5K关注 0票数 0

我想更改我的新LDAP服务器的设置,只允许服务器的用户读取条目,而不是匿名的。目前,我的olcAccess如下所示:

代码语言:javascript
复制
olcAccess: {0} to attrs=userPassword,shadowLastChange by self write by anonymous auth by dn="cn=admin,dc=example,dc=com" write by * none
olcAccess: {1} to * by self write by dn="cn=admin,dc=example,dc=com" write by * read

我试图像这样改变它:

代码语言:javascript
复制
olcAccess: {0}to attrs=userPassword,shadowLastChange by self write by anonymous auth by dn="cn=admin,dc=example,dc=com" write by * none
olcAccess: {1} to * by self write by dn="cn=admin,dc=exampme,dc=com" write by users read

但这让我根本无法进入。有人能帮我吗?

谢谢

更新:这是userxxx提到的更改之后读取的日志。

代码语言:javascript
复制
Sep 30 10:47:21 j16354 slapd[11805]: conn=1437 fd=28 ACCEPT from IP=87.149.169.6:64121     (IP=0.0.0.0:389)
Sep 30 10:47:21 j16354 slapd[11805]: conn=1437 op=0 do_bind: invalid dn (pbrechler)
Sep 30 10:47:21 j16354 slapd[11805]: conn=1437 op=0 RESULT tag=97 err=34 text=invalid DN
Sep 30 10:47:21 j16354 slapd[11805]: conn=1437 op=1 UNBIND
Sep 30 10:47:21 j16354 slapd[11805]: conn=1437 fd=28 closed
Sep 30 10:47:21 j16354 slapd[11805]: conn=1438 fd=28 ACCEPT from IP=87.149.169.6:64122     (IP=0.0.0.0:389)
Sep 30 10:47:21 j16354 slapd[11805]: conn=1438 op=0 do_bind: invalid dn (pbrechler)
Sep 30 10:47:21 j16354 slapd[11805]: conn=1438 op=0 RESULT tag=97 err=34 text=invalid DN
Sep 30 10:47:21 j16354 slapd[11805]: conn=1438 op=1 UNBIND
Sep 30 10:47:21 j16354 slapd[11805]: conn=1438 fd=28 closed

pbrechler应该是一个有效的用户,但是没有系统用户(我们不需要),admin也不工作

  1. 列表项目
EN

回答 2

Server Fault用户

发布于 2011-09-29 20:01:49

olcAccess:{0}到attrs=userPassword,shadowLastChange用匿名方式写dn="cn=admin,dc=example,dc=com“,由* none olcAccess:{1}to attrs=uid,uidNumber,gidNumber by dn="cn=admin,dc=example,dc=com”写,由* read olcAccess:{2}to *由cn=admin写成,由匿名用户写

olc{1} ... by * read可能是by * auth,这取决于pam_ldap的配置以及客户机机器(而不是用户)如何进行身份验证。

编辑为响应:

有效的dns看起来像uid=username,ou=users,dc=sub,dc=domain,dc=tld

username不是一个有效的dn语法,而且从来都不是。

olcAccess无法改变这一点。

( SASL /olcAuthzRegexp可以做各种有趣的事情,但是没有提供足够的细节来知道系统是否使用SASL。)

如果这台机器只使用ldap进行对话,您可以将它限制在本地主机(或者套接字,也就是ldapi,如果客户端软件支持它)。dn命名规则仍然适用。

另外,如果dn="cn=admin,dc=example,dc=com“被定义为数据库的根,则不需要在数据库的olcAccess中列出它。dn始终具有对数据库中的所有write的写访问权。

票数 1
EN

Server Fault用户

发布于 2011-09-29 14:56:46

试试这个:

代码语言:javascript
复制
access to attrs=userPassword,shadowLastChange 
    by self write 
    by anonymous auth 
    by dn="cn=admin,dc=example,dc=com" write 
    by users read
    by * none
access to * 
    by self write 
    by dn="cn=admin,dc=example,dc=com" write 
    by * read

但是您可能会考虑两个安全风险:第一个是access to attrs=userPassword,shadowLastChange by users read,这意味着用户可以读取影子密码并使用工具破解。第二个是access to * by self write,因此用户可以将uidNumber和/或gidNumber更改为根。

因此,我建议以下ACL:

代码语言:javascript
复制
access to attrs=userPassword,shadowLastChange 
    by self write 
    by anonymous auth 
    by dn="cn=admin,dc=example,dc=com" write 
    by users none
access to * 
    by dn="cn=admin,dc=example,dc=com" write 
    by * read
票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/316838

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档