LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-24-2015, 05:26 PM   #1
ariva
LQ Newbie
 
Registered: Oct 2015
Posts: 6

Rep: Reputation: Disabled
Apache 2.4 mod_authnz_ldap cannot restrict authentication to specific group


Hello!
I am trying to restrict authenticated A.D. users to "Only_This_Group" OU, but instead any A.D. user can successfully login.
I am using Apache 2.4 on CentOS 7.

This is my actual (anonymised) VirtualHost config:

Code:
<VirtualHost *:443>
    ServerName  somesite.example.com
    ServerAlias somesite
    DocumentRoot /var/www/html/somesite

    ErrorLog    logs/somesite.example.com-error_log
    TransferLog logs/somesite.example.com-access_log
    CustomLog   logs/somesite.example.com-request_log "t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
    LogLevel    warn

    SSLEngine      on
    SSLHonorCipherOrder on
    SSLProtocol    all -SSLv2
    SSLCipherSuite HIGH:MEDIUM:!ADH:!AECDH:-ADH-DES-CBC3-SHA:-ADH-RC4-MD5:-ADH-AES128-SHA:-ADH-AES256-SHA

    SSLCertificateFile    /etc/pki/tls/certs/example.com.crt
    SSLCertificateKeyFile /etc/pki/tls/private/example.com.key
    SSLCertificateChainFile /etc/pki/tls/certs/intermediate.example.com.crt
    SSLCACertificateFile /etc/pki/tls/certs/intermediate.example.com.crt

    <Location />
        AuthLDAPBindDN "cn=ldapuser,ou=tec,ou=accounts,DC=example,DC=com"
        AuthLDAPBindPassword "ultra_sophisticated_password"
        AuthLDAPURL "ldap://192.168.0.1 192.168.0.2/ou=employees,ou=accounts,DC=example,DC=com?sAMAccountName?sub?(objectClass=*)" NONE
        AuthLDAPBindAuthoritative On

        AuthType Basic
        AuthName "LDAP Authentication"
        AuthBasicProvider ldap
        AuthUserFile /dev/null

        Require ldap-attribute nsAccountLock!="True"
        Require ldap-group CN=Only_This_Group,OU=Dist,OU=Groups,DC=example,DC=com
        Require valid-user
    </Location>
I did try, but couldn't find the cause, why any A.D. user is successfully authenticated.
All users were double-check. They are not members of "Only_This_Group" OU.
Thanks a lot for help!

Last edited by ariva; 10-25-2015 at 04:09 PM. Reason: forgot to mention OS version
 
Old 10-29-2015, 05:55 PM   #2
ariva
LQ Newbie
 
Registered: Oct 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
Restrict AuthLDAPURL

Ok, it can be managed by restrict the AuthLDAPURL:

## AuthLDAPURL "ldap://192.168.0.1 192.168.0.2/ou=employees,ou=accounts,DC=example,DC=com?sAMAccountName?sub?(objectClass=*)" NONE

AuthLDAPURL "ldap://192.168.0.1 192.168.0.2/ou=employees,ou=accounts,DC=example,DC=com?sAMAccountName?sub?(&(objectCategory=person)(objectClass= user)(memberOf=Only_This_Group,OU=Dist,OU=Groups,DC=example,DC=com))" NONE

After that no additional Require ldap-group nor Require ldap-filter directive is needed.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mod_authnz_ldap installation in Apache for LDAP authentication nigam.satyam Linux - Newbie 1 03-31-2014 08:49 AM
Restrict access to the Linux server by some specific group of users. amalendu.rakshit Linux - Security 4 07-02-2013 01:18 AM
LDAP: restrict users to certain applications only (group based authentication) geopcgeo Linux - General 1 05-27-2013 06:58 PM
[SOLVED] Apache Restrict Access to Specific URL Based on IP Obscurious Linux - Newbie 2 11-01-2012 06:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration