[SOLVED] Apache 2.2.x, mod_clamav-0.23, clamav-0.97

Alles, was den Apache betrifft, kann hier besprochen werden.

[SOLVED] Apache 2.2.x, mod_clamav-0.23, clamav-0.97

Postby x11max » 27. April 2011 20:43

Habe folgende Konstellation:

Linux RHEL 5.5, OSX 10.6.7, Apache 2.2.x, mod_clamav-0.23, clamav-0.97

- clamav und mod_clamav fehlerfrei kompiliert und installiert.
- Modul mod_clamav in Apache geladen

Situation:
Betrieb von mod_clamav im "ClamavMode Local".
mod_clamav erkennt keine Viren. Als Testdateien kommen die Virus Testdateien von eicar (com, zip, text) zum Einsatz.

- Aufruf http://localhost/eicar.zip
- scan_log zeigt den Request, jedoch scheint hier nichts gescannt zu werden. Eicar Virus wird nicht erkannt.

[23/Apr/2011:12:13:15 +0200] - application/zip - request="GET /eicar.zip HTTP/1.1", status=200, sent=184, delay=19407

- Aufruf http://localhost/clamav

Der Clamav Module Status sagt: nix gescant, nix gefunden...

Configuration

Version: 0.23
Scanner: local
Statistics

Total requests: 0
Checked for viruses: 0
Total data checked: 0 kB
Maximum request size: 0 bytes
Maximum virus size: 0 bytes
Viruses found: 0
Aborted: 0
Total CPU time: 0.000 sec
Database reloads: 0
Last 10 viruses found:

------------- Ausgabe von clamscan -------------

Der clamav Virenscanner selbst funktioniert.
Ob im Local oder im Daemon Mode gestartet kann ich jeweils ein "PING" senden und erhalte ein "PONG" zurück.

Ebenso funktioniert der clamav Scan:
Logs# clamscan ../htdocs
LibClamAV Warning: **************************************************
LibClamAV Warning: *** The virus database is older than 7 days! ***
LibClamAV Warning: *** Please update it as soon as possible. ***
LibClamAV Warning: **************************************************
../htdocs/eicar-1.com: Eicar-Test-Signature FOUND
../htdocs/eicar-2.com: Eicar-Test-Signature FOUND
../htdocs/eicar.com: Eicar-Test-Signature FOUND
../htdocs/eicar.html: Eicar-Test-Signature FOUND
../htdocs/eicar.zip: Eicar-Test-Signature FOUND
../htdocs/eicar2.zip: Eicar-Test-Signature FOUND
../htdocs/index.html: OK

----------- SCAN SUMMARY -----------
Known viruses: 880838
Engine version: 0.97
Scanned directories: 1
Scanned files: 7
Infected files: 6
Data scanned: 0.00 MB
Data read: 0.00 MB (ratio 0.00:1)
Time: 4.237 sec (0 m 4 s)

Logs# clamdscan ../htdocs
/opt/local/apache2/logs/../htdocs/eicar.html: Eicar-Test-Signature FOUND
/opt/local/apache2/logs/../htdocs/eicar-1.com: Eicar-Test-Signature FOUND
/opt/local/apache2/logs/../htdocs/eicar-2.com: Eicar-Test-Signature FOUND
/opt/local/apache2/logs/../htdocs/eicar.com: Eicar-Test-Signature FOUND
/opt/local/apache2/logs/../htdocs/eicar.zip: Eicar-Test-Signature FOUND
/opt/local/apache2/logs/../htdocs/eicar2.zip: Eicar-Test-Signature FOUND

----------- SCAN SUMMARY -----------
Infected files: 6
Time: 0.109 sec (0 m 0 s)

Nun ist es ganz egal, ob das Modul mod_clamav im Local oder Daemon Mode aktiviert ist. Das Fehlerbild bleibt gleich. Es werden einfach keine Viren erkannt.

Daher meine Frage: kennt jemand dieses Fehlerbild oder kann dazu was sagen ?

Vermutung ist, es liegt am mod_proxy Modul, das der HTTP Request nicht an "libclamav" übergeben wird.
Seit Apache 2.2.x wurde das Proxy Modul überarbeitet und aufgetrennt in mod_proxy und mod_proxy_balancer. Beide Module müssen geladen sein. mod_proxy alleine geht nicht. Und hier scheint wohl das Problem zu liegen.
Oder ich mache grundsätzlich was falsch. Kann eigentlich nicht sein, weil unter Apache 2.0.x mit mod_clamav-0.21 und clamav-0.95.1 läuft es ! Das gleiche Fehlerbild habe ich nicht nur unter Linux, sondern auch auf anderen Plattformen wie beispielsweise unter OSX Snow Leopard.
Last edited by x11max on 28. April 2011 19:20, edited 1 time in total.
x11max
 
Posts: 6
Joined: 19. April 2011 20:17

Re: Linux RHEL 5.5, Apache 2.2.x, mod_clamav-0.23, clamav-0.

Postby x11max » 28. April 2011 19:18

mit folgender Konfig habe ich das Modul nun unter OSX zum laufen gebracht. posting.php?mode=reply&f=5&t=45946&sid=855c803cf29b13737fb53ea64c62847e#

ITEM 1:
Wie schon berichtet, habe ich die mod_clamav.h geändert, damit unter OSX der Linker funktioniert, ansonsten schlägt der make fehl mit
viewtopic.php?f=5&t=45826
[SOLVED] ld: duplicate symbol _clamav_module: mod_clamav APA

ITEM 2: Proxy auskommentiert und Kommunikation via Socket eingerichtet: Insofern merkwürdrig, weil beschrieben steht, das unter OSX
"ClamavMode Daemon" wegen fehlender pthread Funktionalität nicht unterstützt sein soll. Sei es drum, unter OSX 10.6.7 funktioniert es, wie man sieht.

Dabei ist "<proxy *> auskommentiert. Kommunikation via Socket definiert.
Die clamd.conf ebenfalls auf Socket Kommunikation geändert und clamd als Prozess gestartet.
Damit arbeitet das Modul. (s. JPG).

Somit sollte das auch unter Linux mit RHEL 5.5 funktionieren, was ich morgen mal testen werde.

Aber ist das im Sinne des Erfinders ?
Aber wie sieht das mit der Performance aus, wenn man anstatt über die libclamav über den Socket geht ?

scan_log:
28/Apr/2011:19:38:17 +0200] passed - request="GET /clamav HTTP/1.1", status=200, sent=1821, delay=5399
[28/Apr/2011:19:38:18 +0200] passed - request="GET /clamav HTTP/1.1", status=200, sent=1821, delay=4968
[28/Apr/2011:19:38:35 +0200] INFECTED Eicar-Test-Signature request="GET /eicar.html HTTP/1.1", status=200, sent=297, delay=5227
[28/Apr/2011:19:38:37 +0200] INFECTED Eicar-Test-Signature request="GET /eicar.html HTTP/1.1", status=200, sent=297, delay=1449
[28/Apr/2011:19:38:38 +0200] INFECTED Eicar-Test-Signature request="GET /eicar.html HTTP/1.1", status=200, sent=297, delay=1985
[28/Apr/2011:19:38:51 +0200] INFECTED Eicar-Test-Signature request="GET /eicar.html HTTP/1.1", status=200, sent=297, delay=3754
[28/Apr/2011:19:40:09 +0200] passed - request="GET /clamav HTTP/1.1", status=200, sent=2513, delay=7645
[28/Apr/2011:19:43:09 +0200] passed - request="GET /clamav HTTP/1.1", status=200, sent=2513, delay=7790
[28/Apr/2011:19:43:10 +0200] passed - request="GET /clamav HTTP/1.1", status=200, sent=2513, delay=5295
[28/Apr/2011:19:43:11 +0200] passed - request="GET /clamav HTTP/1.1", status=200, sent=2513, delay=5150
[28/Apr/2011:19:43:19 +0200] INFECTED Eicar-Test-Signature request="GET /eicar.zip HTTP/1.1", status=200, sent=296, delay=23141
[28/Apr/2011:19:43:23 +0200] passed - request="GET /clamav HTTP/1.1", status=200, sent=2686, delay=5355
[28/Apr/2011:19:52:48 +0200] INFECTED Eicar-Test-Signature request="GET /eicar.zip HTTP/1.1", status=200, sent=296, delay=3494722
[28/Apr/2011:19:52:59 +0200] INFECTED Eicar-Test-Signature request="GET /eicar.com.txt HTTP/1.1", status=200, sent=300, delay=4873
[28/Apr/2011:19:53:07 +0200] passed - request="GET /clamav HTTP/1.1", status=200, sent=3036, delay=8489

aktuelle include mod_clamav.conf:

# -- load modules
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

<IfDefine CLAMAV>
LoadModule clamav_module modules/mod_clamav.so
</IfDefine>

<IfDefine CLAMAV_DEBUG>
LoadModule clamav_module modules/mod_clamav_debug.so
</IfDefine>

LogLevel Debug

# -- mod_proxy
<IfModule mod_proxy.c>
# ProxyRequests On
# ProxyVia On
# <Proxy http://localhost>
# -- using Apache2 filter mechanism
SetOutputFilter CLAMAV
# -- restricted access
# Order deny,allow
# Deny from all
# Allow from all
# </Proxy>
</IfModule>

# -- mod_clamav

#redirect /eicar.com.txt http://localhost/eicar.html

<IfModule mod_clamav.c>
ClamavExtendedLogging On
LogFormat "%t %!304{clamav:status}n %{clamav:virusname}n request=\"%r\", status=%>s, sent=%!304b, delay=%!304D" clamav_stats
CustomLog logs/scan.log clamav_stats
# -- Clamav directives

# ClamavShm /tmp/clamav.shm
# ClamavMutex /tmp/clamav.lock
ClamavMode daemon
ClamavSocket /tmp/clamd.socket
#ClamavMode local
ClamavTmpdir /var/tmp/
ClamavDbdir /opt/local/share/clamav
# ClamavReloadInterval 1800
# ClamavReloadInterval 1800
# ClamavSafetypes image/gif image/jpeg image/png
# ClamavSafeTypes image/x-ico
# ClamavSafetypes text/html text/plain

<Location /clamav>

# -- builtin status report
SetHandler clamav
# Order deny,allow
# Deny from all
# Allow from all
</Location>
</IfModule>
x11max
 
Posts: 6
Joined: 19. April 2011 20:17


Return to Apache

Who is online

Users browsing this forum: No registered users and 26 guests