runtz

Kubernetes scanning

Kubernetes cluster scanning in runtz.

Kubernetes scanning

Kubernetes scanning reads the connected cluster through kubectl, checks workloads, network exposure and RBAC against a set of posture rules and sends the findings to the runtz backend. It can also scan YAML/JSON manifests from a repository or rendered chart instead of a live cluster.

Checks

IDCheckCategorySeverity
K8S001hostNetwork enabledpod-securityhigh
K8S002hostPID enabledpod-securityhigh
K8S003hostIPC enabledpod-securityhigh
K8S004hostPath volume mountedpod-securityhigh/medium
K8S005Privileged containercontainer-securitycritical
K8S006Privilege escalation not disabledcontainer-securitymedium
K8S007Container may run as rootcontainer-securitymedium
K8S008Writable root filesystemcontainer-securitylow
K8S014Dangerous Linux capability addedcontainer-securityhigh
K8S009Mutable image tag (latest or none)supply-chainmedium
K8S012cluster-admin bindingrbaccritical
K8S013Wildcard RBAC rulerbachigh
K8S018Default service account in userbaclow
K8S019Service account token automountedrbacmedium
K8S010Public service exposure (LoadBalancer/NodePort)networkmedium
K8S011Ingress without TLSnetworkmedium
K8S015Missing resource requests or limitsresiliencemedium
K8S016Missing readiness proberesiliencelow
K8S017Missing liveness proberesiliencelow

Every finding carries a description and a concrete remediation. In the platform, the scan detail screen lets you filter findings by these categories.

Scan a live cluster

By default the scanner uses the current kubectl context — whatever kubectl config current-context points to:

runtz k8s \
  --endpoint https://engine.runtz.dev \
  --token rtz_live_...

The machine running the CLI must have kubectl installed and authenticated to the target cluster. All namespaces are scanned by default, plus cluster-scoped RBAC resources.

You can also specify a kubeconfig using the --kubeconfig flag:

runtz k8s \
  --kubeconfig ~/.kube/config2 \
  --endpoint https://engine.runtz.dev \
  --token rtz_live_...

Scope the scan to a specific context and namespace:

runtz k8s \
  --context production \
  --namespace payments \
  --endpoint https://engine.runtz.dev \
  --token rtz_live_...

Scan manifests instead

Pass a manifest file or directory as the positional argument to scan rendered charts or repository manifests without touching a cluster:

runtz k8s (MANIFEST_PATH) [flags]
runtz k8s ./deploy \
  --target production-manifests \
  --endpoint https://engine.runtz.dev \
  --token rtz_live_...

Flags

FlagDescriptionDefault
--kubeconfigKubeconfig pathactive kubeconfig (KUBECONFIG or ~/.kube/config)
--contextKubernetes context overridecurrent context
--namespaceNamespace to scan instead of all namespacesall namespaces
--all-namespacesScan all namespaces when --namespace is not settrue
--kubectlkubectl binary pathkubectl
--targetTarget name shown in the platformcurrent context or directory name
--sourceScan source label, repository or URLscan target
--endpointRuntz backend endpointrequired
--tokenToken generated in the platformrequired

Stored result

The backend stores the target, source, Kubernetes resources scanned, optional manifest files scanned, findings with category and severity summary, and the scan timestamp. The token generated in the platform identifies the workspace automatically.

On this page