 |
Squid Proxy és Dansguardian 
Squid Proxy és Dansguardian
TelepÃtés:
sudo apt-get install dansguardian squid firehol
Konfigurálások:
Firehol:
sudo nano /etc/default/firehol
START_FIREHOL=YES
Megengedni újraindÃtani a t?zfalat.
Squid:
sudo cp /etc/squid/squid.conf /etc/squid/squid.conf_backup
Ezzel készÃtünk biztonsági másolatot a squid.conf -ról.
Squid.conf:
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 to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
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 Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
acl pc17 src 10.10.10.2 //Ez a sor adja meg a szabályt.
http_access allow pc17 //Ez a sor pedig, hogy engedi vagy tiltja a pc17 elnevezés? szabályt.
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
icp_access allow all
http_port 3128
hierarchy_stoplist cgi-bin ?
# cache_dir ufs /var/spool/squid 100 16 256
access_log /var/log/squid/access.log squid
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
hosts_file /etc/hosts
coredump_dir /var/spool/squid
A squid.conf szabályrendszere:
src = Forrás IP cÃme, például:
acl sajat01 src 10.1.1.1/30
acl sajat02 src 10.1.1.6-10.1.1.15/32
dst = Cél IP cÃme, például:
acl sajat03 dst 192.168.1.5/32
acl sajat04 dst 192.168.1.5-192.168.2.34/32
srcdomain = Forrás neve, például:
acl sajat05 srcdomain valahol.hu
dstdomain = Cél neve, például:
acl sajat06 dstdomain valahol.hu
srcdom_regex = A forrás nevére illesztett regexp eredménye, például:
acl sajat07 srcdom_regex user.*valahol\.hu
dstdom_regex = A cél nevére illesztett regexp eredménye, például:
acl sajat08 dstdom_regex sex
time = Id?, például:
acl sajat09 time M 10:00-12:00
url_regex = A kért URL szövegére illesztett regexp eredménye, például:
acl sajat10 url_regex ^ftp.*porn
urlpath_regex = A kért URL út szövegére illesztett regexp eredménye, például:
acl sajat11 urlpath_regex \.mpg$
port = A megadott portok, például:
acl sajat12 port 3128 8080
acl sajat13 port 1024-2048
proto = A megadott protokollok, például:
acl sajat14 proto HTTP
method = A megadott metódusok, például:
acl sajat15 method POST
browser = A használt böngész? azonosÃtó szövegére illesztett regexp eredménye, például:
acl sajat16 browser MSIE
maxconn = Egyidejüleg engedélyezett kérések száma, például:
acl sajat17 maxconn 5
A squid és a dansguardian együttm?ködése:
A következ? sorokat kell módosÃtani az /etc/dansguardian/dansguardian.conf-ban:
- A 3. sort ki kell törölni
- Az 59. sort kiegészÃteni filter ip = 127.0.0.1 -re
- 74. sorban lév? YOURSERVER.YOURDOMAIN-t átÃrni a 192.168.1.X-re (a squidet futtató gép IP cÃme)
- 383. sorban lév? virusscan-t off-ra kell átÃrni
Az /etc/dansguardian/bannedextensionlist fájlban be kell tenni #-ot az exe, rar, zip, arj elé
Az /etc/dansguardian/bannedmimetypelist fájlban az application kezdet? sorok elé # kell betenni
Az /etc/dansguardian/exceptionsitelist fájl végén felvenni pár fehér listára szánt oldalt: index.hu origo.hu szoftverbazis.hu letoltes.com sg.hu terminal.hu blacklist mappát másolni az /etc/dansguardian könyvtárba
Az /etc/dansguardian/bannedsitelist fájlban a 78. sorban kivenni a #-ot
Az /etc/squid/squid.conf-ba 593. sorban fel kell venni a k?vetkez? sort:
cache_peer 127.0.0.1 parent 8080 3130
Ezután squid és dansguardian restart.Ha mindent jól csináltál akkor megfelel?en sz?r és korlátoz a squid és dansguardian páros. |
 |