Anti-Virus Scanning ΒΆ

What is ClamAV ΒΆ

ClamAV is an open source antivirus engine for detecting trojans, viruses, malware and other malicious threats. It is used in a variety of situations including file scanning, email scanning, web scanning and end point security.

Where is it available ΒΆ

This feature is installed on all nais clusters if the feature is enabled in the tenant. ClamAV has a REST API applications in the cluster can use for scanning files and urls.

There is a service set up so all applications will be able to talk to the REST api using either

The service can only be used from inside the cluster and the APIs support PUT with a request body or POST with form-data.

It can be tested using curl:

bash

Access Policy ΒΆ

When using ClamAV on GCP, remember to add an outbound access policy:

yaml

What is returned from the API ΒΆ

The response returns a JSON result that differs slightly based on which version of the API you're using:

Scan outcomeV1 /scanV2 /api/v2/scan
Clean file200, Result: "OK"200, result: "OK"
Virus detected200, Result: "FOUND"200, result: "FOUND", with virus name
Connection or scan error500, text error503, result: "ERROR", error: "Scan failure"
Daemon closes without answering200, Result: "OK" (legacy limitation)503, result: "ERROR", error: "Invalid response"

V2 applies a 90-second deadline per file scan; daemon read timeouts return 503 / Scan failure. If any file fails, the V2 response returns 503, while retaining individual file results. V1 has no daemon-read deadline.

See ClamAV documentation and ClamAV REST API for more information.

Examples ΒΆ

Code examples can be found here:

Support ΒΆ

If you have any questions about ClamAV please contact the Nais team on Slack, #nais.