qcs-sensor
by devops-bar
A Helm chart for Kubernetes
About this chart
Qualys Container Security Sensor
Qualys Container Security continuously secure containers from build to runtime.
The installation will deploy the Qualys Container Security Sensor on each worker node as a daemon set. By default, it assumes containerd and CRI-O as the default runtimes on Kubernetes cluster and OpenShift Cluster, respectively. If you are using a different container runtime, provide the appropriate value in the helm chart configuration.
Prerequisites
Know Your Runtime
Get the details about the container runtime by executing the following command:
kubectl get nodes -o wide
Kubernetes & Helm
- Kubernetes 1.17+
- Helm v3.10.x
Get Repository Info
- helm repo add qualys-helm-chart https://qualys.github.io/Qualys-Helm-Charts/
- helm repo update
RedHat OpenShift
- OpenShift v4.0+ (Default Container Engine is CRI-O)
Installing the Chart
Use the following command to install the chart:
helm install [NAME] [CHART] [flags]
- Install on Kubernetes cluster with containerd runtime (Default)
helm install qcs-sensor-demo qualys-helm-chart/qcs-sensor --namespace qualys --create-namespace --set qualys.customerID=${CUSTOMERID},qualys.activationID=${ACTIVATIONID},qualys.pod_url=${POD_URL}
- Install on Kubernetes cluster with cri-o runtime
helm install qcs-sensor-demo qualys-helm-chart/qcs-sensor --namespace qualys --create-namespace --set qualys.customerID=${CUSTOMERID},qualys.activationID=${ACTIVATIONID},qualys.pod_url=${POD_URL},crio.enabled=true
- Install on Kubernetes cluster with docker runtime
helm install qcs-sensor-demo qualys-helm-chart/qcs-sensor --namespace qualys --create-namespace --set qualys.customerID=${CUSTOMERID},qualys.activationID=${ACTIVATIONID},qualys.pod_url=${POD_URL},docker.enabled=true
- Install on OpenShift cluster with cri-o runtime (Default)
helm install qcs-sensor-demo qualys-helm-chart/qcs-sensor --namespace qualys --create-namespace --set qualys.customerID=${CUSTOMERID},qualys.activationID=${ACTIVATIONID},qualys.pod_url=${POD_URL},openshift=true,crio.enabled=true
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 qcs-sensor-demo qualys-helm-chart/qcs-sensor --namespace qualys
Uninstalling the Chart
Use the following command to uninstall the chart:
helm uninstall RELEASE_NAME [...] [flags]
e.g.
helm uninstall qcs-sensor-demo --namespace qualys
Configuration
Configurable Parameters
The following table lists the configurable parameters for the Qualys Container Security chart and their default values:
| Parameter | Description | Default | Notes |
|---|---|---|---|
containerd.enabled | Set to true, if the container runtime is containerd. | true | Important: Enable only one runtime environment. |
containerd.socketPath | The host path of the mounted volume for the containerd socket. | /var/run/containerd/containerd.sock | Optional |
containerd.storageDriverPath | The root directory path of containerd overlay storage driver | /var/lib/containerd | Optional |
containerd.fileSystemPath | The state directory path for containerd runtime | /run/containerd | Optional |
containerd.gcfsStorageDriverPath | The directory path of containerd gcfs storage driver | /run/gcfsd | Optional |
crio.enabled | Set to true, if the container runtime is CRI-O. | false | Important: Enable only one runtime environment. |
crio.socketPath | The host path of the mounted volume for the CRI-O socket. | /var/run/crio/crio.sock | Optional |
crio.storageDriverType | Specify the crio overlay storage driver type | overlay | Optional |
docker.enabled | Set to true, if the container runtime is docker. | false | Important: Enable only one runtime environment. |
docker.socketPath | The host path of the mounted volume for the docker socket. | /var/run/docker.sock | Optional |
docker.tlsVerify.enabled | Enables the TLS authentication. The value should be 0 or 1. | false | Optional |
docker.tlsVerify.tlsCertPath | Provide the path of the client certificate directory. | - | Optional (Mandatory if DOCKER_TLS_VERIFY=1 is defined). |
docker.tlsVerify.dockerHost | Specify the address on which the docker daemon is configured to listen. | - | Optional (Mandatory if DOCKER_TLS_VERIFY=1 is defined). |
docker.tlsVerify.dockerHostValue | Specify the loopback IPv4 address or hostname, and port :<port#>. | - | Optional |
docker.storageDriverPath | The root directory path of docker overlay2 storage driver | /var/lib/docker | Optional |
docker.containerdStorageDriverPath | The root directory path of docker overlayfs storage driver | - | Optional |
docker.storageDriverType | Specify the docker storage driver type, overlay2 or overlayfs | overlay2 | Optional |
openshift | Set to true, if deploying in OpenShift. | false | |
qualys.createNamespace | Set to true, if you want to create new custom namespace. | false | Optional |
qualys.namespace | Provide the namespace to be used. | qualys | Optional Use the same namespace in values.yaml and on command line when using the helm install command. Check the examples at the bottom of this page. |
qualys.customerID | Provide the Qualys customer id. | - | Mandatory |
qualys.activationID | Provide the Qualys activation id. | - | Mandatory |
qualys.pod_url | Provide the URL of a Qualys POD. | - | Mandatory |
qualys.containerLaunchTimeout | Specify the launch timeout for the scanning container in minutes. | 10 | Optional |
qualys.image | Specify the name of the Container Security sensor image in the private/dockerhub registry. | qualys/qcs-sensor:1.45.3-0 | Optional |
qualys.imagePullPolicy | Specify how to pull (download) the specified image. | Always | Optional |
qualys.cpu | Specify the CPU limit for the sensor container. | 500m | Optional |
qualys.args.withoutPersistentStorage | Runs the sensor without using the persistent storage on the host. | false | Optional |
qualys.args.enableConsoleLogs | Prints logs on the console. | false | Optional |
qualys.args.cicdDeployedSensor | Run the sensor in a CI/CD environment. | false | Optional |
qualys.args.registrySensor | Run the sensor to list and scan the registry assets. | false | Optional |
qualys.args.concurrentScan | Specify the number of docker/registry asset scans to run in parallel. Valid range: 1-20. | 4 | Optional |
qualys.args.disableLog4jScanning | Disables the log4j vulnerability scanning for container images. | false | Optional |
qualys.args.disableLog4jStaticDetection | Disables the log4j static detection for dynamic/static image scans. | false | Optional |
qualys.args.logFilePurgeCount | The maximum number of sensor log files to archive. | 5 | Optional |
qualys.args.logFileSize | The maximum size for a sensor log file in bytes. You can specify "<K/M/>", where K is kilobytes and M is megabytes. | 10M | Optional |
qualys.args.logLevel | Sets the logging level for sensor. It determines the type of sensor data you want to log. Specify a value from 0 to 5. 0=FATAL, 1=ERROR, 2=WARNING, 3=INFORMATION, 4=VERBOSE, 5=TRACE | 3 (INFORMATION) | Optional |
qualys.args.maskEnvVariable | Masks the environment variables for images and containers. | false | Optional |
qualys.args.optimizeImageScans | Optimizes the image scans for the General sensor. It is available for the General sensor type only. | true | Optional |
qualys.args.disableImageScan | Disables the image scans for the General sensor. | false | Optional |
qualys.args.performScaScan | SCA scanning will be performed for container images. | false | Optional |
qualys.args.disallowInternetAccessForSca | Internet access is enabled for the SCA scan and the SCA scan is performed in online mode. | false | Optional |
qualys.args.performSecretDetection | Secret scanning will be performed for container images. | false | Optional |
qualys.args.performMalwareDetection | Malware scanning will be performed for container images. | false | Optional |
qualys.args.limitResourceUsage | Used to limit the usage of resources for SCA or Secret or Malware Scan. | false | Optional |
qualys.args.scaScanTimeoutInSeconds | Specify the SCA scan timeout in seconds. | 900 | Optional |
qualys.args.insecureRegistry | Used in case self sign certs are not being configured for private registries in containerd | false | Optional |
qualys.args.enableStorageDriver | Used in case of containerd overlay storage driver | true | Optional |
qualys.args.storageDriverType | Specify the containerd overlay storage driver. Supported storage driver types for containerd are "overlay" and "gcfs" | overlay | Optional |
qualys.args.scanningPolicy | Specify the scanning policy. Valid values for scanningPolicy are: "DynamicWithStaticScanningAsFallback", "DynamicScanningOnly", "StaticScanningOnly" | DynamicWithStaticScanningAsFallback | Optional |
qualys.args.tagSensorProfile | Specify the valid tags for Sensor profile. e.g.: "tag1,tag2" | - | Optional |
qualys.args.disableContainerScan | Disables the container scans for the General sensor. | false | Optional |
qualys.args.enableDiskSpaceCheck | Set to true, if you want to enable disk space check to perform Static, SCA, Secret or Malware scan | false | Optional |
qualys.args.disableFeatures | Specify the features to be disabled. Valid values for DisableFeatures are: "SBOM" | - | Optional |
qualys.args.populateK8sMetadata | Set to true, if you want to populate the Kubernetes cluster metadata as soon as the vulnerabilities are available. | false | Optional |
qualys.args.ignoreExclusionListForImages | Set to true, if you want to scan the blacklisted images. | false | Optional |
qualys.args.disableProcessEnvCollection | Set to true, if you want to disable process environment collection during scanning | false | Optional |
qualys.args.disableDefaultLoggingToFile | Set to true, if you want to disable duplicate logging when enableConsoleLogs is true. | false | Optional |
qualys.args.disableJavadbCollection | Set to true, if you want to disable Java DB collection. | false | Optional |
qualys.args.enableCrashLoopContainerFilter | Set to true to enable crash loop container filtering. | false | Optional |
qualys.args.pkgInUse | Set to true to enable qlys-pkg-in-use, false to disable. It is available for the General sensor type only. | false | Optional (Enabling this sets privileged: true in securityContext and mounts /proc:/host/proc:ro) |
qualys.args.javaDBUpdateIntervalInDays | Specify the java DB update interval in days. | 15 | Optional (Compatible only with Sensor 1.39.0-1 and above) |
qualys.args.assetTrackingFlushDurationInSeconds | Specify the duration in seconds to flush messages. | 60 | Optional (Compatible only with Sensor 1.39.0-1 and above) |
qualys.args.assetTrackingFlushThresholdCount | Specify the threshold count of queue to flush messages. | 20 | Optional (Compatible only with Sensor 1.39.0-1 and above) |
qualys.readOnly | Runs the sensor in read-only mode. | - | Optional |
qualys.tolerations.enabled | Allows the DaemonSet runnable on master nodes. | false | Optional |
qualys.tolerations.toleration | Add toleration to schedule pod with matching taints. | - | Optional |
qualys.proxy.enabled | Set to true, if a proxy is required to connect to the Qualys cloud. | false | Optional |
qualys.proxy.proxyvalue | Specify the IPv4/IPv6 address or FQDN of the proxy server. | - | Optional |
qualys.proxy.proxycertpath | Specify the path of the proxy certificate file. proxycertpath is applicable only if the proxy has a valid certificate file. | - | Optional |
qualys.rootCert.rootcertpath | Specify the path of the root certificate file. rootcertpath is applicable if a root certificate is required to connect to the Qualys cloud. | - | Optional |
qualys.registryProxy.enabled | Set to true, if a proxy is required for registry sensor (public registry only) v1.21.0 and above. | false | Optional |
qualys.registryProxy.proxyvalue | Specify the IPv4/IPv6 address or FQDN of the proxy server for registry sensor. | - | Optional |
qualys.registryProxy.proxycertpath | Specify the path of the proxy certificate file for registry sensor. proxycertpath is applicable only if the proxy has a valid certificate file. | - | Optional |
qualys.sensorContResources.enabled | Specifies the resources for the Sensor container. | false | Optional |
qualys.sensorContResources.limits.cpu | Specify the CPU limit for the sensor container. | 500m | Optional |
qualys.sensorContResources.limits.memory | Specify the memory limit for the sensor container. | 500Mi | Optional |
qualys.sensorContResources.requests.cpu | Specify the CPU request for the sensor container. | 100m | Optional |
qualys.sensorContResources.requests.memory | Specify the memory request for the sensor container. | 300Mi | Optional |
qualys.scanningContResources.enabled | Specifies the resources for the scanning container. | false | Optional |
qualys.scanningContResources.limits.cpu | Specify the CPU limit for the scanning container. | 200m | Optional |
qualys.scanningContResources.limits.memory | Specify the memory limit for the scanning container. | 800Mi | Optional |
qualys.scanningContResources.requests.cpu | Specify the CPU request for the scanning container. | 100m | Optional |
qualys.scanningContResources.requests.memory | Specify the memory request for the scanning container. | 300Mi | Optional |
| ` |
Deploy qcs-sensor with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has qcs-sensor 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartqcs-sensor is pinned at v1.24.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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