Dans guardian no és un plugin de Squid tot i que pot realitzar les mateixes tasques que el plugin d'Squid SquidGuard. És un servei que s'executa independentment d'Squid normalment al port 8080 (ull! amb aquest port, moltes aplicacions com p. ex. zenoss també l'utilitzen).
Durant la instal·lació us mostrarà un error:
$ sudo apt-get install dansguardian ... S'instal·laran els següents paquets extres: clamav clamav-base clamav-freshclam libclamav6 libtommath0 Paquets suggerits: clamav-docs squid libclamunrar6 S'instal·laran els paquets NOUS següents: clamav clamav-base clamav-freshclam dansguardian libclamav6 libtommath0 0 actualitzats, 6 nous a instal·lar, 0 a suprimir i 7 no actualitzats. Es necessita obtenir 25,8MB d'arxius. Després d'aquesta operació s'empraran 29,3MB d'espai en disc addicional. Voleu continuar [S/n]? s ... S'està configurant dansguardian (2.10.1.1-1) ... Warning: The home dir /var/log/dansguardian you specified already exists. Adding system user `dansguardian' (UID 112) ... Adding new group `dansguardian' (GID 120) ... Adding new user `dansguardian' (UID 112) with group `dansguardian' ... The home directory `/var/log/dansguardian' already exists. Not copying from `/etc/skel'. adduser: Warning: The home directory `/var/log/dansguardian' does not belong to the user you are currently creating. update-rc.d: warning: dansguardian start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (2 3 5) update-rc.d: warning: dansguardian stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (0 6) DansGuardian has not been configured! Please edit /etc/dansguardian/dansguardian.conf manually then rerun this script. S'estan processant els activadors per a libc-bin
NOTA: Si us fixeu dansguardian instal·la l'antivirus clamav
Cal configurar-lo:
$ sudo joe /etc/dansguardian/dansguardian.conf
I comenteu la línia:
UNCONFIGURED - Please remove this line after configuration
Posant davant de tot un coixinet:
#UNCONFIGURED - Please remove this line after configuration
Ara torneu a iniciar dansguardian:
$ sudo /etc/init.d/dansguardian reload * Reloading DansGuardian configuration...... Reloading DansGuardian configuration files. [fail] [ OK ]
$ sudo /etc/init.d/dansguardian * Usage: /etc/init.d/dansguardian {start|stop|restart|force-reload}
Dansguardian utilitza el port 8080 (http-proxy segons el fitxer /etc/services)
$ nmap localhost Starting Nmap 5.00 ( http://nmap.org ) at 2010-01-31 19:32 CET Warning: Hostname localhost resolves to 2 IPs. Using 127.0.0.1. Interesting ports on localhost (127.0.0.1): Not shown: 990 closed ports PORT STATE SERVICE 22/tcp open ssh ... 3128/tcp open squid-http .. 8080/tcp open http-proxy
Com tants altres fitxers de configuració el fitxer per defecte bé amb explicacions/indicacions en formes de comentari. Podeu utilitzar grep per eliminar aquests comentaris i quedar-nos només amb els les línies d'interès.
$ sudo mv /etc/dansguardian/dansguardian.conf /etc/dansguardian/dansguardian.conf.reference
$ cat /etc/dansguardian/dansguardian.conf | grep -v '^#\|^$\|^;' $ sudo -i # cat /etc/dansguardian/dansguardian.conf.reference | grep -v '^#\|^$\|^;' > /etc/dansguardian/dansguardian.conf
El fitxers sense comentaris
# exit $ cat /etc/dansguardian/dansguardian.conf reportinglevel = 3 languagedir = '/etc/dansguardian/languages' language = 'ukenglish' loglevel = 2 logexceptionhits = 2 logfileformat = 1 filterip = filterport = 8080 proxyip = 127.0.0.1 proxyport = 3128 accessdeniedaddress = 'http://YOURSERVER.YOURDOMAIN/cgi-bin/dansguardian.pl' nonstandarddelimiter = on usecustombannedimage = on custombannedimagefile = '/usr/share/dansguardian/transparent1x1.gif' filtergroups = 1 filtergroupslist = '/etc/dansguardian/lists/filtergroupslist' bannediplist = '/etc/dansguardian/lists/bannediplist' exceptioniplist = '/etc/dansguardian/lists/exceptioniplist' showweightedfound = on weightedphrasemode = 2 urlcachenumber = 1000 urlcacheage = 900 scancleancache = on phrasefiltermode = 2 preservecase = 0 hexdecodecontent = off forcequicksearch = off reverseaddresslookups = off reverseclientiplookups = off logclienthostnames = off createlistcachefiles = on maxuploadsize = -1 maxcontentfiltersize = 256 maxcontentramcachescansize = 2000 maxcontentfilecachescansize = 20000 filecachedir = '/tmp' deletedownloadedtempfiles = on initialtrickledelay = 20 trickledelay = 10 downloadmanager = '/etc/dansguardian/downloadmanagers/fancy.conf' downloadmanager = '/etc/dansguardian/downloadmanagers/default.conf' contentscannertimeout = 60 contentscanexceptions = off recheckreplacedurls = off forwardedfor = off usexforwardedfor = off logconnectionhandlingerrors = on logchildprocesshandling = off maxchildren = 120 minchildren = 8 minsparechildren = 4 preforkchildren = 6 maxsparechildren = 32 maxagechildren = 500 maxips = 0 ipcfilename = '/tmp/.dguardianipc' urlipcfilename = '/tmp/.dguardianurlipc' ipipcfilename = '/tmp/.dguardianipipc' nodaemon = off nologger = off logadblocks = off loguseragent = off softrestart = off mailer = '/usr/sbin/sendmail -t'
Normalment sense canviar res podeu utilitzar ja dansguardian apuntant els vostres navegadors al proxy amb el port 8080
Cal tenir en compte que si qui filtra pàgines és DansGuardian aleshores heu d'impedir l'accés directe a Squid. Ho podeu fer deixant la configuració per defecte d'squid acabat d'instal·lar (només accessible des de localhost) o bloquejant amb iptables.
Una llarga llista de extensions (.exe. zip. tar.gz, .iso):
$ cat /etc/dansguardian/lists/bannedextensionlist
Tipus MIME:
$ cat bannedmimetypelist # banned MIME types audio/mpeg audio/x-mpeg audio/x-pn-realaudio audio/x-wav video/mpeg video/x-mpeg2 video/acorn-replay video/quicktime video/x-msvideo video/msvideo application/gzip application/x-gzip application/zip application/compress application/x-compress application/java-vm
Al fitxer de configuració si activeu (per defecte):
# Show weighted phrases found # If enabled then the phrases found that made up the total which excedes # the naughtyness limit will be logged and, if the reporting level is # high enough, reported. on | off showweightedfound = on
Per entendreu-ho, si busqueu sex no us deixa pero si busqueu "sex problems" sí!
Proveu també amb:
sexo lícito sex guarro