#3916·kubescape

Add Red Hat Quay (quay.io) Container Image Vulnerability Adaptor

Author: Nachiket-RoyCreated Sep 23, 2026Updated Sep 23, 2026
Labelsfeature

Overview

pkg/imagescan/ implements the IContainerImageVulnerabilityAdaptor interface to pull vulnerability scan results directly from container registries' native security APIs. It currently supports AWS ECR, Azure ACR, GCP Artifact Registry, GitLab, and Harbor, as documented in docs/proposals/container-image-vulnerability-adaptor.md. Red Hat Quay (quay.io and self-hosted Quay 3.x) is not currently supported.

Problem

Users running images on Quay (public quay.io or a self-hosted enterprise instance) have no way to get native, registry-side vulnerability data through Kubescape's adaptor layer. Quay ships its own Clair-based security scanning and exposes results via a documented REST API, but without an adaptor Kubescape can't query it — so Quay users either fall back to a generic/slower scan path or get no registry-native vulnerability data at all, unlike users on ECR, ACR, Artifact Registry, GitLab, or Harbor.

Solution

Implement a QuayAdaptor in pkg/imagescan/ following the existing adaptor pattern:

  • Authentication: support both OAuth2/Bearer tokens and Quay Robot Accounts (Basic auth, org+robotname / token) via the existing RegistryCredentials type.
  • Registry support: both public quay.io and self-hosted Quay installations, with host normalization for custom ports/HTTP in Login().
  • Core API calls:
    • GET /api/v1/discovery for connectivity/reachability checks during Login().
    • GET /api/v1/repository/{repo}/manifest/{manifestref}/security?vulnerabilities=true for scan status and vulnerability data.
  • Data mapping: parse Quay's Clair-based vulnerability payload (severities: Defcon1, Critical, High, Medium, Low, Negligible, Unknown) into Kubescape's canonical vulnerability format, with CVE deduplication across image layers/features.
  • Resilience: handle HTTP 429 with Retry-After-aware backoff, cap response size, and handle 401/403/404 cleanly.
  • Full table-driven test suite (quay_adaptor_test.go) with a mock HTTP server covering auth methods, all documented status states, rate limiting, oversized responses, and concurrent access (-race).
  • Provider documentation (docs/providers/quay.md) and an update to the existing adaptor proposal doc listing Quay as supported.

Alternatives

  • GHCR / GitHub Advisory adaptor instead of Quay — same architectural slot, different registry; could be built instead of or alongside this if GHCR is a higher priority for maintainers.
  • Generic/manual vulnerability import — users could pipe Quay scan results in through an external step rather than a native adaptor, but this loses the automatic, consistent handling (retry, pagination, severity normalization) that adaptors provide and doesn't fit the existing plugin architecture.
  • Rely on a third-party scanner (Trivy/Grype) instead of Quay's native scan — viable but discards Quay's own scan data and doubles scan work for users already paying for Quay's built-in scanning.

Additional context

  • Quay's security API reference: docs/providers/quay.md (to be added) will document robot-account setup and example commands.
  • Legacy image-ID-based security endpoint (/api/v1/repository/{repo}/image/{image_id}/security) is not in Quay's current published API surface — needs verification against a real self-hosted Quay 3.x instance before deciding whether to support it as a fallback for older installs, or drop it from v1 scope.
  • Related: existing adaptors in pkg/imagescan/ (ecr_adaptor.go, acr_adaptor.go, gitlab_adaptor.go, harbor_adaptor.go) as reference implementations.