5.2 |
- Zugriffsweiterleitung an übergeordnete Proxyserver
- Trage einen übergeordneten Proxy z.B. server:81 in die squid.conf ein
# TAG: cache_peer
# To specify other caches in a hierarchy, use the format:
#
# cache_peer hostname type http-port icp-port [options]
#
# For example,
#
# # proxy icp
# # hostname type port port options
# # -------------------- -------- ----- ----- -----------
# cache_peer parent.foo.net parent 3128 3130 default
# cache_peer sib1.foo.net sibling 3128 3130 proxy-only
# cache_peer sib2.foo.net sibling 3128 3130 proxy-only
# cache_peer example.com parent 80 0 default
# cache_peer cdn.example.com sibling 3128 0
#
# type: either 'parent', 'sibling', or 'multicast'.
#
# proxy-port: The port number where the peer accept HTTP requests.
# For other Squid proxies this is usually 3128
# For web servers this is usually 80
#
# icp-port: Used for querying neighbor caches about objects.
# Set to 0 if the peer does not support ICP or HTCP.
# See ICP and HTCP options below for additional details.
Sperre störende (besser jegliche) Direktzugriffe auf interne oder externe Server
# With 'never_direct' you can use ACL elements to specify
# requests which should NEVER be forwarded directly to origin
# servers. For example, to force the use of a proxy for all
# requests, except those in your local domain use something like:
#
# acl local-servers dstdomain .foo.net
# never_direct deny local-servers
# never_direct allow all
- Erstelle eine Autoproxykonfigurationsdatei (nach folgendem Muster) für dein Client-System
Nachschlagewerke:
- http://de.wikipedia.org/wiki/Proxy_Auto-Config
- http://findproxyforurl.com/
function FindProxyForURL(url, host) { return "PROXY proxy.example.com:8080; DIRECT"; } function FindProxyForURL(url, host) {
// Adressen, die auf example.com liegen, brauchen keinen Proxy:
if (shExpMatch(host,"*.example.com")) {
return "DIRECT";
}
// URLs innerhalb dieses Netzwerkes werden abgefragt über
// Port 8080 auf fastproxy.example.com: (macht Nameserver Anfrage)
if (isInNet(host, "10.0.0.0", "255.255.248.0")) {
return "PROXY fastproxy.example.com:8080";
}
// Alle anderen Anfragen gehen über Port 8000 von proxy.example.com.
// sollte das fehlschlagen, verbinde direkt ins Netz:
return "PROXY proxy.example.com:8000; DIRECT";
}
- Stelle (den Browsern) im Netz eine http://localhost/wpad.dat Proxykonfiguration zur Verfügung
- Der Content-Type ist application/x-ns-proxy-autoconfig (AddType oder /etc/mime.types)
- Teste die Konfiguration mit versch. Adressen (lokal/remote)
- Filtern unerwünschter URLs mit einer ACL vom Typ *url*
ACL-Typen http://www.squid-handbuch.de/hb/node46_ct.html, http://www.squid-cache.org/Doc/config/acl
arp mac-adresse (von Clients) acl TEST arp 01:02:03:04:05:06
src ip-adresse/netzmaske (Client-IP-Adressen) acl TEST src 10.3.42.0/24
dst ip-adresse/netzmaske (Server-IP-Adressen) acl TEST dst 129.103.63.0/24
myip ip-adresse/netzmaske (lokale Socket-IP)
srcdomain domainname (Client-Domainnamen) acl TEST srcdomain .mydomain.de
dstdomain domainname (alle Ziel-WebServer) acl TEST dstdomain .yourdomain.de
srcdom_regex [-i] expression (reguläre Ausdrücke für Client-Domainnamen)
dstdom_regex [-i] expression (Domainnamen von Ziel-WebServern)
time [day] h1:m1-h2:m2 (Zeitfenster) acl TEST1 time 07:30-16:00
acl TEST2 time S 00:00-23:59 #So
url_regex [-i] expression (reguläre Ausdrücke für URLs) acl TEST url_regex http://www
urlpath_regex [-i] expression (.. nur für den Pfadteil) acl TEST urlpath_regex -i \.png$
port port (TCP-Portnummern für Ziel-WebServer) acl TEST1 port 80 81 21
acl TEST2 port 0-1024
myport port (lokale Socket Portnummer) acl TEST myport 3128
proto protocol (Protokolltypen) acl TEST proto FTP
method method (HTTP-Anfragemethode[n]) acl TEST method GET POST
browser [-i] expression (regex im User-Agent) acl TEST browser -i Mozilla.*
ident username (Benutzer Ident. REQUIRED für jeden) acl TEST ident moritz
ident_regex [-i] expression (regex für Benutzernamen) acl TEST -i ...
src_as number (Quellnetze, mit AS-Nummer) acl TEST -i ...
dst_as number (Zielnetze, die über AS-Nummer) acl TEST -i ...
proxy_auth username (Benutzer Authentifizierung über ext. Prozess, REQUIRED für jeden)
acl TEST proxy_auth max moritz
proxy_auth_regex [-i] expression (regex für Benutzer) acl TEST proxy_auth_regex -i ...
snmp_community string (SNMP Community String) acl TEST snmp_community public
maxconn number (maximale Verbindungen von einem Client) acl TEST maxconn 16
req_mime_type [-i] expression1 ...
- Sperre durch eine ACL vom Typ "dstdomain" den Zugriffe auf illegale Download-Portale
- Schütze durch "urlpath_regex" die Client-Systeme vor ausführbaren Dateiextensions
und Flash-Files (Flash verwendet als Datei-Extension .swf)
- Optionale Aufgabe:
- Proxy-Authentifikation
- Erlaube den Internet Zugriff nur nach einer Proxy-Anmeldung
Beispiele befinden sich im Bereich "OPTIONS FOR AUTHENTICATION"
der Datei /etc/squid/squid.conf.documented
##Recommended minimum configuration per scheme:
##auth_param negotiate program <uncomment and complete this line to activate>
##auth_param negotiate children 20 startup=0 idle=1
##auth_param negotiate keep_alive on
##
##auth_param ntlm program <uncomment and complete this line to activate>
##auth_param ntlm children 20 startup=0 idle=1
##auth_param ntlm keep_alive on
##
##auth_param digest program <uncomment and complete this line>
##auth_param digest children 20 startup=0 idle=1
##auth_param digest realm Squid proxy-caching web server
##auth_param digest nonce_garbage_interval 5 minutes
##auth_param digest nonce_max_duration 30 minutes
##auth_param digest nonce_max_count 50
##
##auth_param basic program <uncomment and complete this line>
##auth_param basic children 5 startup=5 idle=1
##auth_param basic realm Squid proxy-caching web server
##auth_param basic credentialsttl 2 hours
#acl password proxy_auth max moritz (oder REQUIRED für Alle)
#http_access allow password
Ergänze die Musterzeile um das Passwort-Hilfsprogramm basic_ncsa_auth und ein Passwordfile
|