LINUX.ORG.RU
ФорумAdmin

Проблема со Squid.


0

2

Помогите кто может.

Не могу понять почему squid не блокирует bad сайты. Пропускает все подряд,открывает любой сайт. Хотя в bad_url прописаны.

.youtube.ru .vk.com .vkontakte.ru

вот конфиг.

# ACCESS CONTROLS # —————————————————————————– # TAG: acl 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 563 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

# TAG: http_access http_access allow manager localhost http_access deny manager http_access deny CONNECT !SSL_ports

# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS acl our_networks src 192.168.1.0/24 acl full-access src 192.168.1.40-192.168.1.46 acl full-access src 192.168.1.119 acl bad_url url_regex «/etc/squid/acl/bad_url.domain» acl upload url_regex «/etc/squid/acl/upload.domain» acl filetypes urlpath_regex -i «/etc/squid/acl/filetypes.acl» acl banners url_regex «/etc/squid/acl/ads.acl»

http_access deny banners !full-access http_access deny filetypes !full-access http_access deny upload !full-access http_access deny bad_url !full-access http_access allow our_networks http_access allow full-access

# TAG: http_reply_access icp_access allow all

# NETWORK OPTIONS # —————————————————————————– # TAG: http_port http_port 192.168.1.100:3128

# TAG: hierarchy_stoplist hierarchy_stoplist cgi-bin ?

# DISK CACHE OPTIONS # —————————————————————————– # TAG: cache_replacement_policy cache_dir ufs /var/spool/squid 40000 16 256

# TAG: maximum_object_size (bytes) maximum_object_size 32 MB

# TAG: cache_swap_low (percent, 0-100) # TAG: cache_swap_high (percent, 0-100) cache_swap_low 90 cache_swap_high 95

# LOGFILE OPTIONS # —————————————————————————– # TAG: access_log access_log /var/log/squid/access.log squid

# OPTIONS FOR TUNING THE CACHE # —————————————————————————– # TAG: cache acl QUERY urlpath_regex cgi-bin \?

# TAG: refresh_pattern refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern . 0 20% 4320

# TAG: store_avg_object_size (kbytes) store_avg_object_size 70 MB

# HTTP OPTIONS # —————————————————————————– # TAG: broken_vary_encoding acl apache rep_header Server ^Apache cache deny QUERY broken_vary_encoding allow apache

acl bad_url url_regex «/etc/squid/acl/bad_url.domain»

Потому что надо читать маны и думать головой.

Во-первых, этими тремя выражениями ты нихера не закроешь, только сделаешь из себя посмешище перед теми, кому пытаешься это прикрыть, будут на перекурах обсуждать:«Наш админ криворукий дебил, пытался закрыть ВК и ютуб, а мы по другим доменным именам или напрямую по айпи ходим теперь и не паримся, youtu.be и userapi.com :D.».

ВК надо закрывать наглухо по их сетевым диапазонам при помощи acl dst

acl dst vk_dst 87.240.128.0/18 93.186.224.0/21 93.186.232.0/21 95.142.192.0/20

Диапазоны взяты здесь и здесь. IPv6 диапазон 2a00:bdc0::/36 — по ситуации.

Ютуб наглухо кроется по сочетанию acl dst с ip-диапазонами Google и youtube

http://bgp.he.net/search?search[search]=youtube&commit=Search
http://bgp.he.net/search?search[search]=google&commit=Search

и acl rep_mime_type с mime-типами ^video.*$ ^audio.*$ ^application/x-shockwave-flash$ ^application/octet-stream$ в http_reply_access

Если всё видео, то просто по rep_mime_type

$ grep url_regex /usr/share/doc/squid/examples/squid.conf
#       acl aclname url_regex [-i] ^http:// ...     # regex matching on whole URL
# acl buggy_server url_regex ^http://....

А то что ты написал, больше на urlpath_regex смахивает, и то неправильно, потому что точку как символ, а не regex-выражение в URL'е надо экранировать.

anonymous
()
Ответ на: комментарий от anonymous

Хороший, годный анонимус - всё правильно сказал. От себя добавлю - еще и анонимайзеры забанить следует - ну хотя бы самые популярные

Pinkbyte ★★★★★
()
Ответ на: комментарий от Pinkbyte

Спасибо, admin. Только опечатался я, не acl dst bl_vk, а, конечно, acl bl_vk dst.

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.