stackradar-scanner
by LockDep
Event-driven Kubernetes scanner that watches pod changes in real time, generates SBOMs with Syft, and uploads them to StackRadar for continuous software supply-chain visibility.
About this chart
stackradar-scanner
Event-driven Kubernetes scanner that watches pod changes in real time, generates SBOMs with Syft, and uploads them to StackRadar for continuous software supply-chain visibility.
Homepage: https://stackradar.io
Maintainers
| Name | Url | |
|---|---|---|
| StackRadar | [email protected] | https://stackradar.io |
Source Code
Prerequisites
- Kubernetes 1.24+
- Helm 3.8+ or Helm 4 — 3.8 is where installing from an OCI registry stopped being experimental, and this chart is only published to one. Releases are tested against Helm 4; the chart uses nothing Helm 4-only, so Helm 3 keeps working until it reaches end-of-life in February 2027.
- A StackRadar account and API key (sign up)
Installing the Chart
Always install an explicit --version. Published versions are immutable, so a
pinned version is a pin to exact bytes; omitting it silently upgrades you the
next time you run helm install.
helm install stackradar-scanner oci://ghcr.io/lockdep/charts/stackradar-scanner \
--version <version> \
--namespace stackradar --create-namespace
The latest version is on the releases page, or from the registry:
helm show chart oci://ghcr.io/lockdep/charts/stackradar-scanner | grep '^version:'
Then create the credentials Secret:
kubectl create secret generic stackradar-scanner \
--namespace stackradar \
--from-literal=cluster-id=<your-cluster-id> \
--from-literal=api-key=<your-api-key>
Upgrading
helm get values stackradar-scanner --namespace stackradar -o yaml | \
helm upgrade stackradar-scanner oci://ghcr.io/lockdep/charts/stackradar-scanner \
--version <version> \
--namespace stackradar -f -
The first command prints the values you set on the installed release — the
API URL, an inline key, pull-secret names — and -f - hands exactly those to
the new chart. Everything you did not set comes from the new chart's defaults,
which is the point of upgrading. A credentials Secret you created with
kubectl is not part of the release and is left alone. Every helm upgrade in
this document has the same shape; a --set after -f - wins over it, so that
is where a changed setting goes.
Do not use --reuse-values to change versions. It carries the old
chart's defaults forward along with your own values, and a released chart's
defaults include the tag and digest of the image it was tested against
(see Versioning). The new chart is then told to run the old
image, and refuses:
Error: UPGRADE FAILED: … image.tag is set to "0.3.0" but image.digest (sha256:…)
still pins a different image, and the digest wins.
Do not follow that message's --set image.digest="" suggestion here — it is
written for someone deliberately running a different image, and on an upgrade
it would get you the new chart around the old agent. Run the command above
instead; the failed upgrade changed nothing. On Helm 3.14 or newer,
--reset-then-reuse-values is a shorthand for the same thing.
Then confirm the rollout:
kubectl rollout status deployment/stackradar-scanner-watcher -n stackradar
The StackRadar app shows the version each cluster's scanner reports, and says so when a newer release is available.
Passing credentials inline (CI/CD)
helm install stackradar-scanner oci://ghcr.io/lockdep/charts/stackradar-scanner \
--version <version> \
--namespace stackradar --create-namespace \
--set stackradar.clusterId=<your-cluster-id> \
--set stackradar.apiKey=<your-api-key>
Using an existing Secret
helm install stackradar-scanner oci://ghcr.io/lockdep/charts/stackradar-scanner \
--version <version> \
--namespace stackradar \
--set stackradar.existingSecret=my-secret
Choosing what gets scanned
By default every namespace is scanned except kube-system, kube-public and
kube-node-lease. scanner.includeNamespaces turns that around into an
allowlist: set it and only the namespaces you name are scanned, excludeNamespaces
included.
Namespaces are a coarse tool for the images people most want to skip, though —
registry.k8s.io/pause is on every pod in every namespace, and injected sidecars
are cluster-wide by design. scanner.excludeImages is the per-image version:
helm install stackradar-scanner oci://ghcr.io/lockdep/charts/stackradar-scanner \
--version <version> \
--namespace stackradar \
--set stackradar.existingSecret=my-secret \
--set 'scanner.excludeImages=registry.k8s.io/*\,*/pause\,ghcr.io/acme/vendor-*'
An image matching any pattern is never scanned — no syft run, no upload, and no row in your dashboard. The rules:
- Patterns match the image name with its
:tagand@sha256:...stripped, so one pattern keeps working as the tag moves. *is the only wildcard, and it spans/—registry.k8s.io/*coversregistry.k8s.io/sig-storage/csi-provisionertoo.- Everything else is literal, and a pattern must match the whole name.
registry.k8s.io/*does not matchmyregistry.io/registry.k8s.io-mirror/app. - A pattern carrying a tag or a digest could never match, so the agent drops it and logs a warning naming it, rather than leaving you with a pattern that quietly does nothing.
- Names are matched as your pod spec writes them. A pod running plain
nginxis matched bynginx, not bydocker.io/library/*— nothing here expands the implicit Docker Hub prefix.
Escaping the commas is not optional: an unescaped one makes --set read the
rest as a second key, and the pattern after it is silently lost. In a values
file the value is one ordinary string and no escaping is needed.
The agent logs the patterns it ended up with on startup, next to the rest of its configuration. Worth reading after a change — an over-broad pattern removes coverage without any other signal that it did:
kubectl logs -n stackradar deploy/stackradar-scanner-watcher | head -1
Skipped images are logged individually at debug (LOG_LEVEL=debug), which is
how you confirm a pattern is hitting what you meant it to.
Behind a corporate proxy
In a cluster with no direct internet egress, point the agent at your proxy:
helm install stackradar-scanner oci://ghcr.io/lockdep/charts/stackradar-scanner \
--version <version> \
--namespace stackradar --create-namespace \
--set stackradar.existingSecret=my-secret \
--set proxy.httpsProxy=http://proxy.corp:8080 \
--set proxy.noProxy=registry.internal
Include the scheme — proxy.corp:8080 is rejected at install time rather than
half-working later.
This sets HTTP_PROXY / HTTPS_PROXY / NO_PROXY on the pod, in both cases,
and the agent installs a proxy dispatcher for its own HTTP client at startup.
That second part is not optional: Node's built-in fetch ignores the
conventional environment variables, so a chart that only set them would fix
Syft's registry pulls and leave every call to the StackRadar API failing. The
startup log names the proxy in use, with any user:pass@ redacted.
kubernetes.default.svc, .svc, .cluster.local, localhost and 127.0.0.1
are always appended to NO_PROXY, so Kubernetes API traffic stays inside the
cluster. Add your internal registries to proxy.noProxy so image pulls do too.
Leaving both URLs empty renders no environment variables at all, which is what every install that does not need a proxy gets.
If your proxy terminates TLS — most do — the agent also needs to trust its CA. See the next section.
Behind a TLS-intercepting proxy
An egress proxy that terminates and re-signs TLS presents a certificate from
your own CA. Nothing in the pod trusts it yet, so the agent fails with
unable to verify the first certificate or
self-signed certificate in certificate chain. Give it the CA:
kubectl create configmap stackradar-ca \
--namespace stackradar \
--from-file=ca-certificates.crt=/path/to/your-ca.crt
helm get values stackradar-scanner --namespace stackradar -o yaml | \
helm upgrade stackradar-scanner oci://ghcr.io/lockdep/charts/stackradar-scanner \
--version <version> \
--namespace stackradar -f - \
--set caBundle.configMapName=stackradar-ca
The file may hold one PEM certificate or several concatenated — an intermediate
plus its root, say. Name it whatever you like and point caBundle.key at it;
ca-certificates.crt is only the default. If your tooling delivers certificates
as Secrets, caBundle.secretName takes one instead. Setting both fails the
install rather than quietly picking one.
Your CA is added to the public roots, not substituted for them. The bundle
is mounted read-only at /etc/ssl/stackradar/ and the pod gets
NODE_EXTRA_CA_CERTS (Node — the agent's own API and Kubernetes traffic) and
SSL_CERT_DIR (Go — syft's registry pulls). Both extend the trust store the
image already has, so a cluster that pulls some images through the intercepting
proxy and others straight from a public registry keeps working. That is why the
chart does not set SSL_CERT_FILE: it replaces Go's roots instead of adding
to them, and syft would lose every public registry the moment you mounted a CA.
Concatenating the system bundle into your own is therefore unnecessary.
The certificate has to arrive as a mount. The pod runs with a read-only root
filesystem, so nothing can write into /etc/ssl/certs at runtime, and an init
container running update-ca-certificates has nowhere to put the result.
Leave both names empty — the default — and no volume and no environment variables are rendered at all.
Pulling from your cloud's own registry
To read a private image the scanner needs credentials for the registry it lives
in. On a managed cluster the modern way to get them is workload identity: you
bind the scanner's ServiceAccount to a cloud identity, the cloud injects
short-lived credentials into the pod, and nothing static is ever stored in the
cluster. The alternative — dockerConfigSecret — means minting a long-lived
credential and, on ECR, refreshing a 12-hour token with a CronJob you write
yourself.
The chart exposes the three knobs every mechanism is wired up through:
| Value | Used by |
|---|---|
serviceAccount.annotations | EKS IRSA, GKE Workload Identity |
podLabels | Azure Workload Identity |
podAnnotations | Azure Workload Identity |
Create the cloud-side identity and grant it read access to your registry following your cloud vendor's documentation — the exact IAM shape changes often enough that repeating it here would only mislead you — then point the chart at it.
EKS — IAM roles for service accounts:
helm get values stackradar-scanner --namespace stackradar -o yaml | \
helm upgrade stackradar-scanner oci://ghcr.io/lockdep/charts/stackradar-scanner \
--version <version> \
--namespace stackradar -f - \
--set-string 'serviceAccount.annotations.eks\.amazonaws\.com/role-arn=arn:aws:iam::<account>:role/<role>'
GKE — Workload Identity Federation:
helm get values stackradar-scanner --namespace stackradar -o yaml | \
helm upgrade stackradar-scanner oci://ghcr.io/lockdep/charts/stackradar-scanner \
--version <version> \
--namespace stackradar -f - \
--set-string 'serviceAccount.annotations.iam\.gke\.io/gcp-service-account=<name>@<project>.iam.gserviceaccount.com'
AKS — Azure Workload Identity, which reads a label on the pod as well as an annotation:
helm get values stackradar-scanner --namespace stackradar -o yaml | \
helm upgrade stackradar-scanner oci://ghcr.io/lockdep/charts/stackradar-scanner \
--version <version> \
--namespace stackradar -f - \
--set-string 'podLabels.azure\.workload\.identity/use=true' \
--set-string 'podAnnotations.azure\.workload\.identity/client-id=<client-id>' \
--set-string 'serviceAccount.annotations.azure\.workload\.identity/client-id=<client-id>'
--set-string in every example above, and it matters for the Azure one:
azure.workload.identity/use is the string "true", and a plain --set
turns it into a boolean that the chart rejects at install time.
Not yet verified end to end. These render the annotations and labels the
three mechanisms document, and the credentials the cloud injects reach the
scanner's environment. What has not been confirmed on a real cluster of each
kind is the last step — whether syft's registry client picks those credentials
up on its own. It reads a docker config and the credential helpers named in it,
and the image ships no cloud credential helper binaries, so it is possible that
one or more of the three needs help we have not built yet. If a pull still fails
after you have wired the identity up and confirmed the cloud side is right, that
is worth telling us —
dockerConfigSecret remains the fallback that is known to work everywhere. This
note goes away per cloud as each one is veri
Deploy stackradar-scanner with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has stackradar-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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartstackradar-scanner is pinned at v0.7.1 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