【问题标题】:OpenLDAP SSL integration - ACL permissions for modifying cn=configOpenLDAP SSL 集成 - 修改 cn=config 的 ACL 权限
【发布时间】:2018-07-06 12:12:45
【问题描述】:

我正在尝试在olcTLSCertificateFile 中添加 ssl 证书。

dn: cn=config
changetype: modify
replace: olcTLSCertificateFile
olcTLSCertificateFile: /etc/openldap/certs/file.crt

dn: cn=config
changetype: modify
replace: olcTLSCertificateKeyFile 
olcTLSCertificateKeyFile: /etc/openldap/certs/file.key

我在 CentOS7 上使用 OpenSSL 将这些证书创建为 Single Sign-on

openssl req -new -x509 -nodes -out /etc/openldap/certs/file.crt -keyout /etc/openldap/certs/file.key -days 3650

这是我添加到 using 的 ACL 权限

#monitor.ldif
dn: olcDatabase={1}monitor,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external, cn=auth" read by dn.base="cn=Manager,dc=domain,dc=com" read by * none

最后,我正在修改文件并收到错误:

ldapmodify -x -W -D "cn=Manager,dc=domain,dc=com"  -H ldapi:/// -f certs.ldif

Enter LDAP Password: 

 modifying entry "cn=config"

ldap_modify:访问权限不足 (50)

【问题讨论】:

    标签: ssl openldap


    【解决方案1】:

    我终于找到了解决办法。只需更改 key 和 crt 文件的顺序即可。

    dn: cn=config
    changetype: modify
    replace: olcTLSCertificateKeyFile 
    olcTLSCertificateKeyFile: /etc/openldap/certs/file.key
    
    dn: cn=config
    changetype: modify
    replace: olcTLSCertificateFile
    olcTLSCertificateFile: /etc/openldap/certs/file.crt
    

    【讨论】:

      【解决方案2】:

      您使用两个单独的 LDAP 请求的任何原因?

      我强烈建议使用单个 LDAP 修改请求,因为单个 LDAP 写入操作是原子的:

      dn: cn=config
      changetype: modify
      replace: olcTLSCertificateKeyFile
      olcTLSCertificateKeyFile: /etc/openldap/certs/file.key
      -
      replace: olcTLSCertificateFile
      olcTLSCertificateFile: /etc/openldap/certs/file.crt
      -
      

      【讨论】:

      • 我们需要在该文件olcTLSCertificateKeyFileolcTLSCertificateFile 中更改两个参数。并且 ldapmodify 一次考虑 1 个参数。
      • 我们要修改的参数添加到replace: In your solution olcTLSCertificateFile will not work.
      • 抱歉,我的回复中缺少某些内容。我已经编辑过了。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-15
      相关资源
      最近更新 更多