Clamav problem: Action for infected files found while scanning not working as expected
Steps to reproduce
- From the apps menu, install/enable Antivirus App for files 0.7.0.1
- From admin menu, under Antivirus Configuration, configure mode to daemon socket
- Set "Action for infected files found while scanning" to either "Only Log" or "Delete file" - result is the same
Expected behaviour
In documentation it says: "Action for infected files found while scanning gives you the choice of logging any alerts without deleting the files, or immediately deleting infected files."
- thus I expect that when selected "Delete file", uploaded files are really deleted
Actual behaviour
Options:
- Only Log: if you try to upload file, you get a warning "Virus Eicar-Test-Signature is detected in the file. Upload cannot be completed." and file is not uploaded, however it's moved to trash bin - bottom left "Deleted files"
- Delete file: exactly the same situation like for "Only log"
That being said, I do not expect for files to be moved in trash bin, because same can be restored and will be visible in my Files and I can e.g. open txt file
Server configuration
Operating system: Debian 8
Web server: Apache
Database: MariaDB
PHP version: 5.6.12
ownCloud version: (see ownCloud admin page) 8.1.1
Updated from an older ownCloud or fresh install: fresh install
List of activated apps: Enabled:
- activity: 2.0.1
- files: 1.1.10
- files_antivirus: 0.7.0.1
- files_pdfviewer: 0.7
- files_sharing: 0.6.2
- files_texteditor: 0.4
- files_trashbin: 0.6.3
- files_versions: 1.0.6
- files_videoviewer: 0.1.3
- firstrunwizard: 1.1
- gallery: 0.6.0
- provisioning_api: 0.2
- templateeditor: 0.1
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder
The content of config/config.php:
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system --public
from within your ownCloud installation folder
(side note)
$ sudo -u www-data php occ config:list system --public
[InvalidArgumentException]
There are no commands defined in the "config" namespace.
or
Insert your config.php content here
(Without the database password, passwordsalt and secret)
'',
'passwordsalt' => '',
'secret' => '',
'trusted_domains' =>
array (
0 => 'XX',
),
'datadirectory' => '/opt/owncloud/data',
'overwrite.cli.url' => 'XX',
'dbtype' => 'mysql',
'version' => '8.1.1.3',
'dbname' => 'db_name',
'dbhost' => 'localhost',
'dbtableprefix' => 'oc_',
'dbuser' => 'db_user',
'dbpassword' => 'db_pass',
'logtimezone' => 'UTC',
'installed' => true,
'loglevel' => 3,
'asset-pipeline.enabled' => true,
'memcache.local' => '\OC\Memcache\APCu',
'defaultapp' => 'files',
'theme' => '',
'maintenance' => false,
'mail_smtpmode' => 'php',
'mail_smtpauth' => 1,
'mail_smtpsecure' => 'ssl',
'appstore.experimental.enabled' => false,
'filelocking.enabled' => 'true',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' =>
array (
'host' => 'localhost',
0 => '/tmp/redis.sock',
'port' => 6379,
'timeout' => 0,
),
'singleuser' => false,
);
**Are you using external storage, if yes which one:** local/smb/sftp/... - no external storage
**Are you using encryption:** no
**Are you using an external user-backend, if yes which one:** LDAP/ActiveDirectory/Webdav/... - no external user-backend
### Client configuration
**Browser:** Mozilla Firefox
**Operating system:** Ubuntu 14.04 LTS
### Logs
#### Web server error log
```
Insert your webserver log here: there is no access.log, here is clamav log:
```
$ cat /var/log/clamav/clamav.log
Tue Sep 1 07:25:04 2015 -> SelfCheck: Database status OK.
Tue Sep 1 07:53:40 2015 -> Reading databases from /var/lib/clamav
Tue Sep 1 07:54:11 2015 -> Database correctly reloaded (3974074 signatures)
Tue Sep 1 08:54:11 2015 -> SelfCheck: Database status OK.
Tue Sep 1 09:17:35 2015 -> instream(local): Eicar-Test-Signature(44d88612fea8a8f36de82e1278abb02f:68) FOUND
Tue Sep 1 09:17:51 2015 -> instream(local): Eicar-Test-Signature(c551ec62194d60b10ee0a4210124e92d:192) FOUND
Tue Sep 1 09:17:58 2015 -> instream(local): Eicar-Test-Signature(50aaaf61c662ecb264eda62ea8a9f539:2048) FOUND
Tue Sep 1 09:19:43 2015 -> instream(local): Eicar-Test-Signature(c551ec62194d60b10ee0a4210124e92d:192) FOUND
Tue Sep 1 09:20:14 2015 -> instream(local): Eicar-Test-Signature(c551ec62194d60b10ee0a4210124e92d:192) FOUND
Tue Sep 1 09:20:25 2015 -> instream(local): Eicar-Test-Signature(50aaaf61c662ecb264eda62ea8a9f539:2048) FOUND
Tue Sep 1 09:20:48 2015 -> instream(local): Eicar-Test-Signature(44d88612fea8a8f36de82e1278abb02f:68) FOUND
#### ownCloud log (data/owncloud.log)
```
Insert your ownCloud log here
```
{"reqId":"r34CN5VpKM02HWsDdqis","remoteAddr":"XX","app":"files_antivirus","message":"Response :: stream: Eicar-Test-Signature FOUND\n","level":0,"time":"2015-09-01T07:17:35+00:00","method":"POST","url":"\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"v36UqVxT3l1IsCw4nUCG","remoteAddr":"XX","app":"files_antivirus","message":"Response :: stream: Eicar-Test-Signature FOUND\n","level":0,"time":"2015-09-01T07:17:51+00:00","method":"POST","url":"\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"6WMAh8fxCCFlVqBac6lf","remoteAddr":"XX","app":"files_antivirus","message":"Response :: stream: Eicar-Test-Signature FOUND\n","level":0,"time":"2015-09-01T07:17:58+00:00","method":"POST","url":"\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"GjG09pe1wo\/6zH6bQDSV","remoteAddr":"XX","app":"files_antivirus","message":"Response :: stream: Eicar-Test-Signature FOUND\n","level":0,"time":"2015-09-01T07:19:43+00:00","method":"POST","url":"\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"4EBWvkpBMwdmjdqTdAz2","remoteAddr":"XX","app":"files_antivirus","message":"Response :: stream: Eicar-Test-Signature FOUND\n","level":0,"time":"2015-09-01T07:20:14+00:00","method":"POST","url":"\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"y93tKyY6X5Ci1aHwGPjh","remoteAddr":"XX","app":"files_antivirus","message":"Response :: stream: Eicar-Test-Signature FOUND\n","level":0,"time":"2015-09-01T07:20:25+00:00","method":"POST","url":"\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"uSGB2Jl51C4pbUKkg+Sf","remoteAddr":"XX","app":"files_antivirus","message":"Response :: stream: Eicar-Test-Signature FOUND\n","level":0,"time":"2015-09-01T07:20:48+00:00","method":"POST","url":"\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"x1WA2fsftnLrN3GyMY+v","remoteAddr":"XX","app":"files_antivirus","message":"Response :: stream: Eicar-Test-Signature FOUND\n","level":0,"time":"2015-09-01T07:42:24+00:00","method":"POST","url":"\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"yR+xUfystPPheXV7nY\/u","remoteAddr":"XX","app":"files_antivirus","message":"Response :: stream: Eicar-Test-Signature FOUND\n","level":0,"time":"2015-09-01T07:42:56+00:00","method":"POST","url":"\/index.php\/apps\/files\/ajax\/upload.php"}
#### Browser log
```
Insert your browser log here, this could for example include:
POST upload.php
200 OK
RESPONSE
{"0":{"data":{"message":"Virus Eicar-Test-Signature is detected in the file. Upload cannot be completed.","code":null,"uploadMaxFilesize":537919488,"maxHumanFilesize":"Upload (max. 513 MB)
248 B
XY:443
392ms
GET getstoragestats.php?dir=%2F
200 OK
{"data":{"uploadMaxFilesize":537919488,"maxHumanFilesize":"Upload (max. 513 MB)","freeSpace":10734461265,"usedSpacePercent":0,"owner":"XY","ownerDisplayName":"XY"},"status":"success"}
203 B
XY:443
103ms
```
Let me know if you need anything else!
THX for this detailed report! But we need this in te files-antivirus repo. THX.
@vicdeo fyi
THX for this detailed report! But we need this in te files-antivirus repo. THX.
@vicdeo fyi
known as https://github.com/owncloud/files_antivirus/issues/68