Checking a Kubernetes Manifest for Security Problems Before It Runs
A container that runs with more privilege than it needs turns a small application flaw into a large cluster problem. Kubernetes manifests control that privilege through security settings: whether a container runs as root, whether it runs in privileged mode, whether it can access the host's network or filesystem, and whether it has resource limits. The Kubernetes Security Checker reads a manifest you paste in and flags settings that look risky, in your browser, without contacting a cluster. It reviews the text you supply; it does not scan a live cluster, check image contents, or prove that a workload is safe, and a clean report on a manifest is not a clean bill of health for the running application.
The highest-risk settings are easy to name. Privileged mode removes most isolation between container and host, and should be reserved for the rare workloads that genuinely need it, such as certain system tools. Host network or host process access similarly erodes isolation, letting a container see or affect the host directly. Running as root, especially without a read-only filesystem, gives an attacker who escapes the application a powerful starting position. Each of these settings may have a legitimate use, but each deserves a written reason when it appears, because the default for ordinary applications should be the least privilege that works.
How it works
A checker typically walks the manifest's workload definitions and tests each container's security context against a list of rules, reporting each finding with the workload and container it belongs to. It may also check for missing pieces: no resource limits, no security context at all, or no network policy governing the workload's traffic. Missing pieces matter because a manifest that says nothing about security usually inherits permissive defaults, and permissive defaults are a decision made by omission. The output is a prioritised list, not a pass or fail stamp, and the reviewer's job is to work through it, fixing what can be fixed and documenting what cannot.
Context decides whether a finding is a flaw or a requirement. A monitoring agent that reads host metrics may legitimately need host access, while a web front end with the same setting almost certainly does not. The checker cannot know your application's intent, so it flags both, and you decide. That is why findings should be reviewed by someone who knows the workload, not merely counted: ten findings in a system workload may be less concerning than one finding in a public-facing service.
Where it goes wrong
The most common review error is fixing findings by deleting settings without understanding them, which can break the workload or push the risk elsewhere. Another is treating a clean checker report as proof of security, while ignoring image vulnerabilities, network policies and cluster-level permissions, which a manifest checker cannot see. A third is pasting a real manifest containing secrets into a checker or a shared report; replace secret values with clearly sample placeholders first, since the checker needs structure, not credentials. Finally, never apply a manifest to a production cluster to "see if the findings matter"; test in a staging environment where a risky setting cannot harm real data.
Worked example
Worked example with sample values. Suppose you paste a sample manifest with 4 containers across 2 workloads. The checker reports 6 findings: 1 privileged container, 2 containers running as root, 2 containers without memory limits, and 1 container with host network access, which adds up as 1 plus 2 plus 2 plus 1, which is 6. The privileged finding affects 1 out of 4 containers, or 25 percent, while the root findings affect 2 out of 4, or 50 percent. Fixing the privileged flag, adding a non-root user to the 2 root containers, and adding limits to the 2 unlimited containers resolves 5 of the 6 findings, leaving 1, the host network access, which the team documents as required for a monitoring workload. The final state is therefore 5 fixed plus 1 documented, which is 6 accounted for, with nothing ignored. These are sample values for illustration, not a real cluster review, and the counts show a review that ends with every finding either fixed or explained.
Mistakes to avoid
One mistake is applying the same rules blindly to system workloads and application workloads, which produces either noise or dangerous exceptions. Another is fixing findings in one manifest while leaving identical manifests in other environments unchanged, so the risk survives under a different name. A third is never re-checking after fixes, which leaves the team assuming the manifest is clean when a later edit reintroduced a finding. Check on every change, not once per project.
Putting it into practice
Make the checker part of the change review for every manifest. Paste the complete manifest with sample values in place of secrets, work through the findings in priority order, fix what can be fixed, document what cannot, and re-check after the fixes to confirm the list is empty or fully explained. Keep the final report with the change record, and carry the same rules into staging and production manifests alike. That routine catches the privileged container and the missing limit while they are still text, which is the cheapest place to catch them.
Related tools and reading: the JSON Studio and the XML Formatter cover neighbouring checks that pair naturally with this one, and the guide at [/blog/website-seo-audit-guide/] extends the same topic with further background and examples for readers who want to go deeper.
Key points
- A manifest can grant a container far more power than it needs
- Privileged mode, host access and root users are top findings
- Missing limits and missing policies are risks, not just gaps
- Never paste real secrets into a checker; use sample values
In short: A manifest's security settings decide how much power a container holds, and least privilege is the default to aim for. Review pasted manifests for privileged mode, host access, root users and missing limits, fix or document every finding, and re-check after fixing. Never paste real secrets.
One habit ties all of this together: re-check after every change. A result is only as current as the input it was run on, so a fix, a redesign, or a new version of the underlying material deserves a fresh run rather than reliance on an old report. Keep the previous result alongside the new one, note what changed between them, and treat any new finding as a question to investigate rather than a verdict to accept or dismiss. That loop of checking, fixing, re-checking and recording is what turns a one-off test into a reliable routine, and it costs far less time than debugging a problem that a second check would have caught early.