DansGuardian – filtrování obsahu – řešení pro síť [Ubuntu]

This article is deprecated.
Dansguardien is no more maitained.

Nastavení Dansguardianu aby nejen pro jednu stanici a pracovní plochu, ale i pro pro ostatní operační systémy (včetně Windows) vyžaduje přidání posledního řádku v firehol.conf jak je uvedeno výše server webcache accept.

Ostatní systémy musí mít správné nastavení proxy serveru v prohlížeči tak, aby odkazoval na IP adresu a port Dansguardianu 8080.

Ve Firefoxu:
Úpravy -> Předvolby -> Obecné -> Nastavení připojení -> Ruční nastavení proxy
(Zaškrtněte „Použít tento proxy server pro všechny protokoly“)

Tato nastavení mohou být uzamčené, (instrukce jsou k dispozici níže):

Upravte soubor /usr/lib/firefox/firefox.cfg:
sudo gedit /usr/lib/firefox/firefox.cfg

přidáním následujícího:

lockPref („network.proxy.http“, „127.0.0.1“);
lockPref („network.proxy.http_port“, 8080);
lockPref („network.proxy.type“, 1);
lockPref („network.proxy.no_proxies_on“, „localhost, 127.0.0.1“);

UPOZORNĚNÍ: Dansguardian systém, který dělá filtrování na vaší síti pomocí této konfigurace nelze připojit přímo na internetvelmi důležité!

 

Další rozšířená nastavení:

Zde jsou některé změny ve filtrech pro vyhledávání obrázků a také týkající se přístupu k zabezpečeným stránkám.


1. Upravte soubor /etc/DansGuardian/bannedregexpurllist odkomentováním řádků (odstranění #) – viz příklad:

#Block unfiltered options on various search engines
(^|[\?+=&/])(.*\.google\..*/.*\?.*safe=off)([\?+=&/]|$)
(^|[\?+=&/])(.*\.alltheweb.com/customize\?.*copt_offensive=off)([\?+=&/]|$)

#Block images on altavista, alltheweb, yahoo etc – as they are anonomised
(yahoo.com\/image\/)
(yimg.com\/image\/)
(altavista.com\/image\/)
(altavista.com\/video\/)

A / nebo upravte soubor /etc/DansGuardian/bannedphraselist

přidáním následujícího:

#—–
# Google
,,
# Yahoo
,
# Dogpile, Excite, Webcrawler
,
# AlltheWeb
,
#—–

Toto zastaví adult ofenzivní obrázky při vyhledávání ostatních obrázků.

2. Změňte předvolby pro Firefox, které zabraňují používání zabezpečených stránek aby bylo možné k nim přistupovat:

Pro Firefox:

Upravte soubor /usr/lib/firefox/firefox.cfg

sudo gedit /usr/lib/firefox/firefox.cfg

přidáním následujícího:

lockPref („network.proxy.http“, „127.0.0.1“);
lockPref („network.proxy.http_port“, 8080);
lockPref („network.proxy.type“, 1);
lockPref („network.proxy.no_proxies_on“, „localhost, 127.0.0.1“);

To uzamkne nastavení proxy ve Firefoxu pokud například pro přístup k nezabezpečeným proxy bránám jako je například  https://proxify.com

Vezměte prosím na vědomí, že soubor firefox.cfg bude přepsán při každém upgrade Firefoxu!

##################### MOŽNOSTI DALŠÍHO  NASTAVENÍ  #####################

Dalsi verze:
http://ubuntuforums.org/showpost.php?p=1222237&postcount=21

Mám TinyProxy / DansGuardian pracuje správně s Dapper. Dovolte mi, abych znovu sledovat kroky jsem se a dávám vám své konfiguraci. Mám zahrnuty konkrétní změny, které jsem dělal v konfiguračních souborech.

Nainstalujte DansGuardian, tinyproxy a firehol

Kód:

sudo apt-get install firehol DansGuardian tinyproxy

Editovat / etc / DansGuardian / dansguardian.conf …

Kód:

sudo nano-w / etc / DansGuardian / dansguardian.conf

a nechat všechno na výchozí. Budete prostě muset komentář mimo nezkonfigurované line

Kód:

Komentář # tento řádek se jednou, že jste upravili tento soubor, aby vyhovoval vašim potřebám
# Nezkonfigurované

Dále si budete muset upravit tinyproxy.conf

Kód:

sudo nano-w / etc / tinyproxy / tinyproxy.conf

a proveďte následující změny

Kód:

# #
# # Tinyproxy.conf – tinyproxy daemon konfigurační soubor
# #

#
# Jméno uživateli tinyproxy démon by měl přejít na po přístavu
# Byl vázán.
#
Uživatel nikdo
Skupina nogroup

#
# Port poslouchat na.
#
# Port 8888
Portu 3128

Nyní poslední soubor, který chcete upravit, je / etc / firehol / firehol.conf

Kód:

sudo nano-w / etc / firehol / firehol.conf

a tady je můj celý soubor firehol.conf

Kód:

#
# $ Id: klient-all.conf, v 1.2 2002/12/31 15:44:34 ktsaou Exp $
#
# Tento soubor bude možné všechny požadavky, které pocházejí z
# Místní počítač k odeslání prostřednictvím všech síťových rozhraních.
#
# No žádosti jsou vpuštěni ze sítě. Hostit je bude
# Úplně skrytého! Nebude reagovat na nic, a to bude
# Nebude pingable, i když bude moci vzniknout něco
# (I ping na ostatní počítače).
#

verze 5
iptables-t filter-I OUTPUT-d 127.0.0.1-p tcp – dport 3128-m majitel! – Uid-owner DansGuardian-j DROP
transparent_squid 8080 „nikdo root“

# Přijmout všechny klientské provoz na každém rozhraní
rozhraní jakékoliv svět
Politika pokles
Ochrana silný
klient, všichni souhlasí

Restartujte služby

Kód:

sudo / etc / init.d / restart DansGuardian
sudo / etc / init.d / restart tinyproxy
sudo / etc / init.d / firehol restart

Nyní byste měli mít funkční internet filtr bez jakýchkoli změn učiněných v nastavení proxy serveru.

Dalsi Nastaveni:

Další úpravy – možnosti konfigurace
DansGuardian je vysoce konfigurovatelný. Zdrojový kód je k dispozici, takže máte maximální konfigurovatelnost, i když většina lidí bude obsah s úpravou konfiguračních souborů. Pokud si upravit zdrojový kód zašlete prosím, co jste udělal Daniel.

Poté, co jste upravili jakékoliv konfigurační soubor, aby se změny, budete muset restartovat DansGuardian. Chcete-li to spustit skript sysv s možností restartu. Například pro typ RedHat následující v terminálu:

/ Etc / rc.d / init.d / restart DansGuardian

nebo na OpenBSD:

/ Usr / local / etc / rc.d / dansguardian.sh restart

Případně spustit DansGuardian-q následované DansGuardian.

Je tam jeden hlavní konfigurační soubor, několik zakázaných seznamů a seznam výjimek. To vše jsou vysvětleny níže:
exceptionsitelist
Tato obsahuje seznam doménových koncovek, že pokud najdete v požadované URL, bude DansGuardian není filtrovat stránky. Všimněte si, že byste neměli dát httpd: / / nebo www. na začátku položky.
exceptioniplist
Tato obsahuje seznam IP adres klientů, kteří si chtějí obejít filtrování. Například, správce sítě IP počítače.
exceptionuserlist

Uživatelská jména, která nebude filtrován (základní autentizace nebo ident musí být povolen).
bannedphraselist
Tato obsahuje seznam zakázaných frází. Fráze musí být uzavřen mezi. DansGuardian je dodáván s příkladem seznam. Nemůžete používat fráze jako jak to bude blokovat weby jako Middlesex University. Fráze může obsahovat mezery. Použít je ve svůj prospěch. To je nejužitečnější část DansGuardian a chytit více stránek než PICS a filtrování URL adres dohromady.

Kombinace frází může také být používán, které pokud jsou všechny nalezené na stránce, je zablokováno.
bannedmimetypelist
Tato obsahuje seznam zakázaných typů MIME-. Je-li adresa URL žádost vrátí MIME-typu, který je v tomto seznamu, bude DansGuardian blokovat. DansGuardian přijde s nějakým příkladem typy MIME-popírat. To je dobrý způsob, jak blokovat nevhodný filmů pro příklad. To je samozřejmě nerozumné zákaz MIME-typy text / html nebo image / *.
bannedextensionlist
Tato obsahuje seznam zakázaných přípon souborů. Pokud adresa URL končí v prodloužení, která je v tomto seznamu, bude DansGuardian blokovat. DansGuardian přichází s některými rozšířeními například soubor, který chcete zakázat. To je dobrý způsob, jak blokovat kiddies stahování těch krásných spořičů obrazovky a hackerské nástroje. Jste blázen, pokud zákaz příponu souboru. Html, nebo. Jpg apod.
bannedregexpurllist

Tato obsahuje seznam zakázaných adres URL regulární výrazy. Pro více informací o regulárních výrazech, klikněte zde.
bannedsitelist

Tento soubor obsahuje seznam zakázaných stránek. Zadání doménového jména zde zákazy celý web. Pro zákaz určité části webu, viz bannedurllist. Také můžete mít obecný zákaz všech stránkách kromě těch, které výslovně vyloučena v exceptionsitelist. Můžete také blokovat místa určená pouze IP adresu, a zahrnovat akcie SquidGuard blacklisty kolekci. Aby tyto černých listin, je stáhnout z komparsistů sekci zde. Jednoduše řečeno je někde vhodné, un-comment SquidGuard blacklisty kolekce řádky v dolní části bannedsitelist souboru a zkontrolujte cesty jsou správné. Pro URL černých listin, upravte bannedurllist podobným způsobem.
bannedurllist

To vám umožní zablokovat konkrétní části webu, nikoli celého webu. Chcete-li blokovat celý web, viz bannedsitelist. Chcete-li povolit SquidGuard černých listin pro URL, budete si muset stáhnout a upravit blacklistů SquidGuard blacklisty sběru v dolní části (jak pro bannedsitelist výše).
fotky
Tento soubor umožňuje jemně vyladit PICS filtrování. Každá sekce PICS přichází s popisem povolené nastavení a to, co představují. Výchozí nastavení se DansGuardian jsou stanoveny pro pomladší děti, pro rouhavostma např. mírné a umělecké nahota jsou povoleny.

Pro podrobnější informace o hodnocení PICS, klikněte zde.
ICRA

Část ICRA je docela samo-vysvětlující. Hodnota 0 znamená, nic z této kategorie je dovoleno, zatímco hodnota 1 umožňuje. Například,

ICRAnudityartistic = 1

umožňuje nahý umění. Pro více in-hloubka informace naleznete zde.
RSAC

RSAC je starší verze ICRA. Hodnoty zde pohybuje od 0 znamená žádný nemá, přes 2 (výchozí hodnota), až 4, což umožňuje svévolné a bezdůvodné částky dané kategorie. Pro více in-hloubka informace naleznete zde.
evaluWEB

evaluWEB hodnocení používá systém podobný britský systém klasifikace filmu:

0 = U (Universal, tzn. Vhodný i pro nejmenší divák)

1 = PG (rodičovské doporučeno orientační)

2 = 18 (vhodné pouze pro diváky ve věku 18 let a více)
SafeSurf

Podobně jako u RSAC, ale obsahují větší rozsah kategorií s rozsahem od 0 = úplné filtrování 9 = chlípné a bezdůvodné. Pro více in-hloubka informace naleznete zde.

Weburbia

Viz evaluWEB. Pro více in-hloubka informace naleznete zde.

Webové stránky Vancouver

Toto je další hodnocení systému. Viz zde pro více informací.

dansguardian.conf

Jediné nastavení, které je nezbytné pro konfiguraci v souboru dansguardian.conf je accessdeniedaddress nastavení. Měli byste nastavit na adresu (ne cestu k souboru) vašeho serveru Apache s perl odepření přístupu zpráv skript. Pro většinu lidí to bude stejný server jako chobotnice a DansGuardian. Pokud opravdu chcete, můžete změnit adresu pro normální html statické stránky na každém serveru.
Úroveň hlášení
Můžete změnit úrovně hlášení, kdy dostane popíral stránku. To může říct jen ‚Přístup odepřen‘, nebo proč zpráva, nebo zprávu, proč a co popřel fráze. Tyto požadavky mohou být užitečné pro testování, ale middler by být užitečné ve školním prostředí. Stealth režimu záznamy co by popíral, ale nedělá žádné blokování.
Nastavení logování
Toto nastavení umožňuje konfigurovat úroveň protokolování. Můžete se přihlásit nic, jen zakázané stránky, textový a všechny požadavky. HTTPS požadavky jen získat, když je přihlášen přihlášení nastaven na 3 – všechny požadavky.
Nastavení sítě
Tyto umožňují měnit IP adresu, která naslouchá na DansGuardian, port DansGuardian naslouchá, běh IP adresu serveru, chobotnice, stejně jako chobotnice port. Je možné nakonfigurovat Přístup byl odepřen zpravodajské stránky i zde.
Filtrování obsahu Nastavení
Zde můžete změnit umístění seznamu souborů. Úprava těchto místech nedoporučuje.
Obrácené vyhledávání na zakázané stránky a adresy URL
Pokud je zapnuta, bude DansGuardian podívat se dopředu DNS adresy URL IP a hledat jak v zakázaných stránek a seznamů adres URL. Tím by se zabránilo uživateli jednoduše zadáním IP adresy zakázané. Sníží rychlost vyhledání poněkud takže pokud máte lokální cache DNS server, nechte ho a použijte deka IP bloku možnost v bannedsitelist souboru místo.
Budovat bannedsitelist a bannedurllist Cache souborů
To bude porovnávat datum razítka seznamu souboru s datem razítka cache a bude znovu podle potřeby. Pokud BSL nebo bul. Zpracovaný soubor existuje, pak to bude používán místo toho. Zvýší proces začít rychlost o 300%. Na pomalých počítačích to bude významný. Rychlé počítače nemusí tuto možnost.
POST ochrany (odeslání na web a formy)
To je pro blokování či omezování obrázky, ne pro blokování formy bez nahrání souboru. Hodnota je uvedena v kilobajtech po kódování MIME a informace v hlavičce.
Uživatelské jméno identifikačních metod (používaných při těžbě dřeva)
Proxyauth možností je, když je základní proxy autentizaci používá (samozřejmě není dobré pro transparentní proxy). NTLM možností je, když proxy podporuje MS NTLM. Toto funguje pouze s IE5.5 SP1 a vyšší, a nebyla dosud provedena. Ident způsobí DansGuardian k pokusu o připojení k identd server na počítači, pocházející žádosti.
Předáno Pro
Tato volba přidá X-Forwarded-For: o požadavku HTTP hlavičky. To může pomoci vyřešit nějaký problém stránky, které potřebujete znát zdrojovou IP.
Max děti

Tím se nastaví maximální počet procesů, aby se třeli zvládnout příchozí spojení. Tím se zabrání útokům DoS zabíjení server s příliš mnoha zplodila procesů. Na velké stránkách budete chtít zdvojnásobit či ztrojnásobit toto číslo.
Chyby protokolu Připojení Manipulace

Tato možnost zaznamenává některé ladicí informace o fork () a ing. accept () ing, která může být obvykle ignorována. Ty jsou přihlášeni do syslog. Je bezpečné ponechat
toto nastavení zapnout nebo vypnout.

Squid konfigurace
Tam je žádný, který je vyžadován jako DansGuardian jeví chobotnici stejně jako běžný webový prohlížeč. Nicméně …

Musíme se ujistit, že chobotnice nedovolí klientských prohlížečů obejít DansGuardian. Jedná se o netriviální problém. Co budu předpokládat, že jste již zablokoval otevřený přístup na web (přes firewall tabulky IP a IP řetězce) a jediný způsob, jak přistupovat k internetu je přes chobotnice, a tudíž DansGuardian. Tento cíl je dosažitelný v několika způsoby.
squid.conf metoda

Můžete upravit acl pravidla tak, aby pouze localhost má přístup. V mém squid.conf jsem měl následující řádky:

# Vložit vlastní pravidla (S) ZDE umožnit přístup od vašich klientů
#
acl LocalNet src 192.168.42.0/255.255.255.0
http_access umožňují LocalNet
http_access povolit localhost
http_access popřít všechny

Tak jsem remmed z obou localnet řádky s #. Věřím, že výchozí konfigurace chobotnice je jen localhost povolen, takže si asi ani nemusíte to udělat.

S proxy autentizaci se věci trochu složitější. S žádným DansGuardian v mém squid.conf jsem:

authenticate_program / usr / bin / smb_auth-W DOMÉNY-U 192.168.0.2
acl domainusers proxy_auth POŽADOVANÉ
http_access umožňují domainusers
http_access popřít všechny

, Který umožňuje ověřeným uživatelům přístup k proxy odkudkoli.

Nicméně, to má smysl nechat přes SSL, aniž by prostřednictvím DansGuardian, ale zároveň stále brání obcházení DansGuardian na jiných portech. Takže stejné sekci se stalo:

authenticate_program / usr / bin / smb_auth-W DOMÉNY-U 192.168.0.2
acl domainusers proxy_auth POŽADOVANÉ
acl linuxserver src 192.168.0.1/255.255.255.255
acl ntserver src 192.168.0.2/255.255.255.255
http_access umožňují linuxserver
http_access umožňují ntserver
http_access umožňují domainusers localhost
http_access umožňují CONNECT SSL_ports
http_access popřít všechny

Takže pro všechny webové přístup (SSL nebo ne), je uživatel musí být ověřena, ale SSL je povoleno, aby se vyhnula DansGuardian. Také jsem umožňují NT a Linux serverů obejít filtrování a přístup chobotnice přímo.
ipchains metoda 1
Dalo by se přesměrovat příchozí požadavky na port 3128 z lokální sítě na portu 8080, přičemž stále přicházející z localhost přistupovat 3128. Konkrétnější detail je v současné době nad rámec tohoto návodu.
ipchains metoda 2 – záludný způsob
Opravdu záludný způsob by byl pro konfiguraci chobotnici pracovat jako transparentní proxy a přesměrovat všechny port 80 provoz na portu 8080. Byste chtěli zahrnout metody 1 stejně. Konkrétnější detail je v současné době nad rámec tohoto návodu. Existují návody, které pokrývají tuto.

Konfigurace klienta
Jednoduché config

Předpokládejme, že máte Linux server na IP 192.168.0.1, což je caching proxy a intranetových web server. Na tomto serveru máte nainstalovaný DansGuardian naslouchat na portu 8080.

Je nutné nakonfigurovat klienta prohlížeč pro http proxy 192.168.0.1 s portem 8080. Můžete si nastavit FTP stejný jako http – to je hlášena k práci. To je všechno. Ale pro efektivitu budete chtít nastavit ‚žádný proxy na‘ na váš lokální adresu serveru Apache – v tomto případě 192.168.0.1. Pokud máte DNS pracuje, můžete použít adresu DNS lokálního serveru. I nemají tendenci.

Záludný Config
Pokud jste použili záludný způsob nastavit chobotnice pak by měl být bez nutnosti konfigurace. Sestavte si svůj prohlížeč bez proxy a možná nastavení ‚žádný proxy na‘ na váš lokální adresu serveru Apache – v tomto případě 192.168.0.1.

Beebug (Daniel) Config
To by mohlo být známé jako super záludný myslím. Problém s jednoduchou metodu config je, že musíte nastavit ručně každém prohlížeči. To je bolest, a proto je záludný způsob je opravdu velmi dobrá.
Způsob, jakým Beebug vyřešit tento je pomocí vlastní in-house Visual Basic aplikace, která načte při přihlášení a upravuje potřebné registru systému Windows a různé soubory tak, že IE a Netscape (včetně e-mailu) jsou nastaveny automaticky. Je to tak dobré, stačí držet kopii Netscape na serveru v podílu a spustit tento program při přihlášení, a to automaticky prostě funguje na všech počítačích. Žádná instalace a ústřední kopii, takže je snadno aktualizovat.
Má také další funkce, jako je odstranění nežádoucích kousků, jako jsou webové složky, GMT / BST automatické přepínání (již provádí přihlašovací skript), app data, a další opravy.
Pokud jsem přesvědčit ředitele, aby její uvolnění open source není možné použít tuto metodu bez placení, nebo psát své vlastní. A hádejte, kdo psal tento – ano – autor DansGuardian!

Podpora
Pro všechny technické podpory, vstoupit do mailing listu a post svůj dotaz nebo připomínku tam.

Pokud máte pocit, vaše zpráva není vhodný pro veřejné prohlížení a soukromého sektoru (např. žádat o stanovení cen nebo jiných obchodních otázek), pak napište mi přímo. Moje adresa je Daniel na jadeb dot com.

Můžete také získat další pomoc z webových stránek DansGuardian dansguardian.org.

Jakékoliv komentáře k tomuto dokumentu, e-mail gb na DansGuardian dot org.

Zdroje:
http://ubuntuforums.org/showthread.php?t=207008

http://dansguardian.org/downloads/detailedinstallation2.html # další
Postupy: Instalace DansGuardian na jeden desktop a na síť
DansGuardian dělá vynikající práci při filtrování webového obsahu na ochranu před odpadky na internetu. Toto howto je syntézou informace získané z:
http://www.pilpi.net/journal/item-985.php

 

I have edited this to include the use of these instructions for not only a single desktop but also for other systems (including Windows boxes) to point to such a configured box on a network and be filtered. This requires the addition of the last line in firehol.conf as above „server webcache accept“.

The other systems must have their proxy settings set in the browser to point to the ip address of the dansguardian system and port 8080.

In Firefox:
Edit -> Preferences -> General -> Connection Settings -> Manual proxy configuration

Check manual proxy configuration and add “your DG box ip address” in first box and “8080” in second
Then tick “Use this proxy server for all protocols”

These settings can be locked, instructions are available below to do this:

Modify the file sudo gedit /usr/lib/firefox/firefox.cfg

by adding the following:

lockPref(„network.proxy.http“, „127.0.0.1“);
lockPref(„network.proxy.http_port“, 8080);
lockPref(„network.proxy.type“, 1);
lockPref(„network.proxy.no_proxies_on“, „localhost, 127.0.0.1“);

PLEASE NOTE: The dansguardian system that is doing the filtering on your network using this configuration CANNOT be connected directly to the internet – very important!!
Last edited by tonhou; March 4th, 2007 at 03:20 AM.
—-
Re: HOWTO: Install Dansguardian on a single desktop
Glad that it is working!

Here are some changes that I have made to filters etc. for searching images and also for stopping access to secure proxy sites.

1. Modify the file /etc/dansguardian/bannedregexpurllist

by uncommenting (remove #) so that it looks as it is below:

#Block unfiltered options on various search engines
(^|[\?+=&/])(.*\.google\..*/.*\?.*safe=off)([\?+=&/]|$)
(^|[\?+=&/])(.*\.alltheweb.com/customize\?.*copt_offensive=off)([\?+=&/]|$)

#Block images on altavista, alltheweb, yahoo etc – as they are anonomised
(yahoo.com\/image\/)
(yimg.com\/image\/)
(altavista.com\/image\/)
(altavista.com\/video\/)

AND/OR modify the file /etc/dansguardian/bannedphraselist

by adding the following:

#—–
# Google
,,
# Yahoo
,
# Dogpile, Excite, Webcrawler
,
# AlltheWeb
,
#—–

These stop adult/offensive images if safe search is turned off for an image search engine.

2. Change firefox preferences to stop use of secure proxy sites to gain access to blocked sites:

For Firefox:

Modify the file sudo gedit /usr/lib/firefox/firefox.cfg

by adding the following:

lockPref(„network.proxy.http“, „127.0.0.1“);
lockPref(„network.proxy.http_port“, 8080);
lockPref(„network.proxy.type“, 1);
lockPref(„network.proxy.no_proxies_on“, „localhost, 127.0.0.1“);

This will lock the proxy settings in firefox preferences if it is considered necessary to block access to secure proxy sites such as :
https://proxify.com
(these provide an unfiltered gateway out!)

Please note that the firefox.cfg file is overwritten each time there is a firefox update!!
–Tony
Last edited by tonhou; September 22nd, 2006 at 10:27 PM.


Další verze:
http://ubuntuforums.org/showpost.php?p=1222237&postcount=21

I have TinyProxy/DansGuardian working correctly with Dapper. Let me back track the steps I took and give you my configuration. I have included the specific changes I made in the config files.

Install dansguardian, tinyproxy, and firehol

Code:

sudo apt-get install dansguardian tinyproxy firehol

Edit /etc/dansguardian/dansguardian.conf…

Code:

sudo nano -w /etc/dansguardian/dansguardian.conf

and leave everything at default. You will just need to comment out the UNCONFIGURED line

Code:

# Comment this line out once you have modified this file to suit your needs
#UNCONFIGURED

Next, you will need to edit the tinyproxy.conf

Code:

sudo nano -w /etc/tinyproxy/tinyproxy.conf

and make the following changes

Code:

##
## tinyproxy.conf — tinyproxy daemon configuration file
##

#
# Name of the user the tinyproxy daemon should switch to after the port
# has been bound.
#
User nobody
Group nogroup

#
# Port to listen on.
#
#Port 8888
Port 3128

Now the last file to be edited is /etc/firehol/firehol.conf

Code:

sudo nano -w /etc/firehol/firehol.conf

and here is my entire firehol.conf file

Code:

#
# $Id: client-all.conf,v 1.2 2002/12/31 15:44:34 ktsaou Exp $
#
# This configuration file will allow all requests originating from the
# local machine to be send through all network interfaces.
#
# No requests are allowed to come from the network. The host will be
# completely stealthed! It will not respond to anything, and it will
# not be pingable, although it will be able to originate anything
# (even pings to other hosts).
#

version 5
iptables -t filter -I OUTPUT -d 127.0.0.1 -p tcp –dport 3128 -m owner ! –uid-owner dansguardian -j DROP
transparent_squid 8080 „nobody root“

# Accept all client traffic on any interface
interface any world
policy drop
protection strong
client all accept

Then restart the services

Code:

sudo /etc/init.d/dansguardian restart
sudo /etc/init.d/tinyproxy restart
sudo /etc/init.d/firehol restart

You should now have a working internet filter without any changes being made to the proxy settings.

Další nastavení:

Further customisation – configuration options
DansGuardian is highly configurable. The source code is provided so you have the ultimate in configurability, although most people will be content with modifying the configuration files. If you do modify the source code please send what you’ve done to Daniel.

After you have modified any configuration file, to apply the changes you will need to restart DansGuardian. To do this run the sysv script with the restart option.  For example, for RedHat type the following in a terminal:

/etc/rc.d/init.d/dansguardian restart

or for OpenBSD:

/usr/local/etc/rc.d/dansguardian.sh restart

Alternatively, run a dansguardian -q followed by a dansguardian.

There is one main configuration file, several banned lists and an exception list. These are all explained below:
exceptionsitelist
This contains a list of domain endings that if found in the requested URL, DansGuardian will not filter the page. Note that you should not put the httpd:// or the www. at the beginning of the entries.
exceptioniplist
This contains a list of client IPs who you want to bypass the filtering. For example, the network administrator’s computer’s IP.
exceptionuserlist

Usernames who will not be filtered (basic authentication or ident must be enabled).
bannedphraselist
This contains a list of banned phrases. The phrases must be enclosed between . DansGuardian is supplied with an example list. You can not use phrases such as as this will block sites such as Middlesex University. The phrases can contain spaces. Use them to your advantage. This is the most useful part of DansGuardian and will catch more pages than PICS and URL filtering put together.

Combinations of phrases can also be used, which if they are all found in a page, it is blocked.
bannedmimetypelist
This contains a list of banned MIME-types. If a URL request returns a MIME-type that is in this list, DansGuardian will block it. DansGuardian comes with some example MIME-types to deny. This is a good way of blocking inappropriate movies for example. It is obviously unwise to ban the MIME-types text/html or image/*.
bannedextensionlist
This contains a list of banned file extensions. If a URL ends in an extension that is in this list, DansGuardian will block it. DansGuardian comes with some example file extensions to deny. This is a good way of blocking kiddies from downloading those lovely screen savers and hacking tools. You are a fool if you ban the file extension .html, or .jpg etc.
bannedregexpurllist

This contains a list of banned regular expression URLs.  For more information on regular expressions, click here.
bannedsitelist

This file contains a list of banned sites.  Entering a domain name here bans the entire site.  For banning specific parts of a site, see bannedurllist. Also, you can have a blanket ban all sites except those specifically excluded in exceptionsitelist. You can also block sites specified only as an IP address, and include a stock squidGuard blacklists collection. To enable these blacklists, download them from the extras section here. Simply put them somewhere appropriate, un-comment the squidGuard blacklists collection lines at the bottom of the bannedsitelist file, and check the paths are correct. For URL blacklists, edit the bannedurllist in a similar way.
bannedurllist

This allows you to block specific parts of a site rather than the whole site.  To block an entire site, see bannedsitelist. To enable squidGuard blacklists for URLs, you will need to download the blacklists and edit the squidGuard blacklists collection section at the bottom (as for bannedsitelist above).
pics
This file allows you to finely tune the PICS filtering. Each PICS section comes with a description of the allowed settings and what they represent. The default settings with DansGuardian are set for youngish children, for example mild profanities and artistic nudity are allowed.

For more detailed information on PICS ratings, click here.
ICRA

The ICRA section is fairly self-explanatory.  A value of 0 means nothing of that category is allowed, whereas a value of 1 allows it. For example,

ICRAnudityartistic = 1

allows nude art. For more in-depth information see here.
RSAC

RSAC is an older version of ICRA. The values here range from 0 meaning none allowed, through 2 (the default value), to 4, which allows wanton and gratuitous amounts of the given category. For more in-depth information see here.
evaluWEB

evaluWEB rating uses a system similar to the British Film classification system:

0 = U (Universal, ie. suitable for even the youngest viewer)

1 = PG (Parental Guidance recommended)

2 = 18 (Only suitable for viewers aged 18 and over)
SafeSurf

Similar to RSAC, but containing a larger range of categories with the range from 0 = full filtering to 9 = wanton and gratuitous. For more in-depth information, see here.

Weburbia

See evaluWEB. For more in-depth information, see here.

Vancouver Webpages

This is yet another ratings scheme.  See here for more information.

dansguardian.conf

The only setting that is vital for you to configure in the dansguardian.conf file is the accessdeniedaddress setting. You should set this to the address (not the file path) of your Apache server with the perl access denied reporting script. For most people this will be the same server as squid and DansGuardian. If you really want you can change this address to a normal html static page on any server.
Reporting Level
You can change the reporting level for when a page gets denied. It can say just ‚Access Denied‘, or report why, or report why and what the denied phrase is. The latter may be more useful for testing, but the middler would be more useful in a school environment. Stealth mode logs what would be denied but doesn’t do any blocking.
Logging Settings
This setting lets you configure the logging level. You can log nothing, just denied pages, text based and all requests. HTTPS requests only get logged when the logging is set to 3 – all requests.
Network Settings
These allow you to modify the IP address that DansGuardian is listening on, the port DansGuardian listens on, the IP address of the server running squid as well as the squid port. It is possible to configure the Access Denied reporting page here also.
Content Filtering Settings
Here you can modify the location of the list files. Adjusting these locations is not recommended.
Reverse Lookups for Banned Sites and URLs
If set to on, DansGuardian will look up the forward DNS for an IP URL address and search for both in the banned site and URL lists. This would prevent a user from simply entering the IP for a banned address. It will reduce searching speed somewhat so unless you have a local caching DNS server, leave it off and use the Blanket IP Block option in the bannedsitelist file instead.
Build bannedsitelist and bannedurllist Cache Files
This will compare the date stamp of the list file with the date stamp of the cache file and will recreate as needed. If a bsl or bul .processed file exists, then that will be used instead. It will increase process start speed by 300%. On slow computers this will be significant. Fast computers do not need this option.
POST protection (web upload and forms)
This is for blocking or limiting uploads, not for blocking forms without any file upload. The value is given in kilobytes after MIME encoding and header information.
Username identification methods (used in logging)
The proxyauth option is for when basic proxy authentication is used (obviously no good for transparent proxying). The ntlm option is for when the proxy supports the MS NTLM authentication.  This only works with IE5.5 sp1 and later, and has not been implemented yet. The ident option causes DansGuardian to try to connect to an identd server on the computer originating the request.
Forwarded For
This option adds an X-Forwarded-For: to the HTTP request header. This may help solve some problem sites that need to know the source IP.
Max Children

This sets the maximum number of processes to spawn to handle the incoming connections. This will prevent DoS attacks killing the server with too many spawned processes. On large sites you might want to double or triple this number.
Log Connection Handling Errors

This option logs some debug info regarding fork()ing and accept()ing which can usually be ignored. These are logged by syslog. It is safe to leave
this setting on or off.

Squid configuration
There is none that is required as DansGuardian appears to squid just as a normal web browser. However…

We need to make sure that squid will not allow client browsers to bypass DansGuardian. This is a non trivial problem. What I will assume is that you have already blocked open web access (via firewall IP tables and IP chains) and the only way to access the web is through squid and hence DansGuardian. This goal is achievable in a number of ways.
squid.conf method

You can modify the acl rules so that only localhost has access. In my squid.conf I had the following lines:

# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#
acl localnet src 192.168.42.0/255.255.255.0
http_access allow localnet
http_access allow localhost
http_access deny all

So I remmed out both the localnet lines with a #. I believe that the default configuration of squid is to only have localhost allowed so you probably don’t even have to do this.

With proxy authentication things get a little bit more complex. With no DansGuardian in my squid.conf I have:

authenticate_program /usr/bin/smb_auth -W DOMAIN -U 192.168.0.2
acl domainusers proxy_auth REQUIRED
http_access allow domainusers
http_access deny all

Which allows authenticated users to access the proxy from anywhere.

However, it makes sense to let SSL through without going through DansGuardian, yet at the same time still prevent bypassing DansGuardian on other ports. So the same section became:

authenticate_program /usr/bin/smb_auth -W DOMAIN -U 192.168.0.2
acl domainusers proxy_auth REQUIRED
acl linuxserver src 192.168.0.1/255.255.255.255
acl ntserver src 192.168.0.2/255.255.255.255
http_access allow linuxserver
http_access allow ntserver
http_access allow domainusers localhost
http_access allow CONNECT SSL_ports
http_access deny all

So for all web access (SSL or not) the user is required to be authenticated, but SSL is allowed to bypass DansGuardian. I also allow the NT and Linux servers to bypass the filtering and access squid directly.
ipchains method 1
You could redirect incoming requests on port 3128 from the local net to port 8080 while still allowing incoming from the localhost to access 3128. More specific detail is currently beyond the scope of these instructions.
ipchains method 2 – sneaky method
A really sneaky method would be to configure squid to work as a transparent proxy and redirect all port 80 traffic to port 8080. You would want to include method 1 as well. More specific detail is currently beyond the scope of these instructions. There are HOWTOs that cover this.

Client Configuration
Simple config

Let’s assume you have a Linux server at IP 192.168.0.1 which is a caching web proxy and intranet web server. On this server you have DansGuardian installed listening on port 8080.

You need to configure the client browser for http proxy 192.168.0.1 with port 8080. You can configure ftp the same as http – it is reported to work. That’s it. But for efficiency you might want to set the ‚no proxy on‘ to your local Apache server address – 192.168.0.1 in this case. If you’ve got DNS working, you can use the DNS address of your local server. I tend not to.

Sneaky Config
If you’ve used the sneaky method to configure squid then there should be no configuration required. Configure your browser for no proxy and maybe set the ‚no proxy on‘ to your local Apache server address – 192.168.0.1 in this case.

Beebug(Daniel’s) Config
This could be known as super sneaky I suppose. The problem with the simple config method is that you have to configure by hand every browser. This is a pain and is why the sneaky method is really quite good.
The way Beebug solve this is by using a custom in-house Visual Basic application that loads upon login and modifies the needed Windows registry and various files so that IE and Netscape (including email) are configured automatically. It’s so good, you can just stick a copy of Netscape on a server in a share and run this program at login and it automatically just works on all the PCs. No installation and a central copy so it’s easy to update.
It also has other features such as removing unwanted bits such as web folders, GMT/BST auto switching (already done by login script), app data, and other fixes.
Unless I persuade the directors to release it open source you can’t use this method without paying or writing your own. And guess who wrote this – yes – the DansGuardian author!

Support
For all support issues, join the mailing list and post your question or comment there.

If you feel your message is not suitable for public viewing and is private (for example asking for pricing or other commercial issues) then email me direct. My address is daniel at jadeb dot com.

You can also get further help from the DansGuardian web site dansguardian.org.

Any comments about this document, email gb at dansguardian dot org.

 

Zdroje:
http://ubuntuforums.org/showthread.php?t=207008

http://dansguardian.org/downloads/detailedinstallation2.html#further
HOWTO: Install Dansguardian on a single desktop AND for a network
Dansguardian does an outstanding job of web content filtering to protect from rubbish on the internet. This howto is a synthesis of information taken from:
http://www.pilpi.net/journal/item-985.php