Kubernetes rules
tx0 checks Kubernetes manifests with 41 rules, 7 of them in the default tier. Files that say a tool generated them are skipped. Each rule's page explains what it finds and what it leaves alone.
Default: 7 rules
Bugs and security problems with measured precision. They run without a tx0.toml.
-
tx0/kubernetes:duplicate-container-namedefaultTwo containers of a pod have the same name, which the API server rejects
-
tx0/kubernetes:duplicate-container-portdefaultA container lists the same port and protocol twice
-
tx0/kubernetes:duplicate-env-namedefaultA container defines the same environment variable twice, and the later value wins
-
tx0/kubernetes:invalid-portdefaultA port number is outside 1 to 65535
-
tx0/kubernetes:removed-api-versiondefaultAn object uses an API version that current Kubernetes releases no longer serve
-
tx0/kubernetes:selector-mismatchdefaultThe selector of a workload does not match the labels of its pod template
-
tx0/kubernetes:unknown-volume-mountdefaultA container mounts a volume that its pod does not define
Recommended: 23 rules
Likely bugs, resource and performance problems.
-
tx0/kubernetes:apparmor-unconfinedrecommendedA pod or container runs without an AppArmor profile
-
tx0/kubernetes:cluster-admin-bindingrecommendedA binding grants the cluster-admin role
-
tx0/kubernetes:container-runtime-socketrecommendedA pod mounts the socket of the container runtime, which controls every container of the node
-
tx0/kubernetes:dangerous-capabilityrecommendedA container adds a Linux capability that lets it act on the node, such as SYS_ADMIN or NET_ADMIN
-
tx0/kubernetes:host-ipcrecommendedA pod shares the IPC namespace of its node
-
tx0/kubernetes:host-networkrecommendedA pod shares the network namespace of its node
-
tx0/kubernetes:host-path-volumerecommendedA pod mounts a directory of the node through a hostPath volume
-
tx0/kubernetes:host-pidrecommendedA pod shares the process namespace of its node and sees all its processes
-
tx0/kubernetes:host-portrecommendedA container binds a port of the node itself
-
tx0/kubernetes:host-process-containerrecommendedA Windows container runs as a process of the host
-
tx0/kubernetes:image-latest-tagrecommendedA container image is named by the
latesttag or by no tag, so each pull may run other code -
tx0/kubernetes:node-port-servicerecommendedA Service of type NodePort opens a port on every node of the cluster
-
tx0/kubernetes:privilege-escalation-allowedrecommendedA container allows its processes to gain more privileges than their parent
-
tx0/kubernetes:privileged-containerrecommendedA container runs privileged, with all the devices and capabilities of the node
-
tx0/kubernetes:proc-mount-unmaskedrecommendedA container sees /proc of the node unmasked
-
tx0/kubernetes:rbac-escalationrecommendedAn RBAC rule grants
escalate,bindorimpersonate, which let its subjects gain more rights -
tx0/kubernetes:rbac-reads-secretsrecommendedAn RBAC rule lets its subjects read Secrets
-
tx0/kubernetes:rbac-wildcardrecommendedAn RBAC rule grants every verb or every resource with
* -
tx0/kubernetes:runs-as-rootrecommendedA container is set to run as root, by
runAsUser: 0orrunAsNonRoot: false -
tx0/kubernetes:seccomp-unconfinedrecommendedA pod or container runs without a seccomp profile
-
tx0/kubernetes:secret-in-envrecommendedAn environment variable with a credential's name has its value written into the manifest
-
tx0/kubernetes:shared-process-namespacerecommendedThe containers of a pod share one process namespace and can see and signal each other
-
tx0/kubernetes:unsafe-sysctlrecommendedA pod sets a sysctl outside the safe set, which can affect other pods of the node
Strict: 11 rules
Code that can be written more plainly.
-
tx0/kubernetes:capabilities-not-droppedstrictA container keeps the default Linux capabilities instead of dropping ALL
-
tx0/kubernetes:default-namespacestrictAn object is placed in the
defaultnamespace -
tx0/kubernetes:ingress-without-tlsstrictAn Ingress serves its hosts without TLS
-
tx0/kubernetes:missing-liveness-probestrictA long-running container has no liveness probe, so a hung process is never restarted
-
tx0/kubernetes:missing-readiness-probestrictA long-running container has no readiness probe, so it gets traffic before it is ready
-
tx0/kubernetes:missing-resource-limitsstrictA container sets no memory limit, so it can take the memory of its node
-
tx0/kubernetes:missing-resource-requestsstrictA container requests no CPU or memory, so the scheduler places it blindly
-
tx0/kubernetes:privilege-escalation-not-blockedstrictA container does not set
allowPrivilegeEscalation: false -
tx0/kubernetes:run-as-non-root-unsetstrictNeither a container nor its pod requires a non-root user
-
tx0/kubernetes:service-account-token-mountedstrictA pod gets its service account token mounted without saying it needs it
-
tx0/kubernetes:writable-root-filesystemstrictA container can write to its root filesystem