• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

samba-vscan ClamAV openSUSE 10.3 [GELÖST]

A

Anonymous

Gast
Hallo,

ich möchte gerne einen freigegebenen Ordner überwachen.
Dieser freigegebene Ordner dient dazu Dateien mit einem Windows Rechner auszutauschen.

Natürlich habe ich mir auch Gedanken über das leidige Themen Viren gemacht.
Deshalb habe ich mir samba-vscan und auch clamav installiert.
Im Runlevel Editor läuft freshclam und auch clamav als Daemon.

Allerdings schlägt ClamAV nicht an wenn ich in den freigegebenen Ordner eine mit Viren verseuchte Datei reinkopiere oder öffne.

Hier mal alle von mir editierten Dateien:

Hier die /etc/clamav.conf

##
## Config file for the Clam AV daemon
## Please read the clamd.conf(5) manual before editing this file.
##

# Uncomment this option to enable logging.
# LogFile must be writable for the user running daemon.
# A full path is required.
# Default: disabled
#LogFile /tmp/clamd.log

# By default the log file is locked for writing - the lock protects against
# running clamd multiple times (if want to run another clamd, please
# copy the configuration file, change the LogFile variable, and run
# the daemon with --config-file option).
# This option disables log file locking.
# Default: no
#LogFileUnlock yes

# Maximum size of the log file.
# Value of 0 disables the limit.
# You may use 'M' or 'm' for megabytes (1M = 1m = 1048576 bytes)
# and 'K' or 'k' for kilobytes (1K = 1k = 1024 bytes). To specify the size
# in bytes just don't use modifiers.
# Default: 1M
#LogFileMaxSize 2M

# Log time with each message.
# Default: no
#LogTime yes

# Also log clean files. Useful in debugging but drastically increases the
# log size.
# Default: no
#LogClean yes

# Use system logger (can work together with LogFile).
# Default: no
LogSyslog yes

# Specify the type of syslog messages - please refer to 'man syslog'
# for facility names.
# Default: LOG_LOCAL6
LogFacility LOG_MAIL

# Enable verbose logging.
# Default: no
#LogVerbose yes

# This option allows you to save a process identifier of the listening
# daemon (main thread).
# Default: disabled
PidFile /var/lib/clamav/clamd.pid

# Optional path to the global temporary directory.
# Default: system specific (usually /tmp or /var/tmp).
#TemporaryDirectory /var/tmp

# Path to the database directory.
# Default: hardcoded (depends on installation options)
#DatabaseDirectory /var/lib/clamav

# The daemon works in a local OR a network mode. Due to security reasons we
# recommend the local mode.

# Path to a local socket file the daemon will listen on.
# Default: disabled (must be specified by a user)
LocalSocket /var/lib/clamav/clamd-socket


# Remove stale socket after unclean shutdown.
# Default: yes
#FixStaleSocket yes


# TCP port address.
# Default: no
TCPSocket 3310

# TCP address.
# By default we bind to INADDR_ANY, probably not wise.
# Enable the following to provide some degree of protection
# from the outside world.
# Default: no
TCPAddr 127.0.0.1

# Maximum length the queue of pending connections may grow to.
# Default: 15
#MaxConnectionQueueLength 30

# Clamd uses FTP-like protocol to receive data from remote clients.
# If you are using clamav-milter to balance load between remote clamd daemons
# on firewall servers you may need to tune the options below.

# Close the connection when the data size limit is exceeded.
# The value should match your MTA's limit for a maximum attachment size.
# Default: 10M
#StreamMaxLength 20M

# Limit port range.
# Default: 1024
#StreamMinPort 30000
# Default: 2048
#StreamMaxPort 32000

# Maximum number of threads running at the same time.
# Default: 10
#MaxThreads 20

# Waiting for data from a client socket will timeout after this time (seconds).
# Value of 0 disables the timeout.
# Default: 120
#ReadTimeout 300

# Waiting for a new job will timeout after this time (seconds).
# Default: 30
#IdleTimeout 60

# Maximum depth directories are scanned at.
# Default: 15
#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

# Execute a command when virus is found. In the command string %v will
# be replaced with the virus name.
# Default: no
#VirusEvent /usr/local/bin/send_sms 123456789 "VIRUS ALERT: %v"

# Run as another user (clamd must be started by root for this option to work)
# Default: don't drop privileges
User root

# Initialize supplementary group access (clamd must be started by root).
# Default: no
#AllowSupplementaryGroups no

# Stop daemon when libclamav reports out of memory condition.
#ExitOnOOM yes

# Don't fork into background.
# Default: no
#Foreground yes

# Enable debug messages in libclamav.
# Default: no
#Debug yes

# Do not remove temporary files (for debug purposes).
# Default: no
#LeaveTemporaryFiles yes

# Detect Possibly Unwanted Applications.
# Default: no
#DetectPUA yes

# In some cases (eg. complex malware, exploits in graphic files, and others),
# ClamAV uses special algorithms to provide accurate detection. This option
# controls the algorithmic detection.
# Default: yes
#AlgorithmicDetection yes


##
## Executable files
##

# PE stands for Portable Executable - it's an executable file format used
# in all 32 and 64-bit versions of Windows operating systems. This option allows
# ClamAV to perform a deeper analysis of executable files and it's also
# required for decompression of popular executable packers such as UPX, FSG,
# and Petite.
# Default: yes
#ScanPE yes

# Executable and Linking Format is a standard format for UN*X executables.
# This option allows you to control the scanning of ELF files.
# Default: yes
#ScanELF yes

# With this option clamav will try to detect broken executables (both PE and
# ELF) and mark them as Broken.Executable.
# Default: no
#DetectBrokenExecutables yes


##
## Documents
##

# This option enables scanning of OLE2 files, such as Microsoft Office
# documents and .msi files.
# Default: yes
#ScanOLE2 yes

# This option enables scanning within PDF files.
# Default: no
#ScanPDF yes


##
## Mail files
##

# Enable internal e-mail scanner.
# Default: yes
#ScanMail yes

# If an email contains URLs ClamAV can download and scan them.
# WARNING: This option may open your system to a DoS attack.
# Never use it on loaded servers.
# Default: no
#MailFollowURLs no

# Recursion level limit for the mail scanner.
# Default: 64
#MailMaxRecursion 128

# With this option enabled ClamAV will try to detect phishing attempts by using
# signatures.
# Default: yes
#PhishingSignatures yes

# Scan URLs found in mails for phishing attempts using heuristics.
# Default: yes
#PhishingScanURLs yes

# Use phishing detection only for domains listed in the .pdb database. It is
# not recommended to have this option turned off, because scanning of all
# domains may lead to many false positives!
# Default: yes
#PhishingRestrictedScan yes

# Always block SSL mismatches in URLs, even if the URL isn't in the database.
# This can lead to false positives.
#
# Default: no
#PhishingAlwaysBlockSSLMismatch no

# Always block cloaked URLs, even if URL isn't in database.
# This can lead to false positives.
#
# Default: no
#PhishingAlwaysBlockCloak no


##
## HTML
##

# Perform HTML normalisation and decryption of MS Script Encoder code.
# Default: yes
#ScanHTML yes


##
## Archives
##

# ClamAV can scan within archives and compressed files.
# Default: yes
#ScanArchive yes

# The options below protect your system against Denial of Service attacks
# using archive bombs.

# Files in archives larger than this limit won't be scanned.
# Value of 0 disables the limit.
# Default: 10M
#ArchiveMaxFileSize 15M

# Nested archives are scanned recursively, e.g. if a Zip archive contains a RAR
# file, all files within it will also be scanned. This options specifies how
# deeply the process should be continued.
# Value of 0 disables the limit.
# Default: 8
#ArchiveMaxRecursion 10

# Number of files to be scanned within an archive.
# Value of 0 disables the limit.
# Default: 1000
#ArchiveMaxFiles 1500

# If a file in an archive is compressed more than ArchiveMaxCompressionRatio
# times it will be marked as a virus (Oversized.ArchiveType, e.g. Oversized.Zip)
# Value of 0 disables the limit.
# Default: 250
#ArchiveMaxCompressionRatio 300

# Use slower but memory efficient decompression algorithm.
# only affects the bzip2 decompressor.
# Default: no
#ArchiveLimitMemoryUsage yes

# Mark encrypted archives as viruses (Encrypted.Zip, Encrypted.RAR).
# Default: no
#ArchiveBlockEncrypted no

# Mark archives as viruses (e.g. RAR.ExceededFileSize, Zip.ExceededFilesLimit)
# if ArchiveMaxFiles, ArchiveMaxFileSize, or ArchiveMaxRecursion limit is
# reached.
# Default: no
#ArchiveBlockMax no


##
## 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

Hier die 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 = /tmp
; 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



Hier die smb.conf


# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
# Date: 2007-12-04
[global]
workgroup = XXXXXX
printing = cups
printcap name = cups
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \\%L\profiles\.msprofile
logon home = \\%L\%U\.9xprofile
logon drive = P:
security = user
usershare allow guests = Yes
add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$
domain master = No
usershare max shares = 100

[homes]
comment = Home Directories
vfs object = vscan-clamav
vscan-clamav: config-file = /etc/samba/vscan-clamav.conf
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes

[profiles]
comment = Network Profiles Service
path = %H
read only = No
store dos attributes = Yes
create mask = 0600
directory mask = 0700

[users]
comment = All users
path = /home
read only = No
inherit acls = Yes
veto files = /aquota.user/groups/shares/

[groups]
comment = All groups
path = /home/groups
read only = No
inherit acls = Yes

[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @ntadmin root
force group = ntadmin
create mask = 0664
directory mask = 0775

[share]
comment = Freigabeordner XXXXXXX
inherit acls = Yes
path = /home/Benutzername/Freigabeordner
read only = No
guest ok = yes



Und warum klappt das jetzt nicht?
 
OP
A

Anonymous

Gast
dariuszmarek schrieb:

Hallo,

Dazuko wird nur für antivir von avira benötigt.
Für clamav braucht man dazuko laut der gefundenen HowTo's nicht.
Lediglich das Paket samba-vscan muss installiert sein.


Link zu den Anleitungen nach denen ich vorgegangen bin:

http://www.linux-magazin.de/heft_abo/ausgaben/2006/10/samba_abc_im_freien?category=0

http://wiki.linux-club.de/opensuse/Vscan
 

stka

Guru
Wenn du dein conf Dateien mal in "qoute" setzen würdest und dann noch die Kommentare aus den conf Dateien ausfiltern würdest, könnte man das ganze auch schneller überblicken. So habe ich kaum Lust darüber zu schauen, die Kommentare habe ich alle schon 100erte Male gelesen.
Hast du auch mal hier geschaut:
http://wiki.linux-club.de/opensuse/Vscan
 
OP
A

Anonymous

Gast
stka schrieb:
Wenn du dein conf Dateien mal in "qoute" setzen würdest und dann noch die Kommentare aus den conf Dateien ausfiltern würdest, könnte man das ganze auch schneller überblicken. So habe ich kaum Lust darüber zu schauen, die Kommentare habe ich alle schon 100erte Male gelesen.
Hast du auch mal hier geschaut:
http://wiki.linux-club.de/opensuse/Vscan


Ich habe genau diesen Link oben selber gepostet und bin auch nach diesem Wiki bei der Konfiguration vorgegangen.
Leider funktioniert es trotzdem nicht.

Ich kann mir gut vorstellen, dass du derlei Kommentare schon oft gelesen hast.
Da aber auch (berechtigterweise) immer gemeckert wird wenn man ungenaue Angaben macht, habe ich versucht mein Posting so genau wie möglich zu schreiben. - immerhin kann ja niemand wissen was ich da genau in den Dateien editiert habe.
Ich Quote auch wenn möglich. ;-)
Wenn du keine Lust hast das zu lesen kann ich es auch nicht ändern.
Vielleicht hat ja jemand anders Lust mir einen Hinweis zu geben?
 
OP
A

Anonymous

Gast
dariuszmarek schrieb:
TRex30M schrieb:
dariuszmarek schrieb:

Hallo,

Dazuko wird nur für antivir von avira benötigt.
Für clamav braucht man dazuko laut der gefundenen HowTo's nicht.
Quelle?
Sehr wohl brauchst du dazuko.

Du hast vollkommen recht. Ich brauche tatsächlich Dazuko.
Tut mir leid, dass ich dir nicht gleich geglaubt habe. :oops:
Nur das Wiki hat das mit keinem Wort erwähnt..... (geschrieben von Stka)
Und auch der Artikel im Linux Magazin hat das nicht so beschrieben....


Was hat sich in der Zwischenzeit bei mir getan?

Ich hab es jetzt aufgegeben mit dem editieren der Dateien - irgendwann ist auch mein Geduld zu Ende. :evil:

Dafür habe ich jetzt eine andere Lösung gefunden:

Ich bin draufgekommen, dass man ClamAV auch mit Dazuko nutzen kann. (obwohl ich es zuvor eben nicht geglaubt habe und dachte das brauche ich nur für Antivir)
Also Dazuko über Yast installiert inklusive dem dazuko default kernel.
Jetzt läuft ClamAV Update automatisch ab nur mit /dev/dazuko habe ich noch ein Problem.
Damit ausgewählte Ordner permanent überwacht werden brauche ich als Benutzer Leserechte.

Deshalb habe ich versucht (als root) mittels Befehl chmod +s /dev/dazuko und chmod 666 /dev/dazuko die entsprechenden Leserechte zu vergeben.
Allerdings ist damit Pustekuchen - es kommt jedesmal die Meldung "Can't start Automatic Scanning! Check you have read permissions on file /dev/dazuko"

So und wie muss ich die Leserechte jetzt vergeben damit das endlich mal ohne wenn und aber funkioniert? *seufz*
 

dma67

Hacker
TRex30M schrieb:
dariuszmarek schrieb:
TRex30M schrieb:
So und wie muss ich die Leserechte jetzt vergeben damit das endlich mal ohne wenn und aber funkioniert? *seufz*
Das ist das geringste Problem.
Mach folgendes:
Erstell ein skript mit folgendem Inhalt
Code:
#! /bin/sh
# Permissions for /dev/dazuko
chown root:users /dev/dazuko
und benenne ihn zb. dazuko
Kopiere den in das Verzeichnis /etc/init.d
Nun muss Du im Yast im Runlevel-Editor den Skript "dazuko" im init 3 und init 5 starten lassen.
Das hat zur Folge, dass JEDER user dazuko starten kann - und das nach jedem Restart des Rechners.
Vuala!
 
OP
A

Anonymous

Gast
dariuszmarek schrieb:
TRex30M schrieb:
dariuszmarek schrieb:
Das ist das geringste Problem.
Mach folgendes:
Erstell ein skript mit folgendem Inhalt
Code:
#! /bin/sh
# Permissions for /dev/dazuko
chown root:users /dev/dazuko
und benenne ihn zb. dazuko
Kopiere den in das Verzeichnis /etc/init.d
Nun muss Du im Yast im Runlevel-Editor den Skript "dazuko" im init 3 und init 5 starten lassen.
Das hat zur Folge, dass JEDER user dazuko starten kann - und das nach jedem Restart des Rechners.
Vuala!

Danke für dein Hilfe.
Leider tut Dazuko immer noch nicht.
Hab jetzt auch schon die rpm gekillt und die tar.gz mittels Dreisatz installiert.
Angemeldet als root funktioniert es einwandfrei.
Als Benutzer kommt jetzt ein Fenster wo ' modprobe dazuko' drinnen steht und er das root passwort will.
Gibt man es ein kommt wieder das Fenster, dass keine Leserechte vorhanden sind...
 

dma67

Hacker
Welche Version dazuko? Die rpm-Version von SusE 10.3 dürfte eigentlich laufen.

Hast du per skript die Rechte geändert? entweder neustarten oder
Code:
sudo sh /etc/init.d/dazuko
ausführen.
 
OP
A

Anonymous

Gast
dariuszmarek schrieb:
Welche Version dazuko? Die rpm-Version von SusE 10.3 dürfte eigentlich laufen.

Hast du per skript die Rechte geändert? entweder neustarten oder
Code:
sudo sh /etc/init.d/dazuko
ausführen.

Ok Ok,

ich habe jetzt alles nochmals komplett deinstalliert und dann die rpm Paket mit Yast neu installiert.

Danach bin ich nach dieser Anleitung hier vorgegangen:

http://de.opensuse.org/Klamav_mit_On-Access-Scanning_(Dazuko)_installieren

Dann hat es endlich funktioniert - allerdings mit Einschränkungen.

Ich kann zwar jetzt den On-Access Scanner aktivieren
Aber dann rödelt die Festplatte die ganze Zeit und Firefox lässt sich nicht mehr öffnen.
Deshalb habe ich den On-Access Scanner deaktiviert.

KlamAV kann ich auch nicht updaten da irgendwas mit dem KDE Header nicht passt.

Na wenigstens läuft er jetzt überhaupt....

Danke für Eure Hilfe. :)
 
Oben