4 069
contributi
Riga 238: | Riga 238: | ||
# su proxy | # su proxy | ||
# squidGuard -d -c /etc/squid3/squidGuard.conf -C all | # squidGuard -d -c /etc/squid3/squidGuard.conf -C all | ||
</pre> | |||
A questo punto possiamo crearci il nostro file di configurazione personalizzato per SquidGuard: | |||
<pre> | |||
# mv /etc/squid3/squidGuard.conf /etc/squid3/squidGuard.conf.original | |||
# touch /etc/squid3/squidGuard.conf | |||
# nano /etc/squid3/squidGuard.conf | |||
</pre> | |||
con contenuto: | |||
<pre> | |||
# | |||
# CONFIG FILE FOR SQUIDGUARD | |||
# | |||
dbhome /var/lib/squidguard/db/blacklists | |||
logdir /var/log/squid3 | |||
# | |||
# TIME RULES: | |||
# abbrev for weekdays: | |||
# s = sun, m = mon, t =tue, w = wed, h = thu, f = fri, a = sat | |||
# Definisco alcuni giorni speciali | |||
time SpecialsDays { | |||
date *.12.24 21:00 - 00:00 | |||
date *.12.25 00:00 - 05:00 | |||
date *.08.15 00:00 - 23:59 | |||
date *.01.01 00:00 - 23:59 | |||
} | |||
# Le ore lavorative | |||
time workhours { | |||
weekly mtwhf 08:30 - 19:00 | |||
} | |||
# IP dell'amministratore di rete | |||
src admin { | |||
ip 192.168.0.254 | |||
} | |||
src notadminbutbigboss { | |||
ip 172.30.0.253 | |||
} | |||
src workers { | |||
ip 172.30.0.0/216 | |||
} | |||
src all { | |||
ip 172.30.0.0/16 | |||
} | |||
dest adults { | |||
urllist adult/urls | |||
domainlist adult/domains | |||
expressionlist adult/very_restrictive_expression | |||
} | |||
dest drogues { | |||
urllist drugs/urls | |||
domainlist drugs/domains | |||
} | |||
est phishing { | |||
urllist phishing/urls | |||
domainlist phishing/domains | |||
} | |||
dest guns { | |||
urllist marketingware/urls | |||
domainlist marketingware/domains | |||
} | |||
dest danger { | |||
urllist dangerous_material/urls | |||
domainlist dangerous_material/domains | |||
} | |||
dest gambling { | |||
urllist gambling/urls | |||
domainlist gambling/domains | |||
} | |||
dest hacking { | |||
urllist hacking/urls | |||
domainlist hacking/domains | |||
} | |||
dest lingerie { | |||
urllist lingerie/urls | |||
domainlist lingerie/domains | |||
} | |||
dest malware { | |||
urllist malware/urls | |||
domainlist malware/domains | |||
} | |||
dest sexual_education { | |||
urllist sexual_education/urls | |||
domainlist sexual_education/domains | |||
} | |||
dest social_networks { | |||
urllist social_networks/urls | |||
domainlist social_networks/domains | |||
} | |||
dest warez { | |||
urllist warez/urls | |||
domainlist warez/domains | |||
} | |||
rewrite test { | |||
s@fuck@ooops@ir | |||
s@blonde@ooops@ir | |||
s@Hot@ooops@ir | |||
s@sex@ooops@ir | |||
s@porns@ooops@ir | |||
s@bikini@ooops@ir | |||
} | |||
acl { | |||
admin { | |||
pass any | |||
} | |||
notadminbutbigboss { | |||
pass any | |||
} | |||
workers within workhours { | |||
pass !adults !drogues !phishing !guns !hacking !danger !gambling !lingerie !malware !sexual_education !social_networks !warez any | |||
redirect http://127.0.0.1/cgi-bin/squidGuard.cgi?clientaddr=%a&clientname=%n&clientident=%i&srcclass=%s&targetclass=%t&url=%u | |||
#redirect http://172.30.0.254/stop.html | |||
} | |||
all { | |||
pass !adults !drogues !phishing !guns !hacking !danger !gambling !lingerie !malware !sexual_education !social_networks !warez any | |||
redirect http://127.0.0.1/cgi-bin/squidGuard.cgi?clientaddr=%a&clientname=%n&clientident=%i&srcclass=%s&targetclass=%t&url=%u | |||
#redirect http://172.30.0.254/stop.html | |||
} | |||
all within SpecialsDays { | |||
pass any | |||
redirect http://127.0.0.1/cgi-bin/squidGuard.cgi?clientaddr=%a&clientname=%n&clientident=%i&srcclass=%s&targetclass=%t&url=%u | |||
#redirect http://172.30.0.254/stop.html | |||
} | |||
default { | |||
pass none | |||
redirect http://127.0.0.1/cgi-bin/squidGuard.cgi?clientaddr=%a&clientname=%n&clientident=%i&srcclass=%s&targetclass=%t&url=%u | |||
#redirect http://172.30.0.254/stop.html | |||
} | |||
} | |||
</pre> | </pre> |