Thanks for your interest. KubePosture is a small, dependency-light Go CLI; contributions that keep it that way are the easiest to merge.
You need Go 1.24 or newer. The only runtime dependency is
gopkg.in/yaml.v3; everything else is the standard library.
git clone https://github.com/RahilSahu/kubeposture.git
cd kubeposture
go build ./...
go test ./...Before opening a pull request, make sure all three pass:
gofmt -l . # prints nothing
go vet ./...
go test ./...cmd/kubeposture: the CLI (flags, file collection, exit codes).internal/kube: manifest types and the multi-document YAML loader.internal/rules: the rule registry. One file per rule group (container, workload, RBAC), with metadata inregistry.go.internal/report: table, JSON and SARIF writers.testdata/: the hardened and insecure fixture manifests used by the end-to-end tests. The same files ship inexamples/.
- Pick the next free ID (
KP027, and so on). IDs are stable once released; never renumber an existing rule. - Write the check in the matching group file. Checks are functions
over
kube.Documentplus the scanContext; keep them pure. - Register the rule in
registry.gowith a severity, a CIS reference only where a benchmark control genuinely maps, and a one-line remediation that tells the user exactly what to change. - Add tests: at least one manifest that triggers the rule and one
that does not, in
internal/rules/per_rule_test.go. Update the registry shape test count and, if the fixture manifests change, the end-to-end expectations. - Add the rule to the README rule table in the same pull request.
Open an issue with the smallest manifest that reproduces the problem and the output you expected. For false positives, the manifest is essential; posture checks live and die by their edge cases.
- One topic per pull request.
- Describe the behaviour change and how you tested it.
- Keep user-facing text free of em dashes; this is a house style rule for published text in this project.