6.17. Malware scan of uploaded files in End User Self Service#
This section is for operators who want the End User Self Service to scan uploaded files for malware, such as profile pictures.
The End User Self Service sends each uploaded file to an ICAP service over TCP, for example c-icap with ClamAV. The scan applies to the following actions:
Users change their profile on the Your profile page.
Users create an account on the Create an account page.
If the ICAP service finds malware, the End User Self Service rejects the file and doesn’t save the changes. The user sees the message Upload rejected: malware was detected in the file.
If the ICAP service isn’t available or can’t scan the file, the End User Self Service also rejects the file. The user sees the message Upload failed: Malware scan not currently possible. Please try again later or contact an administrator.
In the default configuration of Nubus for Kubernetes, the malware scan is inactive.
6.17.1. Requirements#
You need an ICAP service that the UMC Server pod can reach over the network. Nubus for Kubernetes doesn’t include an ICAP service.
The URL must point to the malware scan service of the ICAP server. If you configure the wrong ICAP service, or a scanner that skips some files, uploads are accepted without a scan, and produce no error.
Some ICAP services only scan specific file types.
For c-icap, make sure that the setting virus_scan.ScanFileTypes
includes the file types that users can upload,
for example JPEG and PNG for profile pictures.
6.17.2. Configure the malware scan#
To activate the malware scan, use the following steps:
Add the lines in Listing 6.47 to your
custom_values.yamlvalues file. Replace the URL with the URL of your ICAP service.Malware scan settings
urlDefines the URL of the ICAP service, for example
icap://clamav:1344/avscan. Use the schemeicaps://for a connection with TLS. If the URL doesn’t include a port, the End User Self Service uses the port1344.If the value is empty, the End User Self Service doesn’t scan uploaded files.
The value supports Helm templates.
Default value: empty
timeoutDefines the time in seconds that the End User Self Service waits for the ICAP service to scan all uploaded files of one request.
Default value:
30maxFilesDefines the maximum number of files that a user can upload in one request when the malware scan is active. All upload attributes of the request count together. The End User Self Service rejects a request with more files before it scans or saves any file. The value
0allows no files.Default value:
10
nubusUmcServer: selfService: malwareScan: maxFiles: 10 icap: url: "icap://clamav:1344/avscan" timeout: 30
Optional: If the ICAP service uses TLS with a certificate from your own certificate authority, add the CA certificate as described in Use TLS with your own certificate authority.
To activate the changes, you need to apply the configuration as described in Apply configuration. Kubernetes automatically restarts the UMC Server pod with the updated configuration.