qualys-scanner

by devops-bar

Helm chartv3.0.1App 5.2.0-3Verified publisher

Harbor scanner adapter for QScanner

About this chart

Qualys Harbor Adapter Service

Qualys Harbor Adapter Service It is a pluggable scanner service for Harbor registry where we can scan images pushed to registry also have scans scheduled for all the images.

The installation will deploy the Qualys Harbor Adapter Service on each worker node as a statefulset. By default, it assumes containerd as the default runtimes on Kubernetes cluster.

Prerequisites

Kubernetes & Helm

  • Kubernetes 1.17+
  • Helm v3.x.x

Get Repository Info

  • helm repo add qualys-helm-chart https://qualys.github.io/Qualys-Helm-Charts/
  • helm repo update

Installing the Chart

Create a values file containing the required environment-specific configuration. Authentication must be supplied either through qualysPlatformAuth.existingSecret or through one supported inline authentication mechanism.

Install the chart:

helm install qualys-harbor-demo qualys-helm-chart/qualys-scanner \
  --values values.yaml

The chart uses the QScanner image configured by image; no separate installation command is required for different container runtimes.

Upgrading the Release

Use the following command to upgrade the chart:

helm upgrade [RELEASE] [CHART] [flags]

Where,

[RELEASE] is the release name.

[CHART] is the chart path.

e.g.

helm upgrade qualys-harbor-demo qualys-helm-chart/qualys-scanner

Uninstalling the Chart

Use the following command to uninstall the chart:

helm uninstall RELEASE_NAME [...] [flags]

e.g.

helm uninstall qualys-harbor-demo

Persistent Cache requirement

With caching enabled we can increase scan job performance. [Note: first scan may take longer time but subsequent scans will be faster]. To support this we have enabled local as well as persistent cache.

cache-dir : location of cache mounted within pod.

local cache :- This cache will not be persisted incase of pods restart or redeployment. By default it is enabled and will be used as default location </opt/qualys/.cache/qualys/qscanner>. For other location can be set through cache-dir flag.

persistent cache :- This cache will be persisted accross redeployments or if pods restart. This will create persistent volume claim for all the replicas hence for this storage class should already be created with certain provisioning. If storage class is manual then we need persistent volume created for every replica of scanner-pod.

Sample persistent volume yaml
{{- if .Values.persistence.enable }}
apiVersion: v1
kind: PersistentVolume
metadata:
  name: qscanner-cache0
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: {{ .Values.persistence.size }}
  accessModes: [ "ReadWriteMany" ]
  hostPath:
    path: {{ index .Values.scannerArgs "cache-dir" }}
{{- end }}
Sample storage class yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: manual
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer

Configuration

Configurable parameters

The following tables list the chart parameters and their defaults. Values containing credentials, private keys, or certificate data are intended only for development; use existingSecret references in production.

Restart behavior: /usr/share/qscanner/values.yaml is mounted with subPath, so changes to ordinary configuration values require a pod restart. Projected Secret files are updated by Kubernetes, but whether QScanner reloads them without a restart depends on application behavior.

General and persistence

ParameterDescriptionDefault
nameOverrideOverrides the chart name used by generated resources.""
fullnameOverrideOverrides the full workload and service name. Ensure the service TLS certificate contains this DNS name."qualys-scanner"
helmInstallationPathLegacy installation-path setting; it is currently not consumed by any chart template.""
imageQScanner container image. The {version} placeholder is replaced during chart packaging."qualys/qscanner:{version}"
persistence.enableEnables a persistent cache volume.true
persistence.storageClassStorageClass used by the cache PVC.""
persistence.accessModePVC access modes.["ReadWriteMany"]
persistence.sizeRequested cache volume size.3Gi

Important: When persistence is enabled, set scannerArgs.cache-dir to a valid in-container path.

Redis and service

ParameterDescriptionDefault
redis.urlRedis connection URL used to store scan-job state."redis://harbor-redis:6379/"
redis.maxActiveConnectionsMaximum number of active Redis connections.5
redis.maxIdleConnectionsMaximum number of idle Redis connections.5
service.replicaCountNumber of scanner service replicas.1
service.logLevelScanner service log level."debug"
service.portPort on which the scanner service accepts requests.5000
service.workerThreadsNumber of workers processing scan jobs.2
service.scanJobTTLHourRetention period, in hours, for scan jobs and reports.1
service.maxTimeoutMaximum duration for Redis and API network requests.1m

Qualys Platform authentication

ParameterDescriptionDefault
qualysPlatformAuth.existingSecretExisting Secret containing either client-id and client-secret, or access-token. When set, no chart-managed authentication Secret is created.""
scannerArgs.client-idInline OAuth client ID. Must be provided with client-secret; intended for development only.""
scannerArgs.client-secretInline OAuth client secret. Must be provided with client-id; intended for development only.""
scannerArgs.access-tokenInline JWT access token; intended for development only. Do not combine it with inline OAuth credentials.""

OAuth is inferred when both inline client credentials are set. Access-token authentication is inferred when only scannerArgs.access-token is set.

TLS and CA certificates

ParameterDescriptionDefault
serviceTls.existingSecretExisting Secret containing the service TLS certificate and private key. Recommended for production.""
serviceTls.certKeyCertificate key in an existing service TLS Secret."tls.crt"
serviceTls.keyKeyPrivate-key key in an existing service TLS Secret."tls.key"
serviceTls.certInline service certificate as raw PEM; intended for development only.""
serviceTls.keyInline service private key as raw PEM; intended for development only.""
qualysPlatformCaCert.existingSecretExisting Secret containing the Qualys Platform CA certificate.""
qualysPlatformCaCert.certKeyCA certificate key in the existing Qualys Platform Secret."server-cert.crt"
qualysPlatformCaCert.certInline Qualys Platform CA certificate as raw PEM; intended for development only.""
registryCaCert.existingSecretExisting Secret containing the remote registry CA certificate.""
registryCaCert.certKeyCA certificate key in the existing registry Secret."registry-cert.crt"
registryCaCert.certInline registry CA certificate as raw PEM; intended for development only.""

Scanner arguments

ParameterDescriptionDefault
scannerArgs.log-levelLog level used for individual scan jobs.debug
scannerArgs.podQualys Platform identifier, such as US1, EU1, or IN1.""
scannerArgs.gateway-urlExplicit Qualys Platform gateway URL; use when the platform is not represented by pod.""
scannerArgs.registry-skip-verify-tlsDisables TLS verification for the remote registry. Use only for controlled testing.false
scannerArgs.skip-verify-tlsDisables TLS verification for the Qualys Platform. Use only for controlled testing.false
scannerArgs.qualys-tagsComma-separated asset tags. A tag beginning with qca_scan enables continuous assessment.""
scannerArgs.proxyProxy URL. When empty, QScanner may use proxy environment variables.""
scannerArgs.offline-scanDisables external API requests used to identify Java dependencies.false
scannerArgs.scan-timeoutMaximum duration of a scan job.5m0s
scannerArgs.max-network-retriesMaximum number of backend polling retries.10
scannerArgs.network-retry-wait-minMinimum wait between backend polling retries.5s
scannerArgs.cacheCache mode."local"
scannerArgs.cache-dirQScanner cache directory. Must be set when persistence is enabled.""
scannerArgs.cache-cleanup-duration-thresholdAge threshold after which cached entries become eligible for cleanup.4320h0m0s
scannerArgs.cache-cleanup-frequencyInterval between cache-cleanup attempts.720h0m0s
scannerArgs.enable-cache-cleanupEnables cleanup of old cache entries.true

Resources and scheduling

ParameterDescriptionDefault
resources.limits.cpuContainer CPU limit.1000m
resources.limits.memoryContainer memory limit.2048Mi
resources.requests.cpuContainer CPU request.800m
resources.requests.memoryContainer memory request.256Mi
tolerationsPod tolerations.Not set
nodeSelectorPod node selector.Not set
affinityPod affinity and anti-affinity configuration.Not set

Using an existing Kubernetes Secret for credentials

For production deployments it is recommended to create the Qualys Platform credentials Secret outside of Helm rather than passing them through values.yaml. The chart will then reference that Secret by name.

  1. Create a Secret containing either the canonical OAuth keys (client-id and client-secret) or the canonical access-token key (access-token).

OAuth example:

apiVersion: v1
kind: Secret
metadata:
  name: my-qualys-platform-credentials
type: Opaque
stringData:
  client-id: "<your-client-id>"
  client-secret: "<your-client-secret>"

Access-token example:

apiVersion: v1
kind: Secret
metadata:
  name: my-qualys-platform-token
type: Opaque
stringData:
  access-token: "<your-access-token>"
  1. Install or upgrade the chart referencing either Secret:
helm install qualys-harbor-demo qualys-helm-chart/qualys-scanner \
  --set qualysPlatformAuth.existingSecret=my-qualys-platform-credentials

When qualysPlatformAuth.existingSecret is set, the chart mounts its canonical credential files. For inline values, the chart infers OAuth from client-id plus client-secret, or access-token authentication from access-token. Inline OAuth credentials create <release>-credentials; an inline access token creates <release>-access-token.

The selected credentials are mounted under /run/secrets/qualys/qscanner/:

# oauth
/run/secrets/qualys/qscanner/client-id
/run/secrets/qualys/qscanner/client-secret

# accessToken
/run/secrets/qualys/qscanner/access-token

Using existing Kubernetes Secrets for TLS and CA certificates

For production deployments, store certificate material outside Helm and reference pre-created Kubernetes Secrets. This keeps certificates and private keys out of values.yaml and Helm release values.

Optional and independent: Service TLS, the Qualys Platform CA, and the registry CA are independently optional. Configure only the certificate Secrets required by your deployment.

Development: You can instead provide raw PEM through serviceTls.cert, serviceTls.key, qualysPlatformCaCert.cert, and registryCaCert.cert. The chart then creates release-scoped Secrets automatically.

1. Service TLS certificate and private key

Create a standard kubernetes.io/tls Secret:

kubectl create secret tls my-qscanner-tls \
  --cert=path/to/tls.crt \
  --key=path/to/tls.key

The default source keys are tls.crt and tls.key. For an externally managed Secret with different key names, configure serviceTls.certKey and serviceTls.keyKey.

2. Qualys Platform CA certificate

apiVersion: v1
kind: Secret
metadata:
  name: my-qualys-platform-ca
type: Opaque
stringData:
  server-cert.crt: |-
    -----BEGIN CERTIFICATE-----
    <qualys-platform-ca-certificate>
    -----END CERTIFICATE-----

If the Secret uses a different source key, set qualysPlatformCaCert.certKey.

3. Remote registry CA certificate

apiVersion: v1
kind: Secret
metadata:
  name: my-registry-ca
type: Opaque
stringData:
  registry-cert.crt: |-
    -----BEGIN CERTIFICATE-----
    <registry-ca-certificate>
    -----END CERTIFICATE-----

If the Secret uses a different source key, set registryCaCert.certKey.

4. Reference the Secrets

Add the Secret names to your values.yaml file:

serviceTls:
  existingSecret: my-qscanner-tls

qualysPlatformCaCert:
  existingSecret: my-qualys-platform-ca

registryCaCert:
  existingSecret: my-registry-ca

Then install or upgrade the chart with that file and the required authentication configuration:

helm upgrade --install qualys-harbor-demo qualys-helm-chart/qualys-scanner \
  --values production-values.yaml

When existingSecret is configured, the chart references that Secret instead of creating the corresponding certificate Secret.

Generated Secret names

When raw PEM is provided inline for development, the chart creates these release-scoped Secrets:

PurposeGenerated Secret name
Service TLS<release>-tls
Qualys Platform CA<release>-qualys-platform-ca
Registry CA<release>-registry-ca

Runtime certificate paths

All certif

Deploy qualys-scanner with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has qualys-scanner 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 chartqualys-scanner is pinned at v3.0.1 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