Skip to content

Kubernetes manifest security checker

Free, no sign-up Runs in your browser

Paste Kubernetes YAML and find privileged pods, host paths, missing securityContext settings, wildcard RBAC and secrets in env, with the fix for each.

Checked as you type. Nothing you paste leaves this page.

The file is read in your browser. It is not uploaded.

Everything you type here stays in your browser. Nothing is sent to HardenKit or to anyone else.

How to use the kubernetes manifest security checker

  1. Paste one or more manifests separated by ---, drop a file, or load the example.
  2. Fix critical and high findings first: they give a pod control of the node or the cluster.
  3. Add the securityContext from the restricted finding to each container.
  4. For Helm charts, run helm template and paste the output.

About this tool

Kubernetes runs what the manifest asks for. A pod that asks for privileged mode, the host network or a hostPath to the container runtime socket gets it, and from there a compromised container owns the node and every pod on it. The Pod Security Standards define three levels (privileged, baseline and restricted) that name these settings one by one.

This checker reads multi-document YAML and List objects, and checks Pods, Deployments, StatefulSets, DaemonSets, Jobs and CronJobs against the baseline and restricted profiles. It also checks Roles and bindings for wildcards, escalation verbs and cluster-admin, Secrets with values in them, literal secrets in env, unpinned images, and Services that are reachable from outside the cluster.

The rules and their wording are the ones HardenKit Scan applies to manifests in a repository, so a finding here reads the same in CI. A rule set does not replace a review, and it cannot see admission policies or what your cluster adds at deploy time. Helm templates must be rendered first.

Sources

Questions

What securityContext should a normal container have?

The restricted Pod Security Standard asks for runAsNonRoot: true, allowPrivilegeEscalation: false, capabilities with drop: [ALL], and a seccompProfile of type RuntimeDefault. Add readOnlyRootFilesystem: true with an emptyDir for the paths the app writes to. Most web services run unchanged with all of these.

Why is a hostPath volume a risk?

It mounts a directory of the node into the pod. Paths such as /, /etc, /var/run or a container runtime socket give the pod control of the node and of every other pod on it. Use a persistentVolumeClaim, a configMap or an emptyDir instead.

Are Kubernetes Secrets safe to commit?

No. The data field is Base64-encoded, not encrypted, so anyone who can read the manifest can read the secret. Keep Secret values out of the repository with Sealed Secrets, External Secrets or SOPS, and rotate any that were committed.

What is wrong with binding cluster-admin to a service account?

Every pod that uses that service account, and anyone who breaks into one, can then do anything in the cluster: read all Secrets, create privileged pods, delete namespaces. Create a Role with the resources and verbs the workload needs and bind that.

Related tools