Skip to content
Clair

Clair

License: Free (Open-Source, Apache 2.0)
Suphi Cankurt
Suphi Cankurt
+8 Years in AppSec
Updated February 25, 2026
5 min read
Key Takeaways
  • Clair indexes container images and matches them against vulnerability databases covering 9+ Linux distributions including Ubuntu, Debian, RHEL, Alpine, SUSE, Oracle, AWS Linux, and Photon.
  • Powers the vulnerability scanning backend for Red Hat Quay and Quay.io container registries, with 11k GitHub stars and 117 contributors.
  • Continuously ingests security data from NVD and distribution-specific sources, so vulnerability reports always reflect the latest known threats.
  • Written in Go with a modular updater/matcher architecture in the ClairCore library, supporting OCI and Docker image formats.

Clair is an open-source static analysis tool for finding vulnerabilities in container images.

Developed by Red Hat (originally CoreOS), Clair parses OCI and Docker image layers and matches discovered packages against vulnerability databases covering 9+ Linux distributions.

Red Hat Quay and Quay.io container registries use Clair as their scanning backend. 11k GitHub stars, 117 contributors.

Clair vulnerability scan results in Quay Security Scanner showing 146 detected vulnerabilities with 82 patchable for an Ubuntu container image, listing CVE IDs with High, Medium, Low, and Negligible severity and available fixed versions

How does Clair scan container images?

Clair scans container images through a three-part pipeline: indexing, matching, and notifications. This architecture separates image analysis from vulnerability correlation, allowing Clair to re-evaluate previously scanned images against newly discovered CVEs without re-indexing.

During indexing, Clair fetches container image layers, examines their contents, and identifies installed packages, language runtimes, and distributions. The output is an IndexReport.

Because OCI uses content-addressed layers, Clair skips any layer it has already indexed.

During matching, Clair checks indexed packages against vulnerability databases that update continuously in the background. Every match request returns results based on the latest security data.

Distribution-specific updaters paired with matchers determine how vulnerabilities relate to specific packages.

The notification service watches for newly discovered vulnerabilities that affect previously indexed manifests and fires alerts through configured webhooks.

What vulnerability databases does Clair use?

Clair pulls vulnerability data from 9+ distribution-specific sources plus the NVD for severity enrichment:

SourceData Type
Alpine SecDBAlpine Linux advisories
Debian OVALDebian security advisories
Ubuntu OVALUbuntu security advisories
RHEL OVALRed Hat Enterprise Linux advisories
Oracle OVALOracle Linux advisories
SUSE OVALSUSE Linux advisories
AWS LinuxAmazon Linux advisories
VMware PhotonPhoton OS advisories
NVDCVSS severity enrichment

Each updater polls its source periodically โ€” typically hourly โ€” so vulnerability reports stay current without manual intervention. Clair v4 also added support for language-ecosystem advisories (Python, Java, JavaScript, Go) through the Pyup.io and GitHub Advisory Database feeds, which extends matching beyond OS packages into application dependencies bundled in the image.

If an Alpine package vulnerability does not yet have CVSS data in NVD, Clair surfaces it as “Unknown” severity until enrichment catches up. This is a known quirk of Alpine SecDB rather than a Clair limitation, and it shows up most often on the day a fresh CVE drops.

Architecture

Clair v4 wraps the ClairCore library, which handles distribution detection, vulnerability source integration, and layer indexing. ClairCore can be used on its own for custom scanning implementations; Clair adds the HTTP API and orchestration on top.

Written in Go, Clair exposes a REST API for submitting manifests and retrieving vulnerability reports. It stores state in PostgreSQL and can run as a single combined process or as separate indexer, matcher, and notifier services for scale.

Clair v4 is structured as four cooperating microservices: an indexer that fetches and parses image layers, a matcher that compares indexed packages against vulnerability data, a notifier that fires webhooks when previously scanned manifests gain new CVE matches, and a frontend that exposes the REST/gRPC API. All four can run combined in a single process for small deployments or split across nodes for scale.

If you are reading older tutorials, note that Clair v2 (the original architecture) is deprecated. v2 used a different push model and PostgreSQL schema, and most third-party blog posts still reference it. The current API surface is v4 and the migration path between them is one-way โ€” there is no in-place upgrade. If you inherit a v2 deployment, plan for a clean v4 install backed by a fresh PostgreSQL database.

Registry Integration
Clair is designed to work as a scanning service integrated with container registries rather than as a standalone CLI tool. It is the default scanner for Red Hat Quay and Quay.io. For standalone CLI-based scanning, consider Trivy or Grype .

How do you deploy Clair in production?

Production deployments fall into two patterns. The Helm chart in quay/clair-charts is the path of least resistance for Kubernetes โ€” it provisions the indexer, matcher, notifier, frontend, and a PostgreSQL StatefulSet in one manifest. For non-Kubernetes infrastructure, the official docker-compose.yaml runs the same components on a single host.

Database sizing depends on how many distinct image manifests you index. A typical production cluster scanning 1,000-5,000 images per day stabilizes at 50-100 GB of PostgreSQL state; large registries (50,000+ images) can hit 500 GB or more once the vulnerability matrix is fully populated.

Registry integration is native for Red Hat Quay and Quay.io โ€” Clair receives push webhooks automatically. For other registries (Harbor, JFrog Artifactory, ECR), you wire scanning either through the registry’s own webhook plugin or via a polling job that calls the Clair REST API on each new image push. The matcher API supports mTLS for inter-service authentication, which matters in zero-trust K8s environments.

When should you use Clair?

Clair is best suited for organizations that need server-side vulnerability scanning integrated with their container registry workflow.

It is the right choice if you already run Red Hat Quay or Quay.io, or if you are building custom registry infrastructure that needs an API-driven scanning backend.

The REST API design works well for automated pipelines that scan images on push.

Limitations: Clair only does container image scanning. It does not support filesystem, IaC, or source code scanning.

Alpine SecDB does not include severity information, so Alpine-based image vulnerabilities show as “Unknown” severity until NVD enrichment adds CVSS data.

Clair requires PostgreSQL and is operationally heavier than CLI-based scanners like Trivy or Grype .

How does Clair compare to Trivy, Grype, and Anchore?

Clair, Trivy , Grype , and Anchore are the four open-source container vulnerability scanners that come up in nearly every shortlist. They look interchangeable from a feature checklist, but the operational stories are very different.

Trivy is the most popular today (34k+ GitHub stars). It ships as a single binary with a CLI-first workflow, scans container images, filesystems, IaC, code, and Kubernetes clusters, and generates SBOMs. Trivy is the default pick for solo developers and CI pipelines that just want one command.

Grype , backed by Anchore, is SBOM-first by design and pairs naturally with Syft for image inventorying. It runs as a CLI like Trivy but emphasizes the SBOM-driven workflow โ€” generate an SBOM once, re-evaluate it against new CVE data without re-scanning.

Anchore (the Engine and Enterprise products) takes a policy-first stance. It is built for compliance teams that need codified rules around what is allowed in production, with attestation, allowlist, and gating workflows out of the box.

Clair is the registry-integrated option. It runs as a service rather than a CLI, exposes a REST API, and is the deepest fit when you operate Red Hat Quay or build registry infrastructure that scans images on push. The trade-off is operational weight: PostgreSQL, microservices, no built-in CLI. For ad-hoc scans, third-party wrappers like arminc/clair-scanner exist, but they are community projects rather than first-party tooling.

For a broader view of container security options, see the container security tools category page.

Frequently Asked Questions

What is Clair?
Clair is an open-source tool for the static analysis of vulnerabilities in container images. It parses image contents layer by layer and reports known vulnerabilities by matching discovered packages against security databases from 9+ Linux distributions and the National Vulnerability Database (NVD). Clair is developed by Red Hat and powers vulnerability scanning in Quay.io.
How does Clair scan container images?
Clair uses a two-step process: indexing and matching. During indexing, Clair fetches container image layers, examines their contents, and generates an IndexReport listing discovered packages. During matching, it correlates those packages against continuously updated vulnerability databases to produce a VulnerabilityReport with affected CVEs and severity scores.
Which vulnerability databases does Clair use?
Clair pulls vulnerability data from distribution-specific sources including Alpine SecDB, Debian OVAL, Ubuntu OVAL, RHEL OVAL, Oracle OVAL, SUSE OVAL, AWS Linux, and VMware Photon advisories. It enriches this data with CVSS scores from the National Vulnerability Database (NVD) for standardized severity ratings.
Is Clair free to use?
Yes, Clair is fully open-source under the Apache 2.0 license and free for commercial use. It has 11k GitHub stars and 117 contributors. Red Hat Quay includes Clair as its integrated vulnerability scanner, and Clair can also be deployed standalone with any OCI-compliant container registry.
How does Clair compare to Trivy?
Clair is designed as a service that integrates with container registries, particularly Quay.io, and focuses on server-side image scanning through its REST API. Trivy is a CLI-first scanner that runs locally and covers a broader scope including filesystems, Git repositories, and IaC configurations. Clair is best suited for registry-integrated scanning workflows, while Trivy is more versatile as a standalone tool.