clamav-rest

by Community Artifacts

Helm chartv0.1.0App latestApache-2.0Verified publisher

Production-oriented Helm chart for a REST-fronted ClamAV antivirus scanning service. Independent distribution maintained by the community-artifacts organisation. Ships additive operational knobs (TLS, freshclam config, HPA/PDB, NetworkPolicy + CiliumNetworkPolicy, ServiceMonitor, persistence for the signature database, proxy support for freshclam, ExternalSecret-based image pull credentials).

About this chart

clamav-rest

Production-oriented Helm chart for a REST-fronted ClamAV antivirus scanner. The chart is opinionated about defaults that matter in real clusters (RollingUpdate with maxUnavailable=0, config-checksum pod restarts, secret-backed proxy passwords, FQDN-locked egress when Cilium is in play) and stays additive on the rest.

TL;DR

helm repo add clamav-rest https://community-artifacts.github.io/clamav-rest-helm
helm repo update
helm install av clamav-rest/clamav-rest

Or as a dependency from a sibling chart:

# Chart.yaml of the consuming chart
dependencies:
  - name: clamav-rest
    version: 0.1.0
    repository: "https://community-artifacts.github.io/clamav-rest-helm"
    alias: clamav

Features

ConcernStatusKnob
HTTP scan API on :9000✅ defaultconfig.port
HTTPS scan API on :9443opt-intls.enabled, tls.{cert,key} or tls.existingSecret
Prometheus /metrics✅ exposed by the imagemetrics.serviceMonitor.enabled for the ServiceMonitor
Signature DB persistenceopt-inpersistence.enabled (PVC at /clamav/data)
freshclam.conf overlayopt-infreshclamConfig.enabled + .config or .existingConfigMap
Forward proxy for freshclamopt-inproxy.* (password via Secret)
HPA (CPU + memory)opt-inautoscaling.enabled
PDBopt-inpodDisruptionBudget.enabled
Vanilla NetworkPolicyopt-innetworkPolicy.enabled + .vanilla
CiliumNetworkPolicy (DNS + FQDN egress)opt-innetworkPolicy.enabled + .cilium
ESO-backed image-pull credentialopt-inimageRepositoryCredential.create
Arbitrary extra manifestsopt-inextraManifests

Endpoints

The chart exposes the image's REST surface on the http (and optionally https) port. Documented endpoints:

PathMethodPurpose
/GETProcess stats — used as the default probe target
/versionGETClamAV binary + signature DB versions
/metricsGETPrometheus metrics
/v2/scanPOSTScan multipart files (current API)
/scanFileGETScan a single file by path
/scanPathGETScan a directory recursively
/scanHandlerBodyPOSTScan an arbitrary request body
/scanPOSTDeprecated; use /v2/scan

Probes & cold-start

The image has no dedicated /healthz. The chart probes /, which only returns 200 once clamd has loaded the signature database. On a cold pod (no PVC, no warm cache) that takes 30–120 s depending on the freshclam mirror. Two operational levers:

  1. Enable persistence.enabled=true to reuse the signature DB across restarts.
  2. Enable startupProbe.enabled=true to decouple cold-start tolerance from livenessProbe.

Production recommendations

  • Pin the image. image.tag defaults to latest (matching appVersion). Switch to a versioned tag or sha256:… digest before going to production. The helper accepts a sha256: prefix and emits repository@sha256:….
  • Never inline proxy passwords. Use proxy.existingSecret and reference an out-of-band Secret. Inline proxy.password ends up in the rendered manifests, the Helm release history, and the GitOps diff.
  • Set a PDB once you scale past 1. RollingUpdate handles voluntary disruption fine; PDB protects against node drains.
  • Wire a NetworkPolicy. Default-deny is the only correct stance for an in-cluster scanner; turn on networkPolicy.enabled and let the chart open just the freshclam egress + the scrape ingress.
  • Tune resources.limits.memory to your largest expected file. clamd materialises the signature DB in memory (~1.5 GiB) and adds per-scan overhead — under-provisioning shows up as OOMKilled mid-scan.

Values reference

Run helm show values . for the canonical, comment-annotated source. Highlights:

replicaCount: 2

image:
  repository: ajilaag/clamav-rest
  tag: ""              # defaults to .Chart.AppVersion (`latest`) — pin in prod

config:
  port: 9000
  sslPort: 9443
  maxFileSize: "25M"
  signatureChecks: 2
  timezone: "Europe/Zurich"

tls:
  enabled: false       # set true + existingSecret (or cert/key) for HTTPS

persistence:
  enabled: false       # PVC at /clamav/data — keep the signature DB warm

autoscaling:
  enabled: false
  minReplicas: 2
  maxReplicas: 10
  targetCPUUtilizationPercentage: 80

metrics:
  serviceMonitor:
    enabled: false     # requires the Prometheus Operator

networkPolicy:
  enabled: false
  vanilla: true
  cilium: false        # also render a CiliumNetworkPolicy

podDisruptionBudget:
  enabled: false
  minAvailable: 1

License

Apache-2.0. See LICENSE.

Deploy clamav-rest with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has clamav-rest on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartclamav-rest is pinned at v0.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply