Script icon
Docker icon
If icon
SlackIncomingWebhook icon
Log icon
Return icon
Schedule icon

Quay Container Registry Security Scan Queue Backlog Sentinel

Audits Project Quay security scan queues and Clair worker health to prevent unanalyzed container images and vulnerability detection delays.

Categories
CloudInfrastructure

Automates continuous vulnerability scanner pipeline monitoring for enterprise Project Quay container registries.

How it works

  1. A schedule trigger initiates the Quay security scan audit flow every 15 minutes.
  2. The Python script connects to the Quay internal Prometheus metrics endpoint on port 9091.
  3. The task inspects Clair manifest scanning queue depth, completed scan counters, and indexing errors.
  4. An evaluation gate determines whether pending image manifest queues or failure ratios breach defined thresholds.
  5. When scanner backlog breaches are detected, an incident notification is posted to SecOps Slack channels.
  6. When container scanning proceeds normally, nominal queue depths and worker states are logged.
  7. A structured JSON audit manifest is emitted for DevSecOps governance and vulnerability audit reporting.

Architecture diagram

graph TD
    Trigger[Schedule Trigger: 15m] --> ScanMetrics[Python Script: Scrape Quay Metrics]
    ScanMetrics --> EvalBreach{Queue Depth > Threshold OR Clair Offline?}
    EvalBreach -- Yes --> SlackAlert[Slack: High-Urgency SecOps Alert]
    EvalBreach -- No --> LogNominal[Log: Nominal Quay State]
    SlackAlert --> EmitManifest[Debug Return: Registry Audit Manifest]
    LogNominal --> EmitManifest

Architecture components

  • Trigger: Automated schedule polling at 15-minute recurring intervals.
  • Script Task: Scrapes Project Quay Prometheus endpoints inside isolated Docker task runners.
  • Decision Gate: Compares current manifest scan queue depth and failure percentages against SLO thresholds.
  • Notification Task: Dispatches structured Slack messages detailing Clair worker backlogs and registry hostnames.
  • Audit Manifest: Emits JSON payloads recording scan queue sizes and compliance audit timestamps.

Key capabilities

  • Real-time detection of Clair vulnerability indexer bottlenecks before container images deploy unanalyzed.
  • Automatic calculation of manifest security scan failure rates across enterprise repository namespaces.
  • Immediate alerting when Clair gRPC communication channels disconnect or report database locking stalls.
  • Production-grade Docker task isolation preventing host runtime dependency conflicts.

What you get

  • Continuous surveillance of enterprise container image vulnerability ingestion pipelines.
  • Immediate Slack notifications alerting DevSecOps teams to scanning backlog buildups.
  • Standardized audit manifests containing exact scanner queue metrics and execution timestamps.
  • Configurable sensitivity thresholds accommodating small development registries and multi-tenant clusters.

Who it's for

  • DevSecOps engineers managing corporate container security and vulnerability compliance gating.
  • Platform reliability teams responsible for private container registry availability and performance.
  • Security operations analysts tracking image ingestion latencies and unindexed container CVEs.
  • Enterprise architects enforcing automated vulnerability scanning policies across cloud infrastructure.

Why orchestrate this with Kestra

  • Serverless Docker Isolation: Executes telemetry scraping in ephemeral Docker environments without persistent workers.
  • Centralized Secrets Governance: Protects sensitive Slack webhooks using encrypted namespace secrets.
  • Declarative YAML Workflows: Manages container security pipeline monitoring as versioned code in Git repositories.
  • Comprehensive Audit History: Preserves historical scan queue records in searchable Kestra execution logs.

Use cases

  • Release Gate Protection: Prevents pipeline deployment stalls caused by unindexed container image manifests.
  • Zero-Day Exposure Mitigation: Ensures Clair indexers stay synchronized with upstream CVE database updates.
  • Registry Capacity Management: Identifies image push bursts that overwhelm default Clair worker pool allocations.

Inputs

Name Type Default Description
quay_metrics_url STRING http://quay-registry.registry.svc.cluster.local:9091 Internal HTTP URL exposing Prometheus metrics for Project Quay.
registry_endpoint STRING quay.infra.corp.net Hostname of the target Project Quay container registry instance.
max_security_scan_queue_threshold INT 200 Maximum allowable manifest scan backlog before raising an alert.
max_scan_failure_rate_threshold FLOAT 5.0 Maximum acceptable Clair scan failure percentage.
alert_on_indexer_offline BOOL true Toggle whether Clair indexer communication failure triggers an alert.

Expected outputs

  • {{ outputs.scan_quay_registry_telemetry.vars.queue_depth }}: Current depth of unanalyzed image manifest queue.
  • {{ outputs.scan_quay_registry_telemetry.vars.failure_rate_percent }}: Calculated vulnerability indexing failure percentage.
  • {{ outputs.scan_quay_registry_telemetry.vars.indexer_connected_flag }}: Health status indicator of Clair security indexer.
  • {{ outputs.scan_quay_registry_telemetry.vars.is_alerting }}: Boolean flag indicating if scan queue SLA is breached.
  • {{ outputs.scan_quay_registry_telemetry.vars.audit_timestamp }}: ISO-8601 UTC timestamp of the registry audit run.

Prerequisites

  • Project Quay 3.7+ deployed with Clair vulnerability scanning enabled.
  • Network connectivity from the Kestra worker to the Quay metrics port (default 9091).
  • Configured Slack incoming webhook URL with permissions to post in SecOps channels.

Secrets

  • SLACK_WEBHOOK_URL: Secure webhook URL for routing container registry alerts to the SecOps Slack channel.

Quick start

  1. Verify that Quay registry exposes Prometheus metrics on HTTP port 9091.
  2. Add the SLACK_WEBHOOK_URL secret within your Kestra namespace settings.
  3. Update registry_endpoint to match your enterprise Quay domain name.
  4. Run a manual flow execution via the Kestra UI to validate Clair metric ingestion.
  5. Enable the periodic_quay_audit schedule trigger to establish automated monitoring.

Common pitfalls and troubleshooting

  • Clair Database Lock: High queue depth often stems from Clair PostgreSQL connection pool exhaustion during CVE updates.
  • Network Firewalls: Verify that Kestra runner containers can resolve and reach internal Quay Kubernetes service names.
  • TLS Certificate Validation: When scraping HTTPS endpoints with private CA certificates, configure appropriate CA bundles.
  • Ephemeral Worker Restarts: Intermittent queue spikes may occur during rolling updates of Clair indexer worker pods.

How to extend

  • Auto-Scaling Clair Workers: Trigger Kubernetes HPA scaling commands when the scan queue depth exceeds 500 manifests.
  • PagerDuty Escalation: Route high-priority pages to on-call security engineers if Clair remains offline for 30 minutes.
  • CVE Digest Extraction: Fetch top detected critical vulnerabilities from the Quay REST API during security alert triggers.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.