Skip to main content

ClamAV (clamav)

Antivirus engine (clamd) of the file security pipeline, with signature updates from the internal mirror only and an authenticated HTTPS gateway in front of clamd.

Generated from catalog/services/clamav.yaml: do not edit by hand.

Summary​

Version1.4.6
Useinstall and configure
Layerfunctional (AI catalog)
CategorySecurity and policies
Installation methodspodman
External connectionno
Sandbox onlyno

Licence​

SPDX identifierGPL-2.0-only
Licence policylicence exception
Licence exceptionLEX-022 (pending, awaiting the client)
Platform componentclamav

Packages and artifacts​

A package the project of the service publishes (its image, its binary archive, its Python or OS package) carries the licence of the service; a third-party package carries the licence written on its row, read from the official upstream metadata.

KindPackageVersionLicenceDetails
container imagedocker.io/clamav/clamav1.4.6GPL-2.0-onlyimage key clamav, used by freshclam, clamd, digest sha256:8ad6197396974726c35d017e50aaaaf4b91745726a04faec8480c203edd98052
container imagedocker.io/library/python3.12.12-alpine3.22PSF-2.0image key gateway, used by gateway, digest sha256:848ba4413eb897e225159b8fc1b02094576cbae4aa73fc13142608ae2c8c0e32

Images are pinned by tag in the descriptor, and by digest when the descriptor declares one (the offline bundle then refuses a pulled image that does not carry it); the digest is recorded in the mirror of the Manager when the offline bundle is imported, and every pull or load is checked against it.

Supported systems and architectures​

MethodOperating systemsArchitectures
podmanRHEL family (dnf), Debian family (apt), Arch Linux (pacman)x86_64, aarch64 (not restricted by the descriptor)

Certified host systems: RHEL 8/9/10, Rocky Linux 8/9/10, AlmaLinux 8/9/10, Oracle Linux 8/9, CentOS Stream 9/10, Ubuntu 22.04/24.04, Debian 12, Arch Linux (rolling). The host preflight accepts these systems (other releases of a known family give a warning, end of life releases are refused) and the x86_64 and aarch64 architectures.

Prerequisites​

Host​

  • at least 3072 MB of memory (blocking, memory).
  • at least 2048 MB free for /var/lib/navin (warning, disk).

Programs the commands and checks of the service start on the host, outside the managed roots: add them to allowed_commands of the agent (see Security of the Navin agent), else the agent refuses them with command_not_allowed: /usr/bin/podman.

Network and ports​

ComponentPort namePortOpened in the host firewall
clamdclamd3310/tcpno
gatewayapi3311/tcpyes

Services and connections needed​

This service has no dependency.

Installation methods and modes​

MethodDefaultWhat the method uses
podmanyesthe container images of the descriptor, run by Podman under systemd

Components​

ComponentKindInstallation methodsPorts
Signature updater (freshclam)workerpodman-
clamd daemon (clamd)masterpodman3310/tcp
Scan gateway (gateway)masterpodman3311/tcp
  • clamd runs only on a host that also runs freshclam.
  • gateway runs only on a host that also runs clamd.

Single scanner (standalone) (default)​

One scanner host (clamd, freshclam and the gateway).

What the mode deploys:

ComponentPlacement
freshclammin 1, max 1
clamdmin 1, max 1
gatewaymin 1, max 1

Replicated (replicated)​

Two or more independent scanner hosts; the platform fails over between every gateway.

What the mode deploys:

ComponentPlacement
freshclammin 2, recommended 2
clamdmin 2, recommended 2
gatewaymin 2, recommended 2

Install this service​

The install wizard of the Navin Manager plans, validates and runs the installation; you need the services:install permission on the cluster.

  1. Open the wizard. In Clusters, choose the row action Install services of the target cluster. The wizard opens on its first step, Service.

  2. Choose the service. On the Service step, select ClamAV. The card shows the licence GPL-2.0-only.

  3. Choose the hosts and the mode. On the Hosts step, tick the hosts, then choose the Mode: standalone (default), replicated. Each mode deploys the components listed in Installation methods and modes. With several components, place each one on its hosts in Component placement (Suggest placement proposes a placement that respects the cardinalities).

  4. Bindings. This service has no dependency: the Bindings step has nothing to bind.

  5. Configure. On the Configure step, review the parameters (see Configuration parameters); the required ones are mirror_url. Passwords left empty with a generated default are generated and sealed by the Manager.

  6. Review and install. On the Install step the Manager validates the plan and shows the installation order; when it says "The plan is valid. Ready to install.", choose Install. A highly available mode is installed only when its HA checks pass.

  7. Verify. The operation ends when the health checks of every instance pass (see Health checks); the service then shows as running in Services. Open the service and choose Run the smoke test in the Checks card: Sends the EICAR test file through the gateway (must be FOUND), then a clean file (must be OK).

High availability​

Clusterreplicas (replication)
High availabilityexternal (external)
Failoverclient side (client)
Replicationnone (none)
Quorumnone (none)
Discoverystatic (static)
Entry pointclient discovery (client-discovery)
Official documentationhttps://docs.clamav.net/
Referenceshttps://docs.clamav.net/manual/Usage/Scanning.html, https://docs.clamav.net/manual/Usage/Configuration.html, https://docs.clamav.net/appendix/CvdPrivateMirror.html
Peer TLS parametertls_enabled
Peer authenticationClients authenticate to every gateway with the Bearer key; clamd has no network peer.

Topology per mode​

ModesHighest catalog levelDistributionQuorum componentFault domainsDescription
standalonestandalone (standalone)single (single)-1One scanner host, no fault tolerance (uploads are refused in enforce mode while it is down).
replicatedha (ha)active-active (active-active)-2Two or more independent scanner hosts, each with clamd, freshclam and its gateway; the platform receives every gateway and fails over to the next one.

Notes​

  • Each host loads the full signature database in memory (about 3 GB with a reload): plan the memory of every scanner host.
  • Every host updates from the internal mirror on its own: the mirror must stay reachable, the last databases keep serving meanwhile and an offline import is always possible.

Configuration parameters​

Network​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
Gateway port (gateway_port)port3311-nonoyesHTTPS port of the scan gateway (/v1/scan, /readyz, /metrics), the only network entry point of the scanner host.
clamd loopback port (clamd_port)port3310-nonoyesTCP port of clamd, used by the gateway of the same host only: on 127.0.0.1, or in the isolated Podman container a port never published on the host and reached by the gateway container alone (never opened in the firewall). (advanced)

Security​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
TLS (tls_enabled)booltrue-nonoyesServe the gateway over HTTPS with a certificate of the manager CA (required in production).
API key (api_key)passwordgenerated-noyesnoBearer key of the gateway clients (EAI_CLAMAV_API_KEY of the platform).

Signatures​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
Internal signature mirror (mirror_url)url-^https://yesnonoHTTPS address of the internal ClamAV mirror serving main, daily and bytecode (freshclam PrivateMirror). No public update server is ever used.
Checks per day (checks_per_day)int12min 1, max 50nononoNumber of freshclam checks of the internal mirror per day.

Scan limits​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
Largest file (stream_max_length_mb)int100min 1, max 4000, MBnononoStreamMaxLength of clamd and body limit of the gateway (413 above); keep it at least the platform limit EAI_FILE_SCAN_MAX_BYTES.
Maximum scanned data (max_scan_size_mb)int400min 1, max 4000, MBnononoMaxScanSize: data scanned per file, archives included (beyond it Heuristics.Limits.Exceeded is reported).
Maximum inner file (max_file_size_mb)int100min 1, max 4000, MBnononoMaxFileSize: largest file scanned, inner archive members included.
Archive depth (max_recursion)int16min 1, max 64nononoMaxRecursion: nesting of archives and embedded objects.
Files per archive (max_files)int10000min 1, max 1000000nononoMaxFiles: files scanned inside one archive.
Scan timeout (scan_timeout_s)int120min 5, max 900, snononoLongest scan of one file (clamd MaxScanTime and ReadTimeout, gateway timeout towards clamd).
Scan threads (max_threads)int8min 1, max 64nononoMaxThreads of clamd: concurrent scans on the host. (recommended clamp(host.cpu_count, 2, 16))

Endpoints​

EndpointSchemeComponentPortPathTLS parameterBinding parametersBinding secretsProvisioning command
apihttpgateway3311 (gateway_port)-tls_enabledmax_file_size, max_scan_size, max_files, max_recursion, stream_max_lengthapi_key-

Commands​

CommandComponentTargetDescription
Signature status (signature_status)freshclamevery hostEngine version and every signature database of each scanner host, with its digital signature checked by sigtool.
Update the signatures (update_signatures)freshclamevery hostRuns freshclam now against the internal mirror on each scanner host; clamd reloads the new databases.
Import signatures offline (import_signatures)freshclamevery hostInstalls the .cvd and .cld databases of a directory of the host: each one is verified by sigtool first, then installed atomically and clamd reloads locally. Nothing is installed when one database fails.
clamd logs (logs)clamdchosen hostLast lines of the clamd journal.

Command parameters​

CommandParameterTypeDefaultRequiredDescription
import_signaturesDirectory (directory)path-yesAbsolute directory of the host holding main, daily and bytecode (.cvd or .cld).

Health checks​

Liveness (per instance)​

ComponentCheckDetails
freshclam{{ paths.etc }}/signatures.sh has-db90 retries; interval 10 s; timeout 10 s
clamd/usr/bin/podman exec navin-{{ service.name }}-clamd clamdscan --config-file=/etc/navin-clamav/clamd.conf --ping=160 retries; interval 5 s; timeout 10 s
gatewayHTTP {{ 'https' if config.tls_enabled else 'http' }}://{{ host.ip or '127.0.0.1' }}:{{ config.gateway_port }}/healthzExpected 200; 30 retries; interval 2 s; timeout 5 s

Readiness (service check)​

CheckDetails
HTTP {{ 'https' if config.tls_enabled else 'http' }}://{{ host.ip or '127.0.0.1' }}:{{ config.gateway_port }}/readyzExpected 200; Expected "status": "ready"; 10 retries; interval 5 s; timeout 10 s

Smoke test​

Sends the EICAR test file through the gateway (must be FOUND), then a clean file (must be OK). (gateway: eicar_found, clean_ok)

Preflight checks​

CheckTypeMeaningSeverityComponents
memorymemory_mb {"min": 3072}at least 3072 MB of memoryblockingclamd
diskdisk_free_mb {"path": "/var/lib/navin", "min": 2048}at least 2048 MB free for /var/lib/navinwarningfreshclam
gateway_port_freeport_free {"param": "gateway_port"}port 3311 free on the hostblockinggateway
clamd_port_freeport_free {"param": "clamd_port"}port 3310 free on the hostblockingclamd

Uninstall​

Paths removed when the data is purged: {{ paths.data }}, {{ paths.log }}.

  • Gateway metrics: {{ 'https' if config.tls_enabled else 'http' }}://{{ host.fqdn }}:{{ config.gateway_port }}/metrics

Upstream documentation​