|
|
|
@@ -4,7 +4,10 @@ The `antivirus` service is responsible for scanning files for viruses.
|
|
|
|
|
|
|
|
|
|
## Memory Considerations
|
|
|
|
|
|
|
|
|
|
The antivirus service can consume considerably amounts of memory. This is relevant to provide or define sufficient memory for the deployment selected. To avoid out of memory (OOM) situations, the following equation gives a rough overview based on experiences made. The memory calculation comes without any guarantee, is intended as overview only and subject of change.
|
|
|
|
|
The antivirus service can consume considerable amounts of memory.
|
|
|
|
|
This is relevant to provide or define sufficient memory for the deployment selected.
|
|
|
|
|
To avoid out of memory (OOM) situations, the following equation gives a rough overview based on experiences made.
|
|
|
|
|
The memory calculation comes without any guarantee, is intended as overview only and subject of change.
|
|
|
|
|
|
|
|
|
|
`memory limit` = `max file size` x `workers` x `factor 8 - 14`
|
|
|
|
|
|
|
|
|
@@ -19,17 +22,25 @@ With:
|
|
|
|
|
|
|
|
|
|
### Antivirus Scanner Type
|
|
|
|
|
|
|
|
|
|
The antivirus service currently supports [ICAP](https://tools.ietf.org/html/rfc3507) and [ClamAV](http://www.clamav.net/index.html) as antivirus scanners. The `ANTIVIRUS_SCANNER_TYPE` environment variable is used to select the scanner. The detailed configuration for each scanner heavily depends on the scanner type selected. See the environment variables for more details.
|
|
|
|
|
The antivirus service currently supports [ICAP](https://tools.ietf.org/html/rfc3507) and [ClamAV](http://www.clamav.net/index.html) as antivirus scanners.
|
|
|
|
|
The `ANTIVIRUS_SCANNER_TYPE` environment variable is used to select the scanner.
|
|
|
|
|
The detailed configuration for each scanner heavily depends on the scanner type selected.
|
|
|
|
|
See the environment variables for more details.
|
|
|
|
|
|
|
|
|
|
- For `icap`, only scanners using the `X-Infection-Found` header are currently supported.
|
|
|
|
|
- For `clamav` only local sockets can currently be configured.
|
|
|
|
|
|
|
|
|
|
### Maximum Scan Size
|
|
|
|
|
|
|
|
|
|
Several factors can make it necessary to limit the maximum filesize the antivirus service will use for scanning. Use the `ANTIVIRUS_MAX_SCAN_SIZE` environment variable to scan only a given amount of bytes. Obviously, it is recommended to scan the whole file, but several factors like scanner type and version, bandwidth, performance issues, etc. might make a limit necessary.
|
|
|
|
|
Several factors can make it necessary to limit the maximum filesize the antivirus service uses for scanning.
|
|
|
|
|
Use the `ANTIVIRUS_MAX_SCAN_SIZE` environment variable to specify the maximum file size to be scanned.
|
|
|
|
|
|
|
|
|
|
Even if it's recommended to scan each file, several factors like scanner type and version,
|
|
|
|
|
bandwidth, performance issues, etc. might make a limit necessary.
|
|
|
|
|
|
|
|
|
|
**IMPORTANT**
|
|
|
|
|
> Streaming of files to the virus scan service still [needs to be implemented](https://github.com/owncloud/ocis/issues/6803). To prevent OOM errors `ANTIVIRUS_MAX_SCAN_SIZE` needs to be set lower than available ram.
|
|
|
|
|
> Streaming of files to the virus scan service still [needs to be implemented](https://github.com/owncloud/ocis/issues/6803).
|
|
|
|
|
> To prevent OOM errors `ANTIVIRUS_MAX_SCAN_SIZE` needs to be set lower than available ram and or the maximum file size that can be scanned by the virus scanner.
|
|
|
|
|
|
|
|
|
|
### Antivirus Workers
|
|
|
|
|
|
|
|
|
@@ -41,7 +52,7 @@ The antivirus service allows three different ways of handling infected files. Th
|
|
|
|
|
|
|
|
|
|
- `delete`: (default): Infected files will be deleted immediately, further postprocessing is cancelled.
|
|
|
|
|
- `abort`: (advanced option): Infected files will be kept, further postprocessing is cancelled. Files can be manually retrieved and inspected by an admin. To identify the file for further investigation, the antivirus service logs the abort/infected state including the file ID. The file is located in the `storage/users/uploads` folder of the OpenCloud data directory and persists until it is manually deleted by the admin via the [Manage Unfinished Uploads](https://github.com/opencloud-eu/opencloud/tree/main/services/storage-users#manage-unfinished-uploads) command.
|
|
|
|
|
- `continue`: (obviously not recommended): Infected files will be marked via metadata as infected but postprocessing continues normally. Note: Infected Files are moved to their final destination and therefore not prevented from download which includes the risk of spreading viruses.
|
|
|
|
|
- `continue`: (not recommended): Infected files will be marked via metadata as infected, but postprocessing continues normally. Note: Infected Files are moved to their final destination and therefore not prevented from download, which includes the risk of spreading viruses.
|
|
|
|
|
|
|
|
|
|
In all cases, a log entry is added declaring the infection and handling method and a notification via the `userlog` service sent.
|
|
|
|
|
|
|
|
|
|