PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : squid_ldap_auth authentifizierung



kaya0911
05.05.08, 11:18
Hallo zusammen!

Ich habe die Aufgabe eine Authentifizierungslösung für den Squid zu implementieren.
Diese soll über LDAP laufen... allerdings verzweifle ich langsam.

Ich habe Zugriff auf den Server, die Syntax passt angeblich auch, allerdings will mein Squid ums verrecken keine Authentifizierung von User haben, der surfen will.

(Etwas genauer: User ruft z.B. www.google.de auf => Squid merkt das irgendwer ins Internet will => Abfrage auf Username und PW soll stattfinden => tut es aber nicht :( )

Testweise habe ich auch schon mal den Befehl in ein Script geschrieben um die Funktion der Funktion ldap_auth zu testen... es funktioniert und ich bekomme auch keine Fehlermeldungen zurück.

Hier mal der Auszug aus der squid.conf:
------------
auth_param basic program /usr/sbin/squid_ldap_auth \
-b "DC=localnet,DC=de" \
-D "CN=*****,OU=******,OU=********,OU=*****,DC=****,DC =de" \ #etwas abgeändert leider
-w "PASSWORT" \
-f "sAMAccountName=%s" \
-h "XXX.XXX.XXX.XXX" \
-p "389" \
-v 3
auth_param basic children 5
auth_param basic realm Squid Proxy-caching Webserver
auth_param basic credentialsttl 1 minutes

acl all src 0.0.0.0/0.0.0.0
acl all_auth proxy_auth REQUIRED src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 172.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager

http_access allow SSL_ports
http_access allow Safe_ports

http_access allow all_auth
http_access allow localhost
http_access allow to_localhost


http_access allow CONNECT
http_access deny all
------------------------------------

Theoretisch (nach meinen Infos) sollte der Squid so zwangsläufig nach einer Authentifizierung durch den User fragen... oder nicht?

Hoffe ihr könnt mir helfen

Gruß
Kaya

Dellerium
05.05.08, 14:31
Ja.. Squid und LDAP (bzw. AD) kann ätzend sein :)

nen Tip:

Versuch mal als erstes, nur /usr/sbin/squid_ldap_auth zu verwenden (direkt auf der Shell aufrufen) um zu gucken, dass das komplett funktioniert. Damit kannste dann schon mal ausschliessen, das es ein Problem mit der Squid Konfiguration ist...
Wenn das funktioniert kannste dir als nächstes die Squid Konfiguration anschauen...

kaya0911
08.05.08, 06:26
Gugu nochmal.

Das Modul hat funktioniert, der Aufruf an sich auch.
Entgegen aller Wahrscheinlichkeit war es wirklich die Position in der squid.conf die nicht gepasst hat (ich hab millionen Einträge in Foren gefunden die 's allerdings genau so angeordnet hatten wie ich.... nunja.

Ich post mal die aktuallisierte .conf gleich und markier mal als gelöst

danke trotzdem :)

Gruß Kaya

kaya0911
08.05.08, 06:33
http_port XXXX
cache_peer 1..........171 parent 3128 0
#login=XXXXXXX:XXXXXXX
#hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
#cache deny QUERY
##### LDAP-Anbindung ###############################
auth_param basic children 5
auth_param basic realm Squid Proxy-caching Webserver
auth_param basic credentialsttl 1 minutesm654

auth_param basic program /usr/sbin/squid_ldap_auth \
-b "DC=XXXXXXXX,DC=de" \
-D "CN=XXXXXXXX,OU=XXXXXX,OU=XXXXXXXXXX,OU=XXXX,DC=loc alnet,DC=de" \
-w "xxxxxxxxx" \
-f "sAMAccountName=%s" \
-h "XXX.XXX.XXX.XXX" \
-p "389" \
-v 3
acl all_auth proxy_auth REQUIRED src 0.0.0.0/0.0.0.0
http_access allow all_auth

################################################## ##
acl apache rep_header Server ^Apached
broken_vary_encoding allow apache
cache_mem 16 MB
maximum_object_size 4096 KB
cache_dir ufs /var/squid/cache 100 16 256
access_log /var/log/squid/access.log squid
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
################################################## ##

acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 172.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl CONNECT method CONNECT

################################################## ##
#Recommended minimum configuration:
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# Deny requests to unknown ports
http_access allow SSL_ports
http_access allow Safe_ports

#Allow any requests from localhost
http_access allow localhost
http_access allow to_localhost

http_access allow CONNECT
http_access deny all

icp_access allow all
never_direct allow all

cache_effective_user squid
visible_hostname abschlussprojekt_proxy_chris
unique_hostname abschlussprojekt_proxy_chris_main
coredump_dir /var/cache/squid


Vielleicht hilfts ja einigen Leuten die das gleiche Problem haben :)

mfG
~ Kaya