PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : samva vscan und clamav



mr.lover
30.06.09, 12:15
Hallo Leutz,
ich brauch wieder mal eure Hilfe.
Bin gerade dabei einen neuen File-Server einzurichten. Drauf werden eh nur Office-Zeug (MS) gespeichert. Natürlich kann es sein, das die Dateien mit Viren verseucht sind.
Ich habe auf dem Fileserver vscan und clamav installiert. Die entsprechende Konfiguration habe ich vorgenommen. Bin nach der Anleitung hier vorgegangen: http://www.linupedia.org/opensuse/Vscan

Wenn ich clamav von Konsole aus starte und nach Viren suche, findet er Tetstvirus(eicar.com) und schiebt automatisch in der vordefinierte Ordner für Viren. Ich möchte aber, dass wenn ein User irgendwas auf dem Server speichert, das die Datei sofort scannt und ggf. in der Quarantäne schiebt und nicht erst wenn ich den Job von Hand starte.
Welche Einstellung muss man da machen, dass es automatisch funktioniert???
Welche config würde euch evnt. helfen um das Problem zu anylisieren?
Will die ja nicht alle posten, da eine config ziemlich lang ist.
O/S= Sles10
Clamav=0.95.1

hier habe ich noch die config aus der vscan-clamav.conf

[samba-vscan]
; run-time configuration for vscan-samba using
; clamd
; all options are set to default values

; do not scan files larger than X bytes. If set to 0 (default),
; this feature is disable (i.e. all files are scanned)
max file size = 0

; log all file access (yes/no). If set to yes, every access will
; be logged. If set to no (default), only access to infected files
; will be logged
verbose file logging = no

; if set to yes (default), a file will be scanned while opening
scan on open = yes
; if set to yes, a file will be scanned while closing (default is yes)
scan on close = yes

; if communication to clamd fails, should access to file denied?
; (default: yes)
deny access on error = yes

; if daemon files with a minor error (corruption, etc.),
; should access to file denied?
; (default: yes)
deny access on minor error = yes

; send a warning message via Windows Messenger service
; when virus is found?
; (default: yes)
send warning message = yes

; what to do with an infected file
; quarantine: try to move to quantine directory
; delete: delete infected file
; nothing: do nothing (default)
infected file action = quarantine

; where to put infected files - you really want to change this!
quarantine directory = /Samba/Virus
; prefix for files in quarantine
quarantine prefix = vir-

; as Windows tries to open a file multiple time in a (very) short time
; of period, samba-vscan use a last recently used file mechanism to avoid
; multiple scans of a file. This setting specified the maximum number of
; elements of the last recently used file list. (default: 100)
max lru files entries = 100

; an entry is invalidad after lru file entry lifetime (in seconds).
; (Default: 5)
lru file entry lifetime = 5

; exclude files from being scanned based on the MIME-type! Semi-colon
; seperated list (default: empty list). Use this with care!
exclude file types =


; socket name of clamd (default: /var/run/clamd). Setting will be ignored if
; libclamav is used
clamd socket name = /var/lib/clamav/clamd-socket

; limits, if vscan-clamav was build for using the clamav library (libclamav)
; instead of clamd

; maximum number of files in archive (default: 1000)
libclamav max files in archive = 1000

; maximum archived file size, in bytes (default: 10 MB)
libclamav max archived file size = 10485760

; maximum recursion level (default: 5)
libclamav max recursion level = 5


Schönen tag

Stormbringer
30.06.09, 15:18
Welche config würde euch evnt. helfen um das Problem zu anylisieren?
Will die ja nicht alle posten, da eine config ziemlich lang ist.

Es wird schon übersichtlicher, und kürzer, wenn Kommentarzeilen rausgenommen würden ...

Wenn ich mich recht entsinne ging das innerhalb der smb.conf über die VFS-Funktion, also bspw.:


vfs object = vscan-antivir
vscan-antivir : config-file = /etc/samba/vscan.conf

(Oder so ähnlich).
Man konnte es explizit einzelnen Bereichen zuordnen, bspw. [global] für alle shares, oder nur bspw. [public] für einzelne shares.
afair gab es aber mit manchen AV-Produkten ganz unterschiedliche Performanceergebnisse ...

mr.lover
01.07.09, 09:40
Morgen,

ja das habe ich auch in der samba.conf eingetragen. In prinzip funktinioniert auch. Nur wenn ich ein manuellen Start mache, findet er diesen Eicar-Testvirus und schiebt es in der Quarantäne. Es soll aber automatisch passieren. Wenn ein User etwas in einer Freigabe speichert, schreibt zwar Clamav in der log-Datei das es ein Virus gefunden hat aber der verschiebt die betroffene Datei nicht in der Quarantäne. Das ist ja mein Problem. Ich könnte per Job diese manuelle suche starten aber das geht doch bestimmt auch automatisch!?!?! oder ???

hier meine clamav.conf

##

LogFile /var/log/Clamav/clamd.log


#LogFileUnlock yes


#LogFileMaxSize 2M


LogTime yes

#LogClean yes

LogSyslog yes


LogFacility LOG_MAIL

#LogVerbose yes


PidFile /var/lib/clamav/clamd.pid


#TemporaryDirectory /var/tmp

#DatabaseDirectory /var/lib/clamav


LocalSocket /var/lib/clamav/clamd-socket

#FixStaleSocket yes

#TCPSocket 3310

#TCPAddr 127.0.0.1

#MaxConnectionQueueLength 30


#StreamMaxLength 20M

# Default: 1024
#StreamMinPort 30000
# Default: 2048
#StreamMaxPort 32000

#MaxThreads 20

#ReadTimeout 300

#IdleTimeout 60

#MaxDirectoryRecursion 20

# Follow directory symlinks.
# Default: no
#FollowDirectorySymlinks yes

# Follow regular file symlinks.
# Default: no
#FollowFileSymlinks yes

# Perform a database check.
# Default: 1800 (30 min)
#SelfCheck 600

#VirusEvent /usr/local/bin/send_sms 123456789 "VIRUS ALERT: %v"


User root


#AllowSupplementaryGroups no

#ExitOnOOM yes

#Foreground yes

#Debug yes

#LeaveTemporaryFiles yes

#DetectPUA yes

#AlgorithmicDetection yes


ScanPE yes

ScanELF yes

#DetectBrokenExecutables yes

ScanOLE2 yes

ScanPDF yes


#ScanMail yes


#MailFollowURLs no

#PhishingSignatures yes

#PhishingScanURLs yes

#PhishingAlwaysBlockSSLMismatch no

#PhishingAlwaysBlockCloak no

#ScanHTML yes

ScanArchive yes

#ArchiveLimitMemoryUsage yes


#ArchiveBlockEncrypted no


#MaxScanSize 150M

#MaxFileSize 30M


#MaxRecursion 10


##
## Clamuko settings
## WARNING: This is experimental software. It is very likely it will hang
## up your system!!!
##

# Enable Clamuko. Dazuko (/dev/dazuko) must be configured and running.
#
# When enabling this, you most probably have to set "User root" above,
# so that clamav can access the files to be scanned.
#
# Default: no
#ClamukoScanOnAccess yes

# Set access mask for Clamuko.
# Default: no
#ClamukoScanOnOpen yes
#ClamukoScanOnClose yes
#ClamukoScanOnExec yes

# Set the include paths (all files inside them will be scanned). You can have
# multiple ClamukoIncludePath directives but each directory must be added
# in a seperate line.
# Default: disabled
#ClamukoIncludePath /home
#ClamukoIncludePath /students

# Set the exclude paths. All subdirectories are also excluded.
# Default: disabled
#ClamukoExcludePath /home/bofh

# Don't scan files larger than ClamukoMaxFileSize
# Value of 0 disables the limit.
# Default: 5M
#ClamukoMaxFileSize 10M


und die vscann-clamav.conf


[samba-vscan]
; run-time configuration for vscan-samba using
; clamd
; all options are set to default values

; do not scan files larger than X bytes. If set to 0 (default),
; this feature is disable (i.e. all files are scanned)
max file size = 0

; log all file access (yes/no). If set to yes, every access will
; be logged. If set to no (default), only access to infected files
; will be logged
verbose file logging = no

; if set to yes (default), a file will be scanned while opening
scan on open = yes
; if set to yes, a file will be scanned while closing (default is yes)
scan on close = yes

; if communication to clamd fails, should access to file denied?
; (default: yes)
deny access on error = yes

; if daemon files with a minor error (corruption, etc.),
; should access to file denied?
; (default: yes)
deny access on minor error = yes

; send a warning message via Windows Messenger service
; when virus is found?
; (default: yes)
send warning message = yes

; what to do with an infected file
; quarantine: try to move to quantine directory
; delete: delete infected file
; nothing: do nothing (default)
infected file action = quarantine

; where to put infected files - you really want to change this!
quarantine directory = /Virus
; prefix for files in quarantine
quarantine prefix = vir-

; as Windows tries to open a file multiple time in a (very) short time
; of period, samba-vscan use a last recently used file mechanism to avoid
; multiple scans of a file. This setting specified the maximum number of
; elements of the last recently used file list. (default: 100)
max lru files entries = 100

; an entry is invalidad after lru file entry lifetime (in seconds).
; (Default: 5)
lru file entry lifetime = 5

; exclude files from being scanned based on the MIME-type! Semi-colon
; seperated list (default: empty list). Use this with care!
exclude file types =

; exclude files from being scanned via regular expression (PCRE)
; (default: empty)
exclude file regexp =

; socket name of clamd (default: /var/run/clamd). Setting will be ignored if
; libclamav is used
clamd socket name = /var/lib/clamav/clamd-socket

; scan inside of archives (only with clamd)
; (default: yes)
scan archives = yes

; limits, if vscan-clamav was build for using the clamav library (libclamav)
; instead of clamd

; maximum number of files in archive (default: 1000)
libclamav max files in archive = 1000

; maximum archived file size, in bytes (default: 10 MB)
libclamav max archived file size = 10485760

; maximum recursion level (default: 5)
libclamav max recursion level = 5



danke ....

:(

Stormbringer
01.07.09, 10:21
ja das habe ich auch in der samba.conf eingetragen.
... irgendwie kann man das so aus der ferne nicht wirklich sehen ...



In prinzip funktinioniert auch. Nur wenn ich ein manuellen Start mache, findet er diesen Eicar-Testvirus und schiebt es in der Quarantäne. Es soll aber automatisch passieren. Wenn ein User etwas in einer Freigabe speichert, schreibt zwar Clamav in der log-Datei das es ein Virus gefunden hat aber der verschiebt die betroffene Datei nicht in der Quarantäne. Das ist ja mein Problem.
Da fällt mir ganz spontan ein Wort ein: Berechtigungen
Sei es auf Seiten von clamav oder des Benutzers der etwas speichert ...
Ich könnt mir vorstellen das alles funktioniert, wenn der Benutzer root etwas auf dem share speichert ... oder?

mr.lover
01.07.09, 17:49
wenn der user root was speichert, reagiert der clamav garnicht.
User root in der clamav.conf auf ein anderen benutzer geändert, lässt sich clamav nicht mal starten.

Hat keiner von euch sowas im einsatz ????

Oder blöd gefragt, gehts es mit clamav überhaupt?? Das er die Datei sofort scannt und bei einen fund sofort in der Quarantäne schiebt??
Wenn ich von Hand starte gehts ja, nur automatisch zickt das ding...
Wie gesagt, er scannt die Datei und schreibt in der log-Datei, das clamav ein Virus gefunden hat, nur verschieben tut er nicht automatisch..

mr.lover
02.07.09, 13:55
es tutttttt :)

also man braucht
clamav, samba-vscan und dazuko (On-Access-Scanning (Live-Scans)).

Bei dazuko vorsicht sein, da er mit Kernel 2.6.16 zickt:) :ugly::ugly: