GitHub - VahidR/helmsniff: A Go CLI tool that scans rendered Kubernetes/Helm manifests and produces a CSV & JSON report of security misconfigurations.
Helmsniff is a Go CLI that scans rendered Kubernetes and Helm manifests and generates CSV or JSON reports of security misconfigurations. It flags issues like missing securityContexts, insecure HTTP URLs, hostNetwork usage, privileged containers and Docker socket mounts, and supports directory or stdin input, parallel execution, and standard Makefile targets.
- Helmsniff scans rendered K8s/Helm YAML and outputs a CSV or JSON report flagging misconfigurations like privileged containers, missing resource limits, hostNetwork usage, and Docker socket mounts.
- It accepts input from a directory or stdin, letting you pipe `helm template` output directly in without temp files, and supports parallel scanning of multiple charts via GNU parallel.
- Each report row includes chart path and file path context, with checks marked 1 (violation) or 0 (safe), plus K8S_STATUS/HELM_STATUS boolean fields.
- Built in Go (requires 1.22+ and GNU Make), with a clean codebase split into cmd/main.go, config, parser, and scanner modules, backed by tests and an ARCHITECTURE.md documenting each check.
helmsniff is a command-line tool written in Go that scans rendered Kubernetes and Helm manifests for security misconfigurations. It walks through YAML files in a given directory (or reads from stdin) and produces a CSV or JSON report. Each row starts with two context columns—parent directory (chart) path and full YAML file path—followed by one column per security check. Checks include things like privileged containers (SEC_CONT_OVER_PRIVIL), missing resource limits (NO_RESO), hostNetwork usage (TRUE_HOST_NET), and many more. Violations are marked as “1,” safe settings as “0,” while K8S_STATUS and HELM_STATUS show true/false.
To run it, you need Go 1.22 or higher and GNU Make. Building is as simple as “make build,” which compiles the binary to bin/helmsniff. A typical scan looks like “./bin/helmsniff --root rendered_dir --out report.csv.” You can switch to JSON output with “--format json.” If you have multiple charts, you can feed them in parallel using GNU parallel. It also supports piping Helm template output directly into helmsniff, eliminating temporary files.
The code lives under helmsniff/ with a clear structure. cmd/main.go handles flags, directory walking, and output formatting. Under internal you’ll find config/constants.go for CSV headers, parser/parser.go for loading YAML docs, and scanner/ for orchestrating the checks (scanner.go), defining the row data structure (row.go), and individual checks (security_checks.go). Tests accompany parsers and scanners. Makefile targets cover build, clean, tidy, vet, lint, and test. An ARCHITECTURE.md file explains design choices and details each security check.