Hub rules-kubernetes

rules-kubernetes

v3 public Verified

Kubernetes

Kubernetes manifest governance rules for AI coding agents. Prevents privileged containers, root user execution, hardcoded secrets in env vars, wildcard RBAC, missing health probes, and untagged images — enforcing Kubernetes security best practices at the agent tool-call boundary.

@sigmashakeinc 2 pulls 26 rules published Apr 8, 2026 synced Oct 11, 2026 sigmashakeinc/rules/rulesets/rules-kubernetes →
Severity
16 error 10 warn 0 info
demo.cast
Kubernetes manifest governance rules for AI coding agents. Prevents privileged containers, root user execution, hardcoded secrets in env vars, wildcard RBAC, missing health probes, and untagged images — enforcing Kubernetes security best practices at the agent tool-call boundary.

Rules index

26 governance rules

Indexed from the repository's .rules files, grouped by technology. Expand any rule to read the raw source.

k8s

no-aggressive-failure-threshold warning log

failureThreshold of 1 or 2 may cause unnecessary restarts during transient slowdowns. Consider 3+ for liveness probes to allow the app to recover without a full restart.

Rule source requires an active Pro or Enterprise subscription.
no-automount-service-account-token warning log

automountServiceAccountToken: true injects the service account token into every pod. If the workload doesn't call the Kubernetes API, set this to false to reduce the blast radius of a compromise.

Rule source requires an active Pro or Enterprise subscription.
no-cluster-admin-binding error block

ClusterRoleBinding to cluster-admin grants full superuser access to every resource in the cluster. Use a scoped Role/RoleBinding with least-privilege permissions instead.

Rule source requires an active Pro or Enterprise subscription.
no-default-service-account warning log

Using the default service account. Create a dedicated service account for each workload with only the permissions it needs.

Rule source requires an active Pro or Enterprise subscription.
no-host-ipc error block

hostIPC: true grants the container access to the host's IPC namespace (shared memory, semaphores), enabling cross-process data injection and exfiltration. Remove hostIPC or set it to false.

Rule source requires an active Pro or Enterprise subscription.
no-host-network error block

hostNetwork: true shares the host's network namespace, bypassing network policies. Remove it and use Service resources for inter-pod communication.

Rule source requires an active Pro or Enterprise subscription.
no-host-pid error block

hostPID: true shares the host PID namespace, allowing the container to see and signal all processes on the node — a trivial container escape path. Remove hostPID or set it to false.

Rule source requires an active Pro or Enterprise subscription.
no-host-port warning log

hostPort binds the container directly to the host node's port, limiting scheduling to nodes where that port is free and bypassing network policies. Use a Service of type NodePort or LoadBalancer instead.

Rule source requires an active Pro or Enterprise subscription.
no-latest-image-tag error block

Using ':latest' or no image tag makes deployments non-reproducible. Pin to a specific image digest or version tag.

Rule source requires an active Pro or Enterprise subscription.
no-missing-liveness-probe warning log

No liveness probe defined. Without a liveness probe, Kubernetes cannot restart containers stuck in a deadlock or infinite loop. Add livenessProbe with appropriate httpGet or exec check.

Rule source requires an active Pro or Enterprise subscription.
no-missing-readiness-probe warning log

No readiness probe defined. Without a readiness probe, Kubernetes routes traffic to pods before they are ready to serve requests. Add readinessProbe to avoid serving errors during startup.

Rule source requires an active Pro or Enterprise subscription.
no-missing-resource-limits warning log

No resource limits defined. Without CPU and memory limits, a misbehaving container can starve the entire node. Add resources.limits.cpu and resources.limits.memory.

Rule source requires an active Pro or Enterprise subscription.
no-missing-security-context warning log

No securityContext defined on container(s). Without explicit securityContext, containers inherit permissive defaults. Add securityContext with at minimum: runAsNonRoot: true, readOnlyRootFilesystem: true, allowPrivilegeEscalation: false.

Rule source requires an active Pro or Enterprise subscription.
no-privilege-escalation-allowed error block

allowPrivilegeEscalation: true permits processes inside the container to gain more privileges than the parent (e.g., via setuid binaries). Set it to false in every container securityContext.

Rule source requires an active Pro or Enterprise subscription.
no-privileged-pod error block

Privileged pods have root access to the host kernel — equivalent to running as root on every node. Remove 'privileged: true' and use specific capabilities (securityContext.capabilities.add).

Rule source requires an active Pro or Enterprise subscription.
no-run-as-root-uid error block

runAsUser: 0 runs the container as root. Set runAsNonRoot: true and specify a non-zero runAsUser (e.g., 1000) in the securityContext.

Rule source requires an active Pro or Enterprise subscription.
no-secret-in-env-literal error block

Secret value appears hardcoded in the manifest. Use secretKeyRef to reference a Kubernetes Secret instead: valueFrom.secretKeyRef.name/key

Rule source requires an active Pro or Enterprise subscription.
no-single-replica-deployment warning log

Single-replica Deployment has no availability during node maintenance or rolling updates. Set replicas >= 2 for production workloads to maintain uptime during disruptions.

Rule source requires an active Pro or Enterprise subscription.
no-sys-admin-capability error block

CAP_SYS_ADMIN is nearly equivalent to root on the host — it allows mounting filesystems, ptrace, namespace manipulation, and many other privilege escalation paths. Remove SYS_ADMIN and use only the specific capabilities your workload requires.

Rule source requires an active Pro or Enterprise subscription.
no-wildcard-rbac-resources error block

Wildcard resource '*' in RBAC grants access to all Kubernetes resources including secrets. Enumerate only the specific resources needed.

Rule source requires an active Pro or Enterprise subscription.
no-wildcard-rbac-verbs error block

Wildcard RBAC verb '*' grants unrestricted access to the resource. Specify only the verbs your workload actually needs (get, list, watch, create, update, delete).

Rule source requires an active Pro or Enterprise subscription.
no-writable-root-filesystem warning log

A writable root filesystem lets an attacker persist payloads across pod restarts and modify binaries. Set readOnlyRootFilesystem: true and mount only specific writable paths via emptyDir or PersistentVolumeClaim.

Rule source requires an active Pro or Enterprise subscription.

kubernetes

k8s-cluster-admin-rolebinding error block

Granting cluster-admin via RoleBinding or ClusterRoleBinding gives full control over the cluster. Avoid granting this except to core administrators. Use Least Privilege.

Rule source requires an active Pro or Enterprise subscription.
k8s-host-network error block

Using hostNetwork: true allows a pod to bind to the host's network interfaces, sniffing node traffic and bypassing network policies. This is extremely dangerous.

Rule source requires an active Pro or Enterprise subscription.
k8s-privileged-container error block

Running Kubernetes pods with privileged: true allows the container to bypass nearly all security controls and access the host node. Do not use this unless absolutely required (e.g. for CNI plugins or node agents).

Rule source requires an active Pro or Enterprise subscription.
k8s-run-as-root error block

Explicitly setting runAsUser: 0 forces a pod to run as the root user. This is a severe security risk. Set runAsNonRoot: true and specify an unprivileged user ID.

Rule source requires an active Pro or Enterprise subscription.

Version metadata

Published metadata

The hash-locked record of this published ruleset. When source contents change, the maintainer resyncs and the version bumps.

Version
v3
Published
Apr 8, 2026
Source commits
0
Synced
Oct 11, 2026
Hash
50cd2e788a7ef1b6bec9726aab1a228b79024cad9621d29d2f78c45a4ecf7d5f
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

Latest commits touching rulesets/rules-kubernetes/.sigmashake/rules in sigmashakeinc/rules/rulesets/rules-kubernetes. The published version only bumps when a maintainer resyncs.

No commit history available.