trivy-operator

by Helm

Helm chartv0.18.0App 0.16.0

Keeps security report resources updated

About this chart

trivy-operator

Keeps security report resources updated

Source Code

Values

KeyTypeDefaultDescription
affinityobject{}affinity set the operator affinity
automountServiceAccountTokenbooltrueautomountServiceAccountToken the flag to enable automount for service account token
compliance.cronstring"0 */6 * * *"cron this flag control the cron interval for compliance report generation
compliance.failEntriesLimitint10failEntriesLimit the flag to limit the number of fail entries per control check in the cluster compliance detail report
compliance.reportTypestring"summary"reportType this flag control the type of report generated (summary or all)
excludeNamespacesstring""excludeNamespaces is a comma separated list of namespaces (or glob patterns) to be excluded from scanning. Only applicable in the all namespaces install mode, i.e. when the targetNamespaces values is a blank string.
fullnameOverridestring""fullnameOverride override operator full name
image.pullPolicystring"IfNotPresent"pullPolicy set the operator pullPolicy
image.pullSecretslist[]pullSecrets set the operator pullSecrets
image.registrystring"ghcr.io"
image.repositorystring"aquasecurity/trivy-operator"
image.tagstring""tag is an override of the image tag, which is by default set by the appVersion field in Chart.yaml.
managedBystring"Helm"managedBy is similar to .Release.Service but allows to overwrite the value
nameOverridestring""nameOverride override operator name
nodeCollector.excludeNodesstringnilexcludeNodes comma-separated node labels that the node-collector job should exclude from scanning (example kubernetes.io/arch=arm64,team=dev)
nodeCollector.imagePullSecretstringnilimagePullSecret is the secret name to be used when pulling node-collector image from private registries example : reg-secret It is the user responsibility to create the secret for the private registry in trivy-operator namespace
nodeCollector.registrystring"ghcr.io"registry of the node-collector image
nodeCollector.repositorystring"aquasecurity/node-collector"repository of the node-collector image
nodeCollector.tagstring"0.0.6"tag version of the node-collector image
nodeCollector.volumeMountslist[{"mountPath":"/var/lib/etcd","name":"var-lib-etcd","readOnly":true},{"mountPath":"/var/lib/kubelet","name":"var-lib-kubelet","readOnly":true},{"mountPath":"/var/lib/kube-scheduler","name":"var-lib-kube-scheduler","readOnly":true},{"mountPath":"/var/lib/kube-controller-manager","name":"var-lib-kube-controller-manager","readOnly":true},{"mountPath":"/etc/systemd","name":"etc-systemd","readOnly":true},{"mountPath":"/lib/systemd/","name":"lib-systemd","readOnly":true},{"mountPath":"/etc/kubernetes","name":"etc-kubernetes","readOnly":true},{"mountPath":"/etc/cni/net.d/","name":"etc-cni-netd","readOnly":true}]node-collector pod volumeMounts definition for collecting config files information
nodeCollector.volumeslist[{"hostPath":{"path":"/var/lib/etcd"},"name":"var-lib-etcd"},{"hostPath":{"path":"/var/lib/kubelet"},"name":"var-lib-kubelet"},{"hostPath":{"path":"/var/lib/kube-scheduler"},"name":"var-lib-kube-scheduler"},{"hostPath":{"path":"/var/lib/kube-controller-manager"},"name":"var-lib-kube-controller-manager"},{"hostPath":{"path":"/etc/systemd"},"name":"etc-systemd"},{"hostPath":{"path":"/lib/systemd"},"name":"lib-systemd"},{"hostPath":{"path":"/etc/kubernetes"},"name":"etc-kubernetes"},{"hostPath":{"path":"/etc/cni/net.d/"},"name":"etc-cni-netd"}]node-collector pod volumes definition for collecting config files information
nodeSelectorobject{}nodeSelector set the operator nodeSelector
operator.accessGlobalSecretsAndServiceAccountbooltrueaccessGlobalSecretsAndServiceAccount The flag to enable access to global secrets/service accounts to allow vulnerability scan job to pull images from private registries
operator.batchDeleteDelaystring"10s"batchDeleteDelay the duration to wait before deleting another batch of config audit reports.
operator.batchDeleteLimitint10batchDeleteLimit the maximum number of config audit reports deleted by the operator when the plugin's config has changed.
operator.builtInTrivyServerboolfalsebuiltInTrivyServer The flag enable the usage of built-in trivy server in cluster ,its also override the following trivy params with built-in values trivy.mode = ClientServer and serverURL = http://.:4975
operator.clusterComplianceEnabledbooltrueclusterComplianceEnabled the flag to enable cluster compliance scanner
operator.configAuditScannerEnabledbooltrueconfigAuditScannerEnabled the flag to enable configuration audit scanner
operator.configAuditScannerScanOnlyCurrentRevisionsbooltrueconfigAuditScannerScanOnlyCurrentRevisions the flag to only create config audit scans on the current revision of a deployment.
operator.controllerCacheSyncTimeoutstring"5m"controllerCacheSyncTimeout the duration to wait for controller resources cache sync (default: 5m).
operator.exposedSecretScannerEnabledbooltrueexposedSecretScannerEnabled the flag to enable exposed secret scanner
operator.infraAssessmentScannerEnabledbooltrueinfraAssessmentScannerEnabled the flag to enable infra assessment scanner
operator.leaderElectionIdstring"trivyoperator-lock"leaderElectionId determines the name of the resource that leader election will use for holding the leader lock.
operator.logDevModeboolfalselogDevMode the flag to enable development mode (more human-readable output, extra stack traces and logging information, etc)
operator.mergeRbacFindingWithConfigAuditboolfalsemergeRbacFindingWithConfigAudit the flag to enable merging rbac finding with config-audit report
operator.metricsConfigAuditInfoboolfalseMetricsConfigAuditInfo the flag to enable metrics about configuration audits be aware of metrics cardinality is significantly increased with this feature enabled.
operator.metricsExposedSecretInfoboolfalseMetricsExposedSecretInfo the flag to enable metrics about exposed secrets be aware of metrics cardinality is significantly increased with this feature enabled.
operator.metricsFindingsEnabledbooltruemetricsFindingsEnabled the flag to enable metrics for findings
operator.metricsInfraAssessmentInfoboolfalseMetricsInfraAssessmentInfo the flag to enable metrics about Infra Assessment be aware of metrics cardinality is significantly increased with this feature enabled.
operator.metricsRbacAssessmentInfoboolfalseMetricsRbacAssessmentInfo the flag to enable metrics about Rbac Assessment be aware of metrics cardinality is significantly increased with this feature enabled.
operator.metricsVulnIdEnabledboolfalsemetricsVulnIdEnabled the flag to enable metrics about cve vulns id be aware of metrics cardinality is significantly increased with this feature enabled.
operator.namespacestring""namespace to install the operator, defaults to the .Release.Namespace
operator.podLabelsobject{}additional labels for the operator pod
operator.privateRegistryScanSecretsNamesobject{}privateRegistryScanSecretsNames is map of namespace:secrets, secrets are comma seperated which can be used to authenticate in private registries in case if there no imagePullSecrets provided example : {"mynamespace":"mySecrets,anotherSecret"}
operator.rbacAssessmentScannerEnabledbooltruerbacAssessmentScannerEnabled the flag to enable rbac assessment scanner
operator.replicasint1replicas the number of replicas of the operator's pod
operator.revisionHistoryLimitstringnilnumber of old history to retain to allow rollback (if not set, default Kubernetes value is set to 10)
operator.sbomGenerationEnabledbooltruethe flag to enable sbom generation
operator.scanJobTTLstring""scanJobTTL the set automatic cleanup time after the job is completed
operator.scanJobTimeoutstring"5m"scanJobTimeout the length of time to wait before giving up on a scan job
operator.scanJobsConcurrentLimitint10scanJobsConcurrentLimit the maximum number of scan jobs create by the operator
operator.scanJobsRetryDelaystring"30s"scanJobsRetryDelay the duration to wait before retrying a failed scan job
operator.scanNodeCollectorLimitint1scanNodeCollectorLimit the maximum number of node collector jobs create by the operator
operator.scannerReportTTLstring"24h"scannerReportTTL the flag to set how long a report should exist. "" means that the ScannerReportTTL feature is disabled
operator.trivyServerHealthCheckCacheExpirationstring"10h"trivyServerHealthCheckCacheExpiration The flag to set the interval for trivy server health cache before it invalidate
operator.vulnerabilityScannerEnabledbooltruethe flag to enable vulnerability scanner
operator.vulnerabilityScannerScanOnlyCurrentRevisionsbooltruevulnerabilityScannerScanOnlyCurrentRevisions the flag to only create vulnerability scans on the current revision of a deployment.
operator.webhookBroadcastTimeoutstring"30s"webhookBroadcastTimeout the flag to set timeout for webhook requests if webhookBroadcastURL is enabled
operator.webhookBroadcastURLstring""webhookBroadcastURL the flag to set reports should be sent to a webhook endpoint. "" means that the webhookBroadcastURL feature is disabled
operator.webhookSendDeletedReportsboolfalsewebhookSendDeletedReports the flag to enable sending deleted reports if webhookBroadcastURL is enabled
podAnnotationsobject{}podAnnotations annotations added to the operator's pod
podSecurityContextobject{}
priorityClassNamestring""priorityClassName set the operator priorityClassName
rbac.createbooltrue
resourcesobject{}
securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"privileged":false,"readOnlyRootFilesystem":true}securityContext security context
serviceobject{"annotations":{},"metricsPort":80}service only expose a metrics endpoint for prometheus to scrape, trivy-operator does not have a user interface.
service.annotationsobject{}annotations added to the operator's service
serviceAccount.annotationsobject{}
serviceAccount.createbooltrueSpecifies whether a service account should be created.
serviceAccount.namestring""name specifies the name of the k8s Service Account. If not set and create is true, a name is generated using the fullname template.
serviceMonitor.annotationsobject{}Additional annotations for the serviceMonitor
serviceMonitor.enabledboolfalseenabled determines whether a serviceMonitor should be deployed
serviceMonitor.endpointAdditionalPropertiesobject{}EndpointAdditionalProperties allows setting additional properties on the endpoint such as relabelings, metricRelabelings etc.
serviceMonitor.honorLabelsbooltrueHonorLabels chooses the metric’s labels on collisions with target labels
serviceMonitor.intervalstringnilInterval at which metrics should be scraped. If not specified Prometheus’ global scrape interval is used.
serviceMonitor.labelsobject{}Additional labels for the serviceMonitor
serviceMonitor.namespacestringnilThe namespace where Prometheus expects to find service monitors
targetNamespacesstring""targetNamespace defines where you want trivy-operator to operate. By default, it's a blank string to select all namespaces, but you can specify another namespace, or a comma separated list of namespaces.
targetWorkloadsstring"pod,replicaset,replicationcontroller,statefulset,daemonset,cronjob,job"targetWorkloads is a comma seperated list of Kubernetes workload resources to be included in the vulnerability and config-audit scans if left blank, all workload resources will be scanned
tolerationslist[]tolerations set the operator tolerations
trivy.additionalVulnerabilityReportFieldsstring""additionalVulnerabilityReportFields is a comma separated list of additional fields which can be added to the VulnerabilityReport. Supported parameters: Description, Links, CVSS, Target, Class, PackagePath and PackageType
trivy.clientServerSkipUpdateboolfalseclientServerSkipUpdate is the flag to enable skip databases update for Trivy client. Only applicable in ClientServer mode.
trivy.commandstring"image"command. One of image, filesystem or rootfs scanning, depending on the target type required for the scan. For 'filesystem' and rootfs scanning, ensure that the trivyOperator.scanJobPodTemplateContainerSecurityContext is configured to run as the root user (runAsUser = 0).
trivy.createConfigbooltruecreateConfig indicates whether to create config objects
trivy.dbRegistrystring"ghcr.io"
trivy.db

Deploy trivy-operator with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has trivy-operator 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 charttrivy-operator is pinned at v0.18.0 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