• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

squid 2.6 - wie CONNECT / DIRECT verbieten bei URL rewriter?

Hallo Community,

vor ein paar Wochen habe ich auf meinen beiden Proxy Serven ein dist upgrade von woody auf sarge gemacht. Verbunden damit gab es auch ein Upgrade für squid von 2.5 auf 2.6 wo sich die Konfiguration vom accelerator mode ja grundlegend geändert hat. Soweit erstmal kein Problem. Hab elles umgestellt und läuft

erstmal alles wie immerAllerdings habe ich in den Protokollen seitdem folgende Meldungen

<snip>
1226548188.610 609 66.242.232.10 TCP_MISS/200 281 CONNECT 205.188.179.233:443 - DIRECT/205.188.179.233 -
1226548190.231 584 66.242.232.10 TCP_MISS/200 281 CONNECT login.icq.com:443 - DIRECT/205.188.179.233 -
1226548191.953 29684 81.200.2.39 TCP_MISS/200 49 CONNECT 64.12.200.89:443 - DIRECT/64.12.200.89 -
</snip>

So wie es aussieht versuchen welche unseren Proxy zu missbrauchen. Ich könnte zwar über die ACLs den Zugriff beschränken, da es aber ein transparenter Proxy und URL Rewriter ist und ich per se erstmal alle Zugriffe von Außen zulassen muss sind mir, so wie es scheint, die Hände gebunden.

Kurz zur Konfiguration. Der Proxy lauscht intern auf Port 3128 und zusammen mit iptables arbeitet er als transparenter Proxy. Von außen lauscht er auf Port 80 und über einen Redirector schreibt er die URLs um und leitet die Anfragen auf die internen Webserver um.
Hier die verfremdete aber inhaltlich korrekte Konfiguration (perl -ne 'if ($_ !~ m/^[#|\s]/) {print}' /etc/squid/squid.conf).

<snip>
http_port 1.2.3.4:80 transparent urlgroup=extern
http_port 5.6.7.8:3128 transparent urlgroup=intern
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
access_log /var/log/squid/access.log squid
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
useragent_log /var/log/squid/useragent.log
referer_log /var/log/squid/referer.log
hosts_file /etc/hosts
url_rewrite_program /etc/scripts/redirect
url_rewrite_children 20
url_rewrite_host_header off
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 127.0.0.0/8
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
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 Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access allow all
http_reply_access allow all
icp_access allow all
cache_mgr ich@firma.de
cache_effective_group proxy
coredump_dir /var/spool/squid
</snip>

Bisher habe ich die entsprechenden IPs immer über iptables geblockt, da es nur eine Hand voll in 2 Wochen waren. Ärgerlich ist es natürlich trotzdem. Hoffe Ihr könnt mir weiterhelfen wie ich die CONNECT / DIRECT Zugriffe von außen blockieren kann.

Danke und Gruß
Christian
 
Oben