LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-11-2011, 04:48 PM   #1
Kr4z
LQ Newbie
 
Registered: Jan 2011
Posts: 2

Rep: Reputation: 0
SquidGuard & LDAP authentication problem


Hi there,

I've just setup a squid-box with an Active Directory authentication. I have :
- Windows 2003 R2 with Active Directory
- CentOS 5.4 with
-- Squid 2.6
-- SquidGuard 1.3.1 patched with LDAP support

Here's my configurations :

squid.conf :

auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp
auth_param ntlm children 30

auth_param basic program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic
auth_param basic children 5
auth_param basic realm Squid AD
auth_param basic credentialsttl 2 hour

acl auth proxy_auth REQUIRED

visible_hostname squid
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl LAB src 10.30.64.0/24
acl LAN src 192.168.2.0/23
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access allow LAB auth
http_access allow LAN auth
http_access deny all
icp_access allow all
http_port 3128
hierarchy_stoplist cgi-bin ?
access_log /var/log/squid/access.log squid
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
coredump_dir /var/spool/squid
# SquidGuard directives
url_rewrite_program /usr/bin/squidGuard -c /etc/squid/squidguard.conf
url_rewrite_children 10


Squidguard.conf :

dbhome /var/lib/squidguard
logdir /var/log/squidguard

ldapbinddn cn=Administrateur,cn=Users,dc=lab,dc=local
ldapbindpass password

src user_full {
ldapusersearch ldap://10.30.64.201/CN=Users,DC=lab,DC=local?sAMAccountName?sub?(&(objectClass=Person)(sAMAccountName=%s))
}

src user_restreint {
ldapusersearch ldap://10.30.64.201/OU=Utilisateurs,OU=LAB,DC=lab,DC=local?sAMAccountName?sub?(&(objectClass=Person)(sAMAccountName=%s)
}

destination whitelist {
domainlist whitelist.destdomainlist
}

acl {
user_full {
pass all
}
user_restreint {
pass whitelist none
redirect http://10.30.64.40/cgi-bin/squidGuar...lass=%t&url=%u
}
default {
pass none
redirect http://10.30.64.40/cgi-bin/squidGuar...lass=%t&url=%u
log default.log
}
}

My Active Directory structure :
- lab.local (DC root)
-- Users (simple group)
--- Administrateur (user)
-- LAB (UO)
--- Utilisateurs (UO)
---- jdoe (sAMAccountName)

From the DC machine logged with administrateur, I can surf all over the web as it's definied in the squidguard.conf.
From a XP machine logged with jdoe, whatever the http request I send, I'm always blocked qith the proper CGI. In the squidguard.log I have that :

2011-01-11 23:14:29 [32285] debug : sgFindUser called with: jdoe
2011-01-11 23:14:29 [32285] Added LDAP source: jdoe
2011-01-11 23:14:29 [32285] debug : sgFindUser called with: jdoe
2011-01-11 23:14:29 [32285] (squidGuard): ldap_search_ext_s failed: Bad search filter (params: OU=Utilisateurs,OU=LAB,DC=lab,DC=local, 2, (&(objectClass=Person)(sAMAccountName=jdoe), sAMAccountName)
2011-01-11 23:14:29 [32285] Added LDAP source: jdoe
2011-01-11 23:14:29 [32285] debug : sgFindUser called with: jdoe
2011-01-11 23:14:29 [32285] debug : sgFindUser called with: jdoe

I can't see what's the problem with the LDAP request, anyone could help me ?

Regards
 
Old 03-04-2011, 06:52 AM   #2
zsoltrenyi
Member
 
Registered: May 2004
Distribution: redhat, trustix, debian
Posts: 103

Rep: Reputation: 15
Did you manage to work this out?
I have the same problem .
Thanks
 
Old 03-07-2011, 02:29 AM   #3
Kr4z
LQ Newbie
 
Registered: Jan 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Hi zsoltrenyi,

Yes I made it work. I've juste used a new syntaxe in the squidguard.conf :

src user_full {
ldapusersearch ldap://1.1.1.1:3268/dc=lab,dc=local?sAMAccountName?sub?(&(memberof=CN=internet_full%2cCN=Users%2cDC=lab%2cDC=local)(sAMA ccountName=%s))


With the Active Directory structure like the Folowing :

- DC = lab.local
-- CN = Users
--- CN = internet_full (group)

For binaries version :

Squid : squid-2.6.STABLE21-6.el5
SquidGuard : SquidGuard: 1.3.1 Berkeley DB 4.6.21: (September 27, 2007) WITHOUT LDAP PATCH !
Samba : samba-3.0.33-3.29.el5_5.1

Hope this will help.

Regards,
Pierre
 
Old 03-17-2011, 10:06 AM   #4
ColinTempler
LQ Newbie
 
Registered: Oct 2008
Posts: 9

Rep: Reputation: Disabled
I'm also configuring squidguard to use ldapsearch but I'm having problems with squid <-> squidguard.
How did you activate the debug log on config?
I just get:

2011-03-17 15:04:18 [5163] INFO: squidGuard 1.5-alpha started (1300374258.106)
2011-03-17 15:04:18 [5163] INFO: recalculating alarm in 5142 seconds
2011-03-17 15:04:18 [5163] INFO: squidGuard ready for requests (1300374258.123)

Thanks!
 
Old 03-18-2011, 02:53 PM   #5
ColinTempler
LQ Newbie
 
Registered: Oct 2008
Posts: 9

Rep: Reputation: Disabled
Quote:
Originally Posted by ColinTempler View Post
I'm also configuring squidguard to use ldapsearch but I'm having problems with squid <-> squidguard.
Still no debug but for the record, permissions were wrong on the log file of squidGuard so I did a:
Code:
chown -R <squiduser> /usr/local/squidGuard/log/
So now I get output log from squidGuard when it's started from squid.
 
  


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
[SOLVED] SquidGuard LDAP authentication with Active Directory okcomputer44 Linux - Networking 2 11-14-2010 05:30 PM
ldap authentication problem raghavendrat Linux - Server 8 04-08-2008 06:32 AM
squidguard authen ldap problem? moochachiro Linux - Server 0 01-08-2008 10:53 PM
squid + ldap or squidguard + ldap or both ?? hackintosh Linux - Server 0 09-18-2007 04:36 AM
ldap authentication problem anjani.78 Linux - Software 7 12-23-2005 11:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:45 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