trivy-operator

by devopstales

Helm chartv2.5.0App 0.23.0Verified publisher

This chart deploys an operator that default every 5 minutes execute a scan script. It will get image list from all namespaces with the label `trivy-scan=true`, and then scan this images with trivy, finally we will get metrics on `http://[pod-ip]:9115/metrics`

About this chart

trivy-operator

This chart deploys an operator that default every 5 minutes execute a scan script. It will get image list from all namespaces with the label trivy-scan=true, and then scan this images with trivy, finally we will get metrics on http://[pod-ip]:9115/metrics

Homepage: https://github.com/devopstales/trivy-operator

Source Code

Requirements

Kubernetes: >=1.19.x-0

Values

KeyTypeDefaultDescription
TimeZonestring"UTC"Time Zone in container
admissionController.enabledboolfalseenable adission controller
affinityobject{}Set the affinity for the pod.
cache.enabledboolfalseenable redis cache
clusterScanner.crontabstring"*/1 * * * *"crontab for scheduled scan
clusterScanner.enabledboolfalseenable clusterScanner cr creation
clusterScanner.integrationsobject{}configure defectdojo integration
clusterScanner.scanProfileNamestring"cis-1.23"kube-hunter scan profile
githubToken.enabledboolfalseenable github authentiation token
githubToken.tokenstring""github authentiation token value
grafana.dashboards.enabledbooltrueEnable the deployment of grafana dashboards
grafana.dashboards.labelstring"grafana_dashboard"Label to find dashboards using the k8s sidecar
grafana.dashboards.valuestring"1"Label value to find dashboards using the k8s sidecar
grafana.folder.annotationstring"grafana_folder"Annotation to enable folder storage using the k8s sidecar
grafana.folder.namestring"Policy Reporter"Grafana folder in which to store the dashboards
grafana.namespacestringnilnamespace for configMap of grafana dashboards
image.pullPolicystring"Always"The docker image pull policy
image.repositorystring"devopstales/trivy-operator"The docker image repository to use
image.tagstring"2.5"The docker image tag to use
imagePullSecretslist[]list of secrets to use for imae pull
kube_bench_scnner.image.pullPolicystring"Always"The docker image pull policy
kube_bench_scnner.image.repositorystring"devopstales/kube-bench-scnner"The docker image repository to use
kube_bench_scnner.image.tagstring"2.5"The docker image tag to use
log_levelstring"INFO"Log level
monitoring.portstring"9115"configure prometheus monitoring port
namespaceScanner.clusterWideboolfalse
namespaceScanner.crontabstring"*/5 * * * *"
namespaceScanner.integrations.policyreportboolfalse
namespaceScanner.namespaceSelectorstring"trivy-scan"
nodeSelectorobject{}Set the node selector for the pod.
offline.db_repositorystring"localhost:5000/trivy-db"repository to use for download trivy vuln db
offline.db_repository_insecureboolfalseinsecure repository
offline.enabledboolfalseenable air-gapped mode
persistence.accessModestring"ReadWriteOnce"Volumes mode
persistence.annotationsobject{}Volumes annotations
persistence.enabledbooltrueVolumes for the pod
persistence.sizestring"1Gi"Volumes size
podSecurityContextobject{"fsGroup":10001,"fsGroupChangePolicy":"OnRootMismatch"}security options for the pod
registryAuth.enabledboolfalseenable registry authentication
registryAuth.image_pull_secretslist["regcred"]list of image pull secrets for authentication
serviceAccount.annotationsobject{}serviceAccount annotations
serviceAccount.createbooltrueEnable serviceAccount creation
serviceAccount.namestring"trivy-operator"Name of the serviceAccount
serviceMonitor.enabledboolfalseallow to override the namespace for serviceMonitor
serviceMonitor.labels.releasestring"prometheus"labels to match the serviceMonitorSelector of the Prometheus Resource
serviceMonitor.metricRelabelingslist[]metricRelabeling config for serviceMonitor
serviceMonitor.namespaceobject{}Name of the namespace for serviceMonitor
serviceMonitor.relabelingslist[]relabel config for serviceMonitor
tolerationslist[]Set the tolerations for the pod.

Autogenerated from chart metadata using helm-docs v1.14.2

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 v2.5.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