Страница 1 из 1

Squid+squidGuard замучал.

Добавлено: 2006-07-25 12:49:31
sst78rus
Пытаюсь к squid прикрутить squidguard. Все ставил из портов (фря 6.1)
Сквид стоит как прозрачный прокси.
Конфиг: /usr/local/etc/squid/squid.conf

http_port 3128
icp_port 0

hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY

cache_mem 128 MB
maximum_object_size 8092 KB
maximum_object_size_in_memory 512 KB

cache_dir ufs /usr/local/squid/cache 2048 16 256
cache_access_log /usr/local/squid/logs/access.log
cache_log /usr/local/squid/logs/cache.log
cache_store_log /usr/local/squid/logs/store.log
cache_mgr root@bolshgate.bolsh.local

visible_hostname bolshgate.bolsh.local
tcp_outgoing_address 89.163.91.128

refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440

refresh_pattern . 0 20% 4320

redirect_program /usr/local/bin/squidGuard
redirect_children 10


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 SSL_ports port 443 563 # Ssl
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
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
acl users src 192.168.0.0/24

http_access allow manager localhost
http_access deny manager
http_access allow users
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all

httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

coredump_dir /usr/local/squid/cache
forwarded_for off

cachemgr_passwd none

client_db_on


Конфиг squidGuard лежит /usr/local/etc/squid/squidGuard.conf

dbhome /var/db/squidGuard
logdir /var/log

# SOURCE ADDRESSES
source all_my_net {
ip 192.168.0.3-192.168.0.10
}

dest ads {
domainlist ads/domains
urllist ads/urls
redirect 302:http://192.168.0.1/1x1.gif
}

acl {
all_my_net {
pass !ads any
}
default {
pass none
redirect http://192.168.0.1/cgi-bin/squidGuard.c ... lientname=
}
}


Т.е. должно пускать 192.168.0.3-192.168.0.10
Просто из шелла запускаю /usr/local/bin/squidGuard
Руками ввожу:
http://www.aport.ru/ 192.168.0.2/ - GET
Выдает редирект
http://www.aport.ru/ 192.168.0.3/ - GET
Ничего не выдает

Т.е. squidGuard видимо работает как надо. Перезапускаю сквид, пробую с машины 192.168.0.2 - все прекрасно работает. Чего за фигня?

Добавлено: 2006-07-25 21:41:09
sst78rus
Права доступа в юниксах, мой вечный косяк.
Выдержка из http://www.squidguard.org/faq/
squidGuard does not block?
There my be at least 2 reasons for this:

1. You didn't end your pass rules with "none". Pass rules ends with an implicit "all". It is good practice to allways en the pass rules with either "all" or "none" to make them clear. Ie. use:
pass good none
or
pass good !bad all
2. squidGuard goes into emergency mode. Reasons may be syntax errors in the config file, reference to non existing database files, filprotection problems or missing directories. Check the squidGuard log.
Note:When run under Squid, squidGuard is run with the same user and group ID as Squid (cache_effective_user and cache_effective_group in squid.conf). The squidGuard configuration and database files must be readable for this user and/or group and the squidGuard log directory must be writable for this user and/or group. If not squidGuard will go into the "pass all for all" emergency mode.


Собсвенно у меня пользователь сквидгарда не мог писать в логи и читать базу. А пробовал в шелле я от рута, поэтому естественно все работало.