A Helm plugin that scans a Helm chart with Kubescape for security misconfigurations, vulnerabilities, and compliance — applying user-supplied Helm value overrides (-f / --set / --set-string / --set-file) and release identity (--release-name / --release-namespace) before the scan.
The plugin is a Go binary that uses Helm's own SDK for chart resolution (so oci://, https://, repo/chart, and .tgz references all work) and then invokes the local kubescape CLI to do the actual rendering and scanning. Per-template source mapping in findings is preserved by Kubescape's own renderer (no helm template | kubescape scan - style flattening).
Status: experimental — depends on the Helm-values-overrides change in
kubescape/kubescape(#1883 prerequisite). Build kubescape frommaster(or any release that includes the change) before installing this plugin.
- Helm ≥ 3.18.10. The plugin manifest uses
platformHooks, which was introduced in Helm v3.18.10; older Helm 3.x versions reject the field duringplugin.yamlunmarshal and refuse to install the plugin. Helm 4 movesplatformHooksunderruntimeConfig, so a v4-compatible release of this plugin will ship a separate manifest. - A local Go toolchain (the install hook builds from source) and the
kubescapeCLI onPATH.
helm plugin install https://github.com/kubescape/helm-kubescapeThe install hook builds the plugin binary using your local Go toolchain. (Prebuilt-binary downloads will be wired up once the plugin is tagged.)
The plugin shells out to a locally installed kubescape CLI for the scan itself. Install it from https://kubescape.io/docs/install-cli/ if you don't already have it. Override the binary path with KUBESCAPE_BIN=/path/to/kubescape if needed.
helm kubescape scan <chart> [helm flags] [kubescape flags]
helm kubescape version
helm kubescape help
The plugin accepts the same kinds of references as helm install:
| Reference | Example |
|---|---|
| Local directory | ./mychart |
| Local packaged chart | ./chart-1.0.0.tgz |
repo/chart (configured via helm repo add) |
bitnami/nginx |
| OCI registry | oci://ghcr.io/myorg/mychart |
| HTTP(S) URL to a packaged chart | https://example.com/chart-1.0.0.tgz |
For everything except local directories, the plugin uses Helm's SDK to pull and unpack the chart into a temporary directory before scanning.
| Helm flag | Forwarded as | Notes |
|---|---|---|
-f, --values FILE |
--values FILE |
repeatable; comma-list splits like helm install |
--set KEY=VAL |
--set KEY=VAL |
repeatable; commas inside braces preserved |
--set-string KEY=VAL |
--set-string KEY=VAL |
repeatable |
--set-file KEY=PATH |
--set-file KEY=PATH |
repeatable |
-n, --namespace NS |
--release-namespace NS |
sets .Release.Namespace |
--release-name NAME |
--release-name NAME |
sets .Release.Name |
--release-namespace NS |
--release-namespace NS |
sets .Release.Namespace |
Any other flag is forwarded verbatim to kubescape scan, so you can mix in Kubescape-native options:
# CI gate: fail if any high-severity finding is reported
helm kubescape scan ./mychart \
-f values-prod.yaml --set image.tag=v2 \
--release-name prod -n prod \
--severity-threshold high
# Save results as JSON
helm kubescape scan ./mychart --set image.pullPolicy=Never \
--format json --output scan.json
# Scan an OCI chart
helm kubescape scan oci://ghcr.io/myorg/mychart --version 1.2.3- Flag parsing.
pflagparses argv with the same flag bindings as Helm (StringSliceVarfor--values,StringArrayVarfor--set/--set-string/--set-file), so comma handling and repeatability matchhelm installexactly. - Chart resolution. Local directories pass through. Remote refs (
oci://,https://,repo/chart,.tgz) are pulled and unpacked into a temp dir using Helm's SDK (action.Pullfor remote refs,chartutil.ExpandFilefor local.tgz). The temp dir is cleaned up after the scan. - Forward. The plugin execs
kubescape scan <local-dir> --values ... --set ... --release-name ... --release-namespace ...plus any unrecognized flags. - Exit code. Kubescape's exit code is propagated unchanged, so the plugin works as a CI gate. Invalid value overrides (bad
--set, missing-ffile, unreadable--set-filepath, etc.) surface as a non-zero exit from kubescape rather than a silent fall-back to chart defaults.
The plugin does not split or rewrite values; it only renames flags whose names differ between Helm and Kubescape. Comma handling matches Helm exactly because both Helm and Kubescape use the same pflag bindings:
--valuesis comma-split (-f a.yaml,b.yaml→ two files), the same ashelm install -f a.yaml,b.yaml.--set/--set-string/--set-fileare taken verbatim (--set tolerations={a,b}is a single value with a brace), the same ashelm install --set tolerations={a,b}.
# Run the unit tests (no kubescape required)
make test
# Build the binary into bin/
make build
# Install this checkout as a local plugin and try it
make install
helm kubescape help
# Lint
make lint # currently runs go vetThe plugin is implemented in Go (see cmd/helm-kubescape/, internal/flags/, internal/chartresolve/). It runs on Linux, macOS, and Windows.
Apache-2.0 (matches the parent Kubescape project).