Hi team,
I need some help on integration of SVN, Apache and LDAP.
Currently we are using ‘/var/www/svn/users-access-file’ to store SVN admin users.
Problem with this approach is if new admin users are added in LDAP then we have to change above file as well (for adding new users).
Also, storing user names in ‘/var/www/svn/users-access-file’ is always discouraged as it may violate security.
So, is there any way I can avoid using ‘/var/www/svn/users-access-file’ and achieve read/write access to SVN based on groups of LDAP users?
I am also investing but as I am new to this area so your help may improve my investigation.
System Details are as below:
CentOS release 6.8 (Final)
httpd-2.2.15-54.el6.centos.x86_64
Regards,
Kedar.
Hi team,
I need some help on integration of SVN, Apache and LDAP.
Currently we are using ‘/var/www/svn/users-access-file’ to store SVN admin users.
Problem with this approach is if new admin users are added in LDAP then we have to change above file as well (for adding new users).
Also, storing user names in ‘/var/www/svn/users-access-file’ is always discouraged as it may violate security.
So, is there any way I can avoid using ‘/var/www/svn/users-access-file’ and achieve read/write access to SVN based on groups of LDAP users?
I am also investing but as I am new to this area so your help may improve my investigation.
<RequireAll>
Require valid-user
<Limit HEAD GET OPTIONS PROPFIND REPORT>
<RequireAny>
# Read access
Require ldap-group cn=svn.admin,ou=group,dc=example,dc=com
Require ldap-group cn=svn.readonly,ou=group,dc=example,dc=com
</RequireAny>
</Limit>
<LimitExcept HEAD GET OPTIONS PROPFIND REPORT>
<RequireAny>
# Write access
Require ldap-group cn=svn.admin,ou=group,dc=example,dc=com
</RequireAny>
</LimitExcept>
</RequireAll>
Hi Brane,
Thank you for reply.
I am providing some inputs about my experiement as of now.
I am using ‘httpd-2.2.15-54.el6.centos.x86_64’ httpd.
I have attached ldif file and ‘/etc/httpd/conf.d/subversion.conf’ files for your reference.
I have also attached ‘sssd.conf’ (to interact with LDAP).
Still I have not been able to grant read access to gidNumber: 500 and read/write access to gidNumber: 491 from ldap.
Do you see any obvious issue in attached files? Your advice will be a great help!
Regards,
Kedar.
Hi Brane,
I tried to follow your suggestions. Please refer attached latest version of ‘subversion.conf’
1. I updated my subversion.conf to include ‘AuthLDAPGroupAttribute’ attribute. Its value is set to cn as cn attribute has the group name (to which user is assigned)
dn: uid=sssd_pb,ou=users,dc=sprint,dc=com
objectClass: organizationalPerson
objectClass: person
objectClass: inetOrgPerson
objectClass: top
objectClass: posixAccount
cn: cn=Admin,ou=groups,dc=sprint,dc=com
gidNumber: 491
homeDirectory: /home/qns-svn
sn: sn_sssd_pb
uid: sssd_pb
uidNumber: 491
userPassword:: e1NTSEF9Qi94UDJVK3dtbWFDQW5hRVR5ZW1uL2RnenFudnBMdlNoaUxkOFE9P
Q==
2. I included cn in ‘Require ldap-group’ at line 43 in subversion.conf
Require ldap-group cn=Admin,ou=groups,dc=sprint,dc=com
3. I also tried turning ‘AuthLDAPGroupAttributeIsDN’ attribute on and off.
But none of the above attempt helped me to get sssd_pb user authorized in Admin/RW role. Currently sssd_pb user gets READONLY access by default.
Is there any way I can check for logs? If I get some relevant logs, I myself can dig down more.
I came across below 2 urls which claim that it is not possible to get rid of AuthzSVNAccessFile directive and you must use a file to configure groups and users.
https://github.com/whitlockjc/sync-ldap-groups-to-svn-authz
Now, I am little confused about whether it is really possible (or not) to fully avoid configuring groups and user names in a separate file.
Brane,
Appreciate your help in advance!
Depending upon your feedback I may have to decide if to build a python script or to explore more in current experiment.
Regards,
Kedar.
Hi Brane,
I tried to follow your suggestions. Please refer attached latest version of ‘subversion.conf’
1. I updated my subversion.conf to include ‘AuthLDAPGroupAttribute’ attribute. Its value is set to cn as cn attribute has the group name (to which user is assigned)
Is there any way I can check for logs? If I get some relevant logs, I myself can dig down more.
I came across below 2 urls which claim that it is not possible to get rid of AuthzSVNAccessFile directive and you must use a file to configure groups and users.
https://github.com/whitlockjc/sync-ldap-groups-to-svn-authz
Now, I am little confused about whether it is really possible (or not) to fully avoid configuring groups and user names in a separate file.
Thank you, Brane, for your reply.
I updated subversion.conf to include group’s attribute memberUid
AuthLDAPURL ldaps://ldap_l.cisco.com:10648/dc=sprint,dc=com?hasSubordinates,objectClass?sub?uid
AuthLDAPBindDN uid=admin,ou=system
AuthLDAPBindPassword secret
AuthzLDAPAuthoritative on
AuthLDAPGroupAttributeIsDN off
#AuthLDAPGroupAttribute cn
AuthLDAPGroupAttribute memberUid
#<RequireAll>
Require valid-user
<Limit HEAD GET OPTIONS PROPFIND REPORT>
#<RequireAny>
# Read access
Require ldap-group cn=User,ou=groups,dc=sprint,dc=com
#</RequireAny>
</Limit>
<LimitExcept HEAD GET OPTIONS PROPFIND REPORT>
#<RequireAny>
# Write access
Require ldap-group cn=Roles,ou=groups,dc=sprint,dc=com
Require ldap-attribute gidNumber=491
#Require ldap-group cn=Admin,ou=groups,dc=sprint,dc=com
#</RequireAny>
</LimitExcept>
#</RequireAll>
I have also updated screen shots for sssd_pb and Roles group. I feel there is something wrong in this ldif because of which it is still not working.
Output of ldapsearch is
KSIRSHIK-M-33TW:~ ksirshik$ ldapsearch -H ldaps://ldap_l.cisco.com:10648 -x -D "uid=admin,ou=system" -W -b "dc=sprint,dc=com" -s sub -a always -z 1000 "uid=sssd_pb"
Enter LDAP Password:
# extended LDIF
#
# LDAPv3
# base <dc=sprint,dc=com> with scope subtree
# filter: uid=sssd_pb
# requesting: ALL
#
# sssd_pb, Admin, groups, sprint.com
dn: uid=sssd_pb,cn=Admin,ou=groups,dc=sprint,dc=com
sn: sn_sssd_pb
cn: cn_sssd_pb
objectClass: posixAccount
objectClass: top
objectClass: inetOrgPerson
objectClass: person
objectClass: organizationalPerson
homeDirectory: /home/qns-svn
gidNumber: 491
uidNumber: 491
userPassword:: e1NTSEF9dGFPUmpYdTZ4TUxUemdmTjJVVlE3TkJiRVQwYkVqZWxTQ2V2T3c9PQ=
=
uid: sssd_pb
# sssd_pb, users, sprint.com
dn: uid=sssd_pb,ou=users,dc=sprint,dc=com
sn: sn_sssd_pb
cn: cn=Admin,ou=groups,dc=sprint,dc=com
objectClass: posixAccount
objectClass: top
objectClass: inetOrgPerson
objectClass: person
objectClass: organizationalPerson
homeDirectory: /home/qns-svn
gidNumber: 491
uidNumber: 491
userPassword:: e1NTSEF9Qi94UDJVK3dtbWFDQW5hRVR5ZW1uL2RnenFudnBMdlNoaUxkOFE9PQ=
=
uid: sssd_pb
# search result
search: 2
result: 0 Success
# numResponses: 3
# numEntries: 2
KSIRSHIK-M-33TW:~ ksirshik$
Regards,
Kedar.
From: Branko Čibej <br...@apache.org>
Organization: The Apache Software Foundation
Date: Saturday, September 2, 2017 at 5:07 AM
To: "Kedar Sirshikar (ksirshik)" <ksir...@cisco.com>, "us...@subversion.apache.org" <us...@subversion.apache.org>
Subject: Re: Can i read/write(based on LDAP group) to SVN without using AuthzSVNAccessFile directive
On 02.09.2017 03:50, Kedar Sirshikar (ksirshik) wrote:
Hi Brane,
I just found out that it is still referring to ‘/var/www/svn/users-access-file’ even after removing it from subversion.conf. I also deleted ‘users-access-file’ file from ‘/var/www/svn’
I even tried commenting below line from subversion.conf but still same error.
#LoadModule authz_svn_module modules/mod_authz_svn.so
In every case, I am still getting 403 error in logs:
[Tue Sep 05 08:11:33 2017] [error] [client 172.16.2.14] (2)No such file or directory: Failed to load the AuthzSVNAccessFile: Can't open file '/ var/www/svn/users-access-file': No such file or directory
I am not able to understand why it is still referring to earlier configured ‘AuthzSVNAccessFile /var/www/svn/users-access-file’ directive.
Regards,
Kedar.
Yes Brane, I changed the correct subversion configuration file (/etc/httpd/conf.d/subversion.conf) and I also restarted the server using ‘/etc/init.d/httpd restart’ command.