Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
squid-3.1 clamav squidclamav
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Deutsche Dokumentation
View previous topic :: View next topic  
Author Message
Marlo
Veteran
Veteran


Joined: 26 Jul 2003
Posts: 1149

PostPosted: Sun Jan 27, 2013 12:24 pm    Post subject: squid-3.1 clamav squidclamav Reply with quote

squid-3.1 clamav squidclamav

Mit der 3 er Versin von Squid ist das Virenscannen noch einfacher geworden.

tux ~ # emerge squid clamav squidclamav -pv wrote:


These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild R ] net-proxy/squidclamav-6.8 0 kB
[ebuild R ] net-proxy/squid-3.1.22 USE="epoll icap-client logrotate pam snmp sqlite ssl -caps -ecap (-ipf-transparent) -ipv6 -kerberos (-kqueue) -ldap -mysql -nis (-pf-transparent) -postgres -radius -samba -sasl (-selinux) {-test} -tproxy -zero-penalty-hit" 0 kB
[ebuild R ~] app-antivirus/clamav-0.97.6-r2 USE="bzip2 iconv milter -clamdtop -ipv6 (-selinux) -static-libs (-uclibc)" 0 kB


Die squid.conf default reicht aus. Einfach die roten icap Befehle einfügen.
tux# cat /etc/squid/squid.conf | grep "^[^#] wrote:

acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
acl SSL_ports port 443
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 901 # SWAT
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access allow localhost
http_access deny all
http_port 3128
coredump_dir /var/cache/squid
url_rewrite_children 15
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
shutdown_lifetime 3 seconds
icon_directory /usr/share/squid/icons
error_default_language de
error_log_languages on
err_page_stylesheet /etc/squid/errorpage.css
icap_enable on
icap_preview_enable on
icap_preview_size 1024
icap_send_client_ip on
icap_send_client_username on
icap_client_username_header X-Authenticated-User
icap_client_username_encode off
icap_service service_req reqmod_precache bypass=1 icap://127.0.0.1:1344/squidclamav
adaptation_access service_req allow all
icap_service service_resp respmod_precache bypass=1 icap://127.0.0.1:1344/squidclamav
adaptation_access service_resp allow all



tux# cat /etc/clamd.conf | grep "^[^#] wrote:

LogFile /var/log/clamav/clamd.log
LogTime yes
ExtendedDetectionInfo yes
TemporaryDirectory /var/tmp
DatabaseDirectory /var/lib/clamav
LocalSocket /var/run/clamav/clamd.sock
LocalSocketGroup squid
TCPSocket 3310
TCPAddr 127.0.0.1
ExcludePath ^/proc/
ExcludePath ^/sys/
ExcludePath ^/dev/
User clamav
AllowSupplementaryGroups yes
AlgorithmicDetection yes
ScanOLE2 yes
ScanPDF yes
ScanMail yes
PhishingSignatures yes
PhishingScanURLs yes
ScanArchive yes


tux# cat /etc/squidclamav.conf | grep "^[^#] wrote:

maxsize 5000000
redirect http://proxy.domain.dom/cgi-bin/clwarn.cgi
clamd_local /var/run/clamav/clamd.sock
timeout 1
logredir 0
dnslookup 1
abort ^.*\.(ico|gif|png|jpg)$
abortcontent ^image\/.*$
abort ^.*\.(css|xml|xsl|js|html|jsp)$
abortcontent ^text\/.*$
abortcontent ^application\/x-javascript$
abortcontent ^video\/x-flv$
abortcontent ^video\/mp4$
abortcontent ^.*application\/x-mms-framed.*$


Die rote Zeile am Dateiende einfügen.
tux# cat /etc/c-icap/c-icap.conf | grep "^[^#] wrote:

PidFile /var/run/c-icap/c-icap.pid
CommandsSocket /var/run/c-icap/c-icap.ctl
Timeout 300
MaxKeepAliveRequests 100
KeepAliveTimeout 600
StartServers 3
MaxServers 10
MinSpareThreads 10
MaxSpareThreads 20
ThreadsPerChild 10
MaxRequestsPerChild 0
Port 1344
ServerAdmin you@your.address
ServerName YourServerName
TmpDir /var/tmp
MaxMemObject 131072
DebugLevel 1
ModulesDir /usr/lib64/c_icap
ServicesDir /usr/lib64/c_icap
TemplateDir /usr/share/c_icap/templates/
TemplateDefaultLanguage en
LoadMagicFile /etc/c-icap/c-icap.magic
RemoteProxyUsers off
RemoteProxyUserHeader X-Authenticated-User
RemoteProxyUserHeaderEncoded on
ServerLog /var/log/c-icap/server.log
AccessLog /var/log/c-icap/access.log
Service echo srv_echo.so
Service squidclamav squidclamav.so



tux # cat /etc/conf.d/clamd | grep "^[^#] wrote:

START_CLAMD=yes
START_FRESHCLAM=yes
MILTER_NICELEVEL=19
START_MILTER=yes


Mit rc-update die Dienste in default einfügen. Starten und den
Proxy im Browser auf localhost: 3128 einstellen. Den Browsercache leeren
und auf 0 MB Speicherplatz reduzieren. Das macht ja jetzt squid.

Auf die Seite http://www.eicar.org/85-0-Download.html gehen und versuchen,
den HTTP Eicar-Test-Virus anzuklicken. jetzt erscheint eine Fehlerseite, es funktioniert.

Have Fun
Ma
_________________
Test Adobe Flash Player
The Indian Shankar Drum Ganesh Machine


Last edited by Marlo on Mon Jan 28, 2013 4:31 pm; edited 1 time in total
Back to top
View user's profile Send private message
cryptosteve
Veteran
Veteran


Joined: 04 Jan 2004
Posts: 1088
Location: Buchholz/GER

PostPosted: Sun Jan 27, 2013 2:37 pm    Post subject: Reply with quote

GE-NI-AL!

Vieeelen Dank, sowas cooles hab ich ja lange nicht mehr gesehen.

Ich mache hier schon länger mit squid rum und habe hin und wieder echt schwer knobeln müssen. Diese Lösung hätte ich so alleine vermutlich gar nicht realisiert bekommen, weil ich trotz diverser Howtos "icap" gerade zum ersten mal einem richtigen Anwendungsfall zuordnen konnte.

So, schwups, realisiert, und zusätzlich nochmal ein fettes Dankeschön für den Link zum eicar. Dieses kleine HOWTO hat echt an alles gedacht.
_________________
- born to create drama -
cryptosteve - gpg: 0x9B6C7E15
CS Virtual Travel Bug: VF6G5D
Back to top
View user's profile Send private message
Marlo
Veteran
Veteran


Joined: 26 Jul 2003
Posts: 1149

PostPosted: Mon Jan 28, 2013 4:33 pm    Post subject: Reply with quote

Freut mich dir geholfen zu haben und:
Danke für die Blumen. :lol:

Grüße
Ma
_________________
Test Adobe Flash Player
The Indian Shankar Drum Ganesh Machine
Back to top
View user's profile Send private message
cryptosteve
Veteran
Veteran


Joined: 04 Jan 2004
Posts: 1088
Location: Buchholz/GER

PostPosted: Thu Feb 14, 2013 3:51 pm    Post subject: Reply with quote

Moin nochmal,
ich habe gerade eine Kiste von Debian auf Gentoo migriert und daher diesen Guide nochmal durchgespielt. Hat wieder gut funktioniert, aber ich musste den User 'clamav' noch zur Gruppe 'squid' hinzufügen, sonst hat das Setzen der Gruppe durch "LocalSocketGroup squid " nicht funktioniert.

Dies sei nur angemerkt, falls ich mal wieder vor dem gleichen Problem stehe :)
_________________
- born to create drama -
cryptosteve - gpg: 0x9B6C7E15
CS Virtual Travel Bug: VF6G5D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Deutsche Dokumentation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum