Overview
CPLN Trivy scans the images in your Control Plane image registry for known vulnerabilities. A scheduled daemon finds images that have not been scanned yet (or whose last scan is older thanrescanAfter), runs Trivy against each one, and hands the HTML report to a small web server that stores it in your own S3 bucket or Azure file share. The daemon then tags the image with a direct link to its report, so the result is one click away in the Control Plane console.
--gvc GVC_NAME at install time.What Gets Created
daemon and web-server do not include the release name, so install this template only once per GVC. The template creates no secrets of its own.
Prerequisites
Two opaque secrets, a service account and report storage must exist before you install. Secrets are org-level, so no GVC flag is involved. This template uses two secrets, so the commands below call themPOST_TOKEN_SECRET_NAME and REGISTRY_SECRET_NAME.
Create the report post token secret
postToken.secretName to this name.Create a registry service account and key
pull and view on images.Set serviceAccountName to the service account name.Store the service account key in an opaque secret
trivyAuth.secretName to this name.Prepare report storage
storage.type to s3 or azureFileshare and complete the matching steps.- AWS S3
- Create an S3 bucket. Set
storage.s3.bucketto its name andstorage.s3.regionto its region. - Create an AWS cloud account in Control Plane if you do not have one. Set
storage.s3.cloudAccountNameto its name. - Create an IAM policy scoped to the bucket (replace
YOUR_BUCKET_NAME) and setstorage.s3.policyNameto the policy name. Access is keyless: the identity receives temporary credentials, so no AWS keys are stored.
Installation
Install with the values for your storage, secrets and service account. This example uses S3:storage.type=azureFileshare and the four storage.azureFileshare.* values instead of the storage.s3.* values. You can also install from the UI, Terraform or Pulumi:
UI
CLI
Terraform
Pulumi
Configuration
Storage
Configure only the block that matchesstorage.type.
Authentication
Both secret names must point at secrets that already exist (see Prerequisites).Scanning
rescanAfter must be a number followed by d (days) or h (hours), such as 7d or 24h. With an empty value each image is scanned once; see Forcing a Rescan to scan it again.
Workloads
Connecting
The template has no login screen. Each scan result is an HTML report served by theweb-server workload at the URL stored in the image’s cpln/trivy-scan tag.
Authorization: Bearer followed by the token.
Reading Scan Results
List every image that has been scanned:cpln/trivy-scan tag have not been scanned yet. The daemon picks them up on its next scheduled run.
Operations
Upgrading from 1.1.0
Version1.2.0 moved the report post token out of Helm values. Through 1.1.0 it was the plain value postToken; it is now an opaque secret you create, named by postToken.secretName.
postToken as a string fails at render and leaves the running release untouched:
Create the post token secret with your current token
Replace the removed key in your values
postToken: string and set postToken.secretName to the secret name. Leave trivyAuth.secretName and serviceAccountName as they are.Upgrade the release
trivyAuth.secretName, serviceAccountName) the same way you did at install. Reports already stored keep their URLs.Rotating Secrets
Both prerequisite secrets are opaque, so rotate one by applying the whole secret with the new value. Save this asrotate.yaml:
-
Post token: the daemon and the web server must use the same token, so redeploy both together. If only one picks up the new token, uploads are refused with
401while both workloads still look healthy. -
Service account key: add a new key to the service account, put it in the
trivyAuth.secretNamesecret, redeploydaemon, then delete the old key. No reinstall is needed.
Forcing a Rescan
WithrescanAfter set, images are rescanned automatically once their last scan is older than that window, and the report is replaced at the same URL. To rescan an image sooner, remove its scan tags so the next run treats it as unscanned:
cpln image tag --help and has not been run against a live install.Troubleshooting
The workload never starts and cpln logs returns nothing
The workload never starts and cpln logs returns nothing
postToken.secretName or trivyAuth.secretName does not exist. status.versions[].message from cpln workload get-deployments web-server --gvc GVC_NAME -o yaml names it, for example The secret my-cpln-trivy-post-token no longer exists.Fix: create the secret as in Prerequisites, then wait for recovery or run cpln workload force-redeployment web-server --gvc GVC_NAME.Install or upgrade fails with postToken is no longer a plain value
Install or upgrade fails with postToken is no longer a plain value
postToken as a string from 1.1.0 or earlier.Fix: follow Upgrading from 1.1.0.Install fails with rescanAfter must be a number followed by d or h
Install fails with rescanAfter must be a number followed by d or h
rescanAfter is not in the form 7d or 24h. The full error reads rescanAfter must be a number followed by 'd' (days) or 'h' (hours), e.g. '7d' or '24h'.Fix: use a whole number followed by d or h, or "" to scan each image only once.Scans run but no new reports appear
Scans run but no new reports appear
webServer.firewall.inboundAllowCIDR no longer admits the daemon’s traffic.Fix: redeploy both workloads together after a token change, and widen the inbound CIDR list if you narrowed it. Check the daemon’s output:The daemon logs a 404 tagging error
The daemon logs a 404 tagging error
Important Notes
- Create both prerequisite secrets before installing. A missing one wedges the deployment with no log output.
- Every image in the organization is scanned and tagged, not only images this install created.
- Report URLs are readable without authentication. Narrow
webServer.firewall.inboundAllowCIDRto keep them private, and keep the daemon’s traffic allowed when you do. - Redeploy
daemonandweb-servertogether after changing the post token. They must agree or uploads fail with401. - Runs never overlap. A long run on a large registry delays the next scheduled run rather than starting a second one.
- Install once per GVC. The workloads are always named
daemonandweb-server.