PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Squid und Suidguard



hubrach
05.01.07, 11:59
Hallo,
wer kann mir helfen ?
Habe auf einem SLES 10 einen Proxy eingerichtet mit squid 2.5Stable12
darauf sollt ein squidguard 1.2.0 eingerichtet werden.
Beide laufen ohne Probleme

squidGuard.conf

logdir /syslog/squidGuard
dbhome /syslog/squidGuard/db
dest adv {
domainlist adv/domains
urllist adv/urls
}
dest porn {
domainlist porn/domains
urllist porn/urls
log pornaccesses
}
dest warez {
domainlist warez/domains
urllist warez/urls
}
acl {
default {
pass !in-addr !adv !porn !warez all
redirect http://localhost/block.html
}
}


in der squid.conf ist auch

redirect_program /usr/sbin/squidGuard -c /etc/squidguard.conf
redirect_children 5


eingetragen.

Teste ich den squidGard mit :


/usr/sbin/squidGuard -c /etc/squidguard.conf <"http://www.porno.de/index.html - - GET"


bekomme ich auch dir redireckt Site ausgegeben.

Nur wenn ich den Squid bemühe bekomme ich die nette Seite angezeigt ...

Im log erscheint vom Squidguard gar nichts ..

Wo hab ich etwas übersehen ?

cane
05.01.07, 13:18
Den Squid neugestartet?
Eventuell andere Direktiven in der squid.conf die dazu führen?

mfg
cane

hubrach
05.01.07, 14:15
klar mehrfcach neu gestartet :
hier meine squid.conf

http_port 192.xxx.yyy.xxxx:8080
ssl_unclean_shutdown off
hierarchy_stoplist cgi-bin ?
icp_port 0
htcp_port 0
cache_mem 128 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 4096 KB
minimum_object_size 0 KB
maximum_object_size_in_memory 8 KB
fqdncache_size 8192

cache_replacement_policy lru
memory_replacement_policy lru
cache_effective_user nobody
cache_effective_group nogroup

announce_period 0
cache_dir ufs /var/cache/squid 1000 32 256
cache_access_log /syslog/access.log
cache_log /syslog/cache.log
cache_store_log none
emulate_httpd_log off
useragent_log none
debug_options ALL,1
log_fqdn on


ftp_user xxx@yyy.com
ftp_list_width 32
ftp_passive off
ftp_sanitycheck off
dns_timeout 1 minute
dns_nameservers 192.xxx.xxx.xxx
buffered_logs on
logfile_rotate 10
forwarded_for off
log_icp_queries off
error_directory /etc/squid/errors
snmp_port 0
strip_query_terms off
ignore_unknown_nameservers on
visible_hostname Internet-Proxyserver
ipcache_size 2048
ipcache_low 90
ipcache_high 95

append_domain .xxx.de
pid_filename /var/run/squid.pid
quick_abort_min 0 KB
quick_abort_max 0 KB
request_header_max_size 100 KB
request_body_max_size 0 KB
refresh_pattern ftp: 1440 20% 10080
refresh_pattern gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320

connect_timeout 120 second
peer_connect_timeout 30 seconds
read_timeout 5 minute
request_timeout 5 minute
client_lifetime 1 day
shutdown_lifetime 15 second
redirect_program /usr/sbin/squidGuard -c /etc/squidguard.conf
redirect_children 5

acl all src 0.0.0.0/0.0.0.0 # Alle Anderen
acl lan src 192.168.20.0/255.255.255.0 # Lan Zugriff
acl no_cache_servers dstdomain .xxxx.de # Lokale Seiten nicht cachen
acl bad_user srcdom_regex -i "/etc/squid/user_deny" # User die nicht duerfen
acl bad_site url_regex "/etc/squid/side_deny" # Seiten bei SI nicht zugelassen
acl edv srcdom_regex -i "/etc/squid/allowed_edv" # Rechner der EDV
acl denydown urlpath_regex -i "/etc/squid/download_deny" # Das darf jeder nicht Downloaden
acl allowdown urlpath_regex -i "/etc/squid/download_allow_user" # Das darf jeder Downloaden
acl allowdown_edv urlpath_regex -i "/etc/squid/download_allow_edv" # Das darf die EDV Downloaden
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.1/32

acl messenger url_regex messenger.de.netscape
acl manager proto cache_object

acl SSL_ports port 443 563
acl Safe_ports port 80 21 443 563 70 210 1025-65535 280 488 591 777
acl CONNECT method CONNECT
no_cache deny no_cache_servers

header_access From deny all
header_access Referer deny all
header_access Server deny all
header_access WWW-Authenticate deny all
header_access Link deny all
header_replace From 192.192.192.192
http_access deny all bad_site
http_access allow lan

hubrach
08.01.07, 09:48
ok Fehler gefunden.
Es lag wohl an der Berkeley Datenbank version ..
von 4.3 auf 4.2 zurück und alles läuft ..

bert2002
08.01.07, 09:57
Hi,

hab so etwa ein ähnliches Problem.


home:/home/user# squidGuard -c /etc/squid/squidGuard.conf <"http://www.porno.de/index.html - - GET"
bash: http://www.porno.de/index.html - - GET: No such file or directory

irgendwie stimmt der Befehl nicht den du da preis gegeben hast ;)

hubrach
10.01.07, 07:54
Ausführlich .......
mach mal


export request="http://www.porno.de/index.html - - GET";
echo $request > test.pass;
echo $request > test.rewrite;
echo $request > test.block;
squidGuard -c /etc/squid/squidGuard.conf < test.pass > test.pass.out;
squidGuard -c /etc/squid/squidGuard.conf < test.rewrite > test.rewrite.out;
squidGuard -c /etc/squid/squidGuard.conf < test.block > test.block.out;
wc -l test.pass;
wc -l test.pass.out;
wc -w test.pass.out;


Die numerischen Ergebnisse für die ersten beiden Kommandos müssen gleich sein und 0 für das letzte.




wc -l test.rewrite;
wc -l test.rewrite.out;
diff test.rewrite test.rewrite.out | egrep -ic '^> ..* [0-9.]+/..* ..* [a-z]+$';
more test.rewrite.out;
wc -l test.block;
wc -l test.block.out;
diff test.block test.block.out | egrep -ic '^> ..* [0-9.]+/..* ..* [a-z]+$';
more test.block.out;

Gilt für block und rewrite.) Für die ersten 3 Tests müssen die Ergebnisse gleich sein. Das more-Kommando sollte eine komplette URL anzeigen. Falls die Adresse geblockt wurde, so steht sie in test.block.out.


Was passiert denn bei Dir ? Wird nichts geblockt ??

bert2002
10.01.07, 08:20
Hi,

nein bei mir wird nichts geblockt, es kommt aber noch dazu das ich ne basic Authentifizierung drin hab. Die Tests hatte ich auch schon einmal gefunden, aber konnte nit so wirklich was damit anfangen ;)


home:/home/user# export request="http://www.porno.de/index.html - - GET";
home:/home/user# echo $request > test.pass;
home:/home/user# echo $request > test.rewrite;
home:/home/user# echo $request > test.block;
home:/home/user# squidGuard -c /etc/squid/squidGuard.conf < test.pass > test.pass.out;
home:/home/user# squidGuard -c /etc/squid/squidGuard.conf < test.rewrite > test.rewrite.out;
home:/home/user# squidGuard -c /etc/squid/squidGuard.conf < test.block > test.block.out;
home:/home/user# wc -l test.pass;
1 test.pass
home:/home/user# wc -l test.pass.out;
1 test.pass.out
home:/home/user# wc -w test.pass.out;
4 test.pass.out
home:/home/user#


home:/home/user# wc -l test.rewrite;
1 test.rewrite
home:/home/user# wc -l test.rewrite.out;
1 test.rewrite.out
home:/home/user# diff test.rewrite test.rewrite.out | egrep -ic '^> ..* [0-9.]+/..* ..* [a-z]+$';
0
home:/home/user# more test.rewrite.out;
http://192.168.101.150/proxy/index.php&clientaddr=-&clientname=&clientident=&srcclass=default&targetclass=none&url=http://www.porno.de/index.html -/- - GET
home:/home/user# wc -l test.block;
1 test.block
home:/home/user# wc -l test.block.out;
1 test.block.out
home:/home/user# diff test.block test.block.out | egrep -ic '^> ..* [0-9.]+/..* ..* [a-z]+$';
0
home:/home/user# more test.block.out;
http://192.168.101.150/proxy/index.php&clientaddr=-&clientname=&clientident=&srcclass=default&targetclass=none&url=http://www.porno.de/index.html -/- - GET
home:/home/user#

und hier mal meine Config:


#
# CONFIG FILE FOR SQUIDGUARD
#

dbhome /var/lib/squidguard/db
logdir /var/log/squid

#
# SOURCE ADDRESSES:
#

src user02 {
user test03
ip 192.168.101.0/24
}

src user01 {
user test01 test02
}

#
# DESTINATION CLASSES:
#

dest paul {
domainlist paul/domains
expressionlist paul/expressions
log paul.log
redirect http://192.168.101.150/proxy/index.php&clientaddr=%a&clientname=%n&clientident=%i&srcclass=%s&targetclass=%t&url=%u
}


#
# ACLs
#



acl {
user01 {
pass any all
}

user02 {
pass !any !all paul
redirect http://192.168.101.150/proxy/index.php&clientaddr=%a&clientname=%n&clientident=%i&srcclass=%s&targetclass=%t&url=%u
}

default {
pass none
redirect http://192.168.101.150/proxy/index.php&clientaddr=%a&clientname=%n&clientident=%i&srcclass=%s&targetclass=%t&url=%u
}
}

log /var/log/squid/SquidGuard.log

2007-01-10 05:17:57 [21895] init domainlist /var/lib/squidguard/db/paul/domains
2007-01-10 05:17:57 [21895] loading dbfile /var/lib/squidguard/db/paul/domains.db
2007-01-10 05:17:57 [21895] init expressionlist /var/lib/squidguard/db/paul/expressions
2007-01-10 05:17:57 [21895] squidGuard 1.2.0 started (1168424277.842)
2007-01-10 05:17:57 [21895] squidGuard ready for requests (1168424277.843)
2007-01-10 05:17:57 [21895] squidGuard stopped (1168424277.843)
Ha, gerade gesehen. evtl liegts ja da dran, aber keine ahnug wieso, weil die prozesse eigentlich noch laufen:


home:/var/log/squid# ps aux | grep squid
root 21789 0.0 0.0 4628 668 ? Ss Jan09 0:00 /usr/sbin/squid -D -sYC
proxy 21791 0.0 0.5 7516 5208 ? S Jan09 0:00 (squid) -D -sYC
proxy 21793 0.0 0.1 2812 1176 ? Ss Jan09 0:00 (squidGuard) -c /etc/squid/squidGuard.conf
proxy 21794 0.0 0.1 2812 1176 ? Ss Jan09 0:00 (squidGuard) -c /etc/squid/squidGuard.conf
proxy 21795 0.0 0.1 2808 1124 ? Ss Jan09 0:00 (squidGuard) -c /etc/squid/squidGuard.conf
proxy 21796 0.0 0.1 2804 1124 ? Ss Jan09 0:00 (squidGuard) -c /etc/squid/squidGuard.conf
proxy 21797 0.0 0.1 2804 1124 ? Ss Jan09 0:00 (squidGuard) -c /etc/squid/squidGuard.conf
proxy 21798 0.0 0.0 2072 700 ? Ss Jan09 0:00 (ncsa_auth) /etc/squid/passwd
proxy 21799 0.0 0.0 1936 408 ? Ss Jan09 0:00 (ncsa_auth) /etc/squid/passwd
proxy 21800 0.0 0.0 1940 412 ? Ss Jan09 0:00 (ncsa_auth) /etc/squid/passwd
proxy 21801 0.0 0.0 1936 408 ? Ss Jan09 0:00 (ncsa_auth) /etc/squid/passwd
proxy 21802 0.0 0.0 1936 408 ? Ss Jan09 0:00 (ncsa_auth) /etc/squid/passwd
root 21920 0.0 0.0 2852 712 pts/0 S+ 05:28 0:00 grep squid

Ich versuch das teil jetzt schon seid nem Monat zum laufen zu bekommen....

hubrach
10.01.07, 08:29
Ich denke du benutzt auch SLES 10 oder ?
Schau mal nach welche Pakete du von Berkeley installiert hast.
Am besten mit yast ... installieren ... suchen berk ..
Dann müssen die db Verzeichnisse dem USer gehören, der als Default user im Squid eingerichtet ist .. ebenso die Log Verzeichnisse ...

hubrach
10.01.07, 08:32
user02 {
pass !any !all paul


vielleicht wäre das besser


user02 {
pass paul none



pass any all
ist auch irgendwie doppelt


also


pass all
wäre ok

bert2002
10.01.07, 08:52
Hi,
nein auf der Maschine läuft nen Debian "Sid".


home:/var/log/squid# aptitude search db4
i db4.2-util - Berkeley v4.2 Database Utilities
p db4.3-doc - Berkeley v4.3 Database Documentation [html]
p db4.3-util - Berkeley v4.3 Database Utilities
p db4.4-doc - Berkeley v4.4 Database Documentation [html]
p db4.4-util - Berkeley v4.4 Database Utilities
i libdb4.2 - Berkeley v4.2 Database Libraries [runtime]
p libdb4.2++-dev - Berkeley v4.2 Database Libraries for C++ [development]
p libdb4.2++c2 - Berkeley v4.2 Database Libraries for C++ [runtime]
p libdb4.2-dev - Berkeley v4.2 Database Libraries [development]
p libdb4.2-java - Berkeley v4.2 Database Libraries for Java
p libdb4.2-java-dev - Berkeley v4.2 Database Libraries for Java [development]
p libdb4.2-ruby1.8 - Interface to Berkeley DB for Ruby 1.8
p libdb4.2-ruby1.9 - Interface to Berkeley DB for Ruby 1.9
p libdb4.2-tcl - Berkeley v4.2 Database Libraries for TCL [module]
i libdb4.3 - Berkeley v4.3 Database Libraries [runtime]
p libdb4.3++-dev - Berkeley v4.3 Database Libraries for C++ [development]
p libdb4.3++c2 - Berkeley v4.3 Database Libraries for C++ [runtime]
p libdb4.3-dev - Berkeley v4.3 Database Libraries [development]
p libdb4.3-java - Berkeley v4.3 Database Libraries for Java
p libdb4.3-java-dev - Berkeley v4.3 Database Libraries for Java [development]
p libdb4.3-ruby1.8 - Interface to Berkeley DB for Ruby 1.8
p libdb4.3-ruby1.9 - Interface to Berkeley DB for Ruby 1.9
p libdb4.3-tcl - Berkeley v4.3 Database Libraries for TCL [module]
i libdb4.4 - Berkeley v4.4 Database Libraries [runtime]
p libdb4.4++ - Berkeley v4.4 Database Libraries for C++ [runtime]
p libdb4.4++-dev - Berkeley v4.4 Database Libraries for C++ [development]
p libdb4.4-dev - Berkeley v4.4 Database Libraries [development]
p libdb4.4-java - Berkeley v4.4 Database Libraries for Java
p libdb4.4-java-dev - Berkeley v4.4 Database Libraries for Java [development]
p libdb4.4-tcl - Berkeley v4.4 Database Libraries for TCL [module]
p libdspam7-drv-db4

Die Rechte der Ordner sind auch i.o. und die Zugänge hab ich auch verschoenert *schäm*. Ich weiß echt nicht woran das liegt...

hubrach
10.01.07, 09:09
mach mal bitte ein


ls -al /var/lib/squidguard/db
ls -al /var/log/squid
ls -al /var/lib/squidguard/db/paul

hubrach
10.01.07, 09:14
installiere bitte noch die libdb4.2++-dev


bitte mal ein


squidGuard -v

bert2002
10.01.07, 09:41
installiere bitte noch die libdb4.2++-dev


bitte mal ein


squidGuard -v


Habs nachinstalliert!


home:/var/log/squid# squidGuard -v
SquidGuard: 1.2.0 Sleepycat Software: Berkeley DB 4.3.29: (September 6, 2005)



home:/var/log/squid# ls -al /var/lib/squidguard/db
total 0
drwxrwxrwx 3 proxy proxy 72 2006-10-18 09:17 .
drwxr-xr-x 4 root root 104 2007-01-10 05:53 ..
drwxrwxrwx 2 proxy proxy 168 2007-01-09 05:45 paul
home:/var/log/squid# ls -al /var/log/squid
total 2347
drwxr-x--- 2 proxy proxy 624 2007-01-10 06:25 .
drwxr-xr-x 7 root root 2616 2007-01-10 06:25 ..
lrwxrwxrwx 1 root root 9 2007-01-09 05:28 access.log.1 -> squid.log
-rw-r----- 1 proxy proxy 5142 2006-11-20 05:39 access.log.2.gz
-rw-r----- 1 proxy proxy 445 2007-01-10 06:25 cache.log
-rw-r----- 1 proxy proxy 11105 2007-01-10 05:58 cache.log.1
-rw-r----- 1 proxy proxy 3315 2007-01-09 05:52 cache.log.2.gz
-rw------- 1 proxy proxy 3981312 2006-10-18 09:14 core
-rw-r----- 1 proxy proxy 2020 2007-01-10 06:25 squidGuard.log
-rw-r----- 1 proxy proxy 10764 2007-01-10 06:25 squidGuard.log.1
-rw-r----- 1 proxy proxy 1712 2007-01-09 06:25 squidGuard.log.2.gz
-rw-r----- 1 proxy proxy 0 2007-01-10 06:25 squid.log
-rw-r----- 1 proxy proxy 46180 2007-01-10 06:14 squid.log.1
-rw-r----- 1 proxy proxy 6691 2007-01-09 06:04 squid.log.2.gz
-rw-r----- 1 proxy proxy 0 2007-01-10 06:25 store.log
-rw-r----- 1 proxy proxy 54561 2007-01-10 06:14 store.log.1
-rw-r----- 1 proxy proxy 15739 2007-01-09 06:04 store.log.2.gz
-rw-r----- 1 proxy proxy 0 2007-01-10 06:25 paul.log
-rw-r----- 1 proxy proxy 0 2007-01-09 06:25 paul.log.1
-rw-r----- 1 proxy proxy 20 2007-01-08 06:25 paul.log.2.gz
home:/var/log/squid# ls -al /var/lib/squidguard/db/paul
total 40
drwxrwxrwx 2 proxy proxy 168 2007-01-09 05:45 .
drwxrwxrwx 3 proxy proxy 72 2006-10-18 09:17 ..
-rwxrwxrwx 1 proxy proxy 40 2006-10-18 09:18 domains
-rwxrwxrwx 1 proxy proxy 32768 2007-01-09 05:45 domains.db
-rwxrwxrwx 1 proxy proxy 4 2007-01-09 05:45 expressions
-rwxr-xr-x 1 proxy root 0 2007-01-09 05:45 expressions~
home:/var/log/squid#

hubrach
10.01.07, 09:52
Steht in Deiner squid.conf ein Default User eingetragen ?


cache_effective_user proxy
cache_effective_group proxy



home:/var/log/squid# ls -al /var/lib/squidguard/db/paul
total 40
drwxrwxrwx 2 proxy proxy 168 2007-01-09 05:45 .
drwxrwxrwx 3 proxy proxy 72 2006-10-18 09:17 ..
-rwxrwxrwx 1 proxy proxy 40 2006-10-18 09:18 domains
-rwxrwxrwx 1 proxy proxy 32768 2007-01-09 05:45 domains.db
-rwxrwxrwx 1 proxy proxy 4 2007-01-09 05:45 expressions
-rwxr-xr-x 1 proxy root 0 2007-01-09 05:45 expressions~


Vielleicht liegts ja auch daran ...
chown proxy : proxy expressions~

zudem hast Du die 4.3.29 von Berkley installiert dann bitte auch die db4.3-util

bert2002
10.01.07, 10:04
Steht in Deiner squid.conf ein Default User eingetragen ?


cache_effective_user proxy
cache_effective_group proxy

Nein stand nicht drin, aber hat auch nichts gebracht...




Vielleicht liegts ja auch daran ...
chown proxy : proxy expressions~

zudem hast Du die 4.3.29 von Berkley installiert dann bitte auch die db4.3-util

Nein, tut mir leid. Geht immer noch nicht :( So langsam bekomme ich nen ausraster.

EDIT: Achja mein Eintrag in der squid.conf



redirect_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf
redirect_children 5
redirector_bypass on
redirector_access deny localhost