SAASMENT

Security skill · Find and fix

Kubernetes and Helm manifest review.

Review Kubernetes manifests and Helm charts for security misconfiguration, including privileged and root containers, host access, missing security contexts, over-broad RBAC, exposed services, absent network policies, plaintext secrets, and unpinned images, then fix with secure defaults and verify with server-side dry runs and policy checks. Use when auditing a cluster's workloads, a Helm chart or its values, or a pull request that changes Kubernetes configuration.

Download .zipInstall via MCPFind and fixMIT
  • Misconfiguration

Facts

Category
Find and fix
License
MIT
Tags
  • Misconfiguration
Version
1.0.0
Last updated
2026-12-02
Folder
kubernetes-helm-manifest-review/
MCP resource
skill://kubernetes-helm-manifest-review/SKILL.md
Files
  • SKILL.md
  • LICENSE
  • references/k8s-checks.md
Standards

Original Saasment content. Saasment is in early access; this skill does not require joining it.

Install via MCP or as files

Connect your client to https://www.saasment.com/api/mcp (see client setup) and call get_skill:

{
  "name": "get_skill",
  "arguments": {
    "slug": "kubernetes-helm-manifest-review"
  }
}

Or download the .zip and unpack it into your agent's skills directory:

Terminal, from your project root (user-level: ~/.cursor/skills)

mkdir -p .cursor/skills
curl -fsSL https://www.saasment.com/ai-security/skills/kubernetes-helm-manifest-review/download.zip -o /tmp/kubernetes-helm-manifest-review.zip
unzip -o /tmp/kubernetes-helm-manifest-review.zip -d .cursor/skills
# result: .cursor/skills/kubernetes-helm-manifest-review/SKILL.md

Review SKILL.md before enabling a skill. Skills are instructions your agent will follow.

SKILL.md

---
name: kubernetes-helm-manifest-review
description: Review Kubernetes manifests and Helm charts for security misconfiguration, including privileged and root containers, host access, missing security contexts, over-broad RBAC, exposed services, absent network policies, plaintext secrets, and unpinned images, then fix with secure defaults and verify with server-side dry runs and policy checks. Use when auditing a cluster's workloads, a Helm chart or its values, or a pull request that changes Kubernetes configuration.
license: MIT
metadata:
  author: Saasment
  version: "1.0.0"
  category: both
  tags: "misconfiguration"
---

# Kubernetes manifest and Helm review (find and fix)

License: MIT. Copyright (c) 2026 Saasment. Source: https://www.saasment.com/ai-security/skills/kubernetes-helm-manifest-review

Kubernetes gives workloads wide freedom by default: containers can run as root, mount the host, reach every other pod, and use a service account token that may carry real permissions. Most findings are therefore settings that were never tightened. This skill reviews the manifests and rendered Helm output, fixes them with secure defaults, and verifies with a dry run and a policy check. It goes deeper on Kubernetes than the general `iac-misconfig-review`.

## When to use

- You audit workloads in a cluster or a repository of manifests, Kustomize overlays, or Helm charts.
- A pull request changes a Deployment, DaemonSet, Role, Ingress, Service, or chart values.
- You need to adopt a baseline such as the Pod Security Standards.

## Safe by default

- Review only clusters and repositories you own or are authorized to assess. Use a read-only kubeconfig or review the files offline.
- Render charts locally (`helm template`) and read the output. Do not `helm install`, `helm upgrade`, or `kubectl apply` against a cluster you do not own, or against production outside your change process.
- Use `kubectl get` and `describe` for discovery. Do not use `kubectl exec`, `port-forward`, or secret reads (`kubectl get secret -o yaml`) as part of a review; check that secrets exist and who can read them instead.
- Treat third-party charts as code to be reviewed: read templates and hooks before installing. Pin chart and image versions.
- Tightening a security context can stop a workload from starting. Test in a non-production namespace first.

## Procedure

1. **Inventory.** List namespaces, workloads, charts and versions, and where each chart's values come from. Render every chart with each environment's values: see `references/k8s-checks.md` for commands.
2. **Run automated checks** on the rendered manifests: a manifest linter, a policy scanner, and a server-side dry run. Save machine-readable output and treat it as leads to confirm.
3. **Review pod and container settings.** For each workload check:
   - `privileged: true`, added Linux capabilities, `allowPrivilegeEscalation`, and `hostPID`, `hostIPC`, `hostNetwork`.
   - `hostPath` volumes, the container runtime socket mounted into a pod, and writable mounts of sensitive host paths.
   - `runAsNonRoot` and a non-zero user, `readOnlyRootFilesystem`, `capabilities.drop: ["ALL"]`, and a `seccompProfile` of `RuntimeDefault`.
   - Resource requests and limits, so one workload cannot starve others.
   - Images pinned by digest or exact version from a trusted registry, never `latest`; a pull policy that matches.
4. **Review service accounts and RBAC.** Each workload uses its own service account; `automountServiceAccountToken` is false unless the pod calls the API; Roles list specific verbs and resources; no wildcard verbs or resources; cluster-wide bindings and bindings to `system:authenticated` or groups that are too wide are justified; permissions to read secrets, create pods, or bind roles are treated as high risk.
5. **Review exposure.** Services of type `LoadBalancer` or `NodePort` and Ingress rules that are not meant to be public; administrative UIs (dashboards, metrics, debug ports) reachable from outside; TLS on ingress; the API server and kubelet endpoints not open to the internet.
6. **Review network policy.** Namespaces have a default-deny ingress policy and, where possible, egress policy, with explicit allows. Confirm your network plugin enforces policies.
7. **Review secrets and configuration.** No credentials in `env:` literals, ConfigMaps, values files, or chart defaults; secrets come from an external secret manager or are encrypted at rest and in Git; etcd encryption at rest is enabled for cluster-managed secrets.
8. **Review Helm specifics.** Values that disable security features (`securityContext: {}`, `rbac.create` with wide roles), hooks that run jobs with elevated rights, templates that build RBAC from values, chart provenance and signature checks, and subcharts with their own defaults.
9. **Fix.** Prefer namespace-level enforcement (Pod Security admission labels at `baseline` then `restricted`) plus explicit per-workload security contexts. Add default-deny network policies and narrow RBAC. Bake safe defaults into chart templates so values cannot silently remove them.
10. **Prevent regressions.** Run the linter and policy scan in CI on rendered output, and add an admission policy to block privileged pods, `latest` tags, and untrusted registries.

## Verification

- Confirm a finding by showing the rendered manifest line (for example `privileged: true`) and, in a cluster you own, the live object (`kubectl get pod <name> -o jsonpath='{.spec.containers[*].securityContext}'`).
- Confirm a fix with `helm template` and the policy scanner: the finding is gone and no new ones appear. Confirm `kubectl apply --dry-run=server` accepts the manifests in a test namespace, and that the workload becomes ready there.
- Confirm network policy by running a short-lived test pod you create in a test namespace and checking that a connection to a denied destination fails while an allowed one succeeds.
- Confirm RBAC with `kubectl auth can-i --as=system:serviceaccount:<ns>:<sa> <verb> <resource>` for a few sensitive actions (expect "no") and the required ones (expect "yes").
- Confirm admission enforcement by attempting to apply a deliberately non-compliant test pod in a scratch namespace and verifying it is rejected.

## Reporting

Table: finding id, namespace and workload (or chart and template), setting, risk, fix, verification result. List charts and clusters not reviewed and policy exceptions with owner and review date.

## References

- Kubernetes Pod Security Standards: https://kubernetes.io/docs/concepts/security/pod-security-standards/
- Kubernetes RBAC good practices: https://kubernetes.io/docs/concepts/security/rbac-good-practices/
- Kubernetes network policies: https://kubernetes.io/docs/concepts/services-networking/network-policies/
- Helm chart provenance and integrity: https://helm.sh/docs/topics/provenance/
- OWASP Kubernetes Security Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/Kubernetes_Security_Cheat_Sheet.html
- Companion skills: `iac-misconfig-review`, `docker-image-security-review`, `secrets-in-repo-scan-and-rotation`.

Helper files

LICENSE
MIT License

Copyright (c) 2026 Saasment

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
references/k8s-checks.md
# Kubernetes and Helm checks

License: MIT. Copyright (c) 2026 Saasment.

Tool flags change between versions. Check `--help`. Commands below read files or call read-only cluster APIs unless noted.

## Render and scan

```bash
# Render a chart with each environment's values (no cluster needed)
helm lint ./chart -f values-prod.yaml
helm template my-release ./chart -f values-prod.yaml > /tmp/rendered-prod.yaml

# Lint and policy-scan the rendered output
kube-linter lint /tmp/rendered-prod.yaml
trivy config /tmp/rendered-prod.yaml
checkov -f /tmp/rendered-prod.yaml --framework kubernetes

# Server-side dry run in a cluster and namespace you own (changes nothing)
kubectl apply --dry-run=server -n test-namespace -f /tmp/rendered-prod.yaml
```

## Read-only discovery in a cluster you are authorized to review

```bash
# Privileged containers and host namespaces across all namespaces
kubectl get pods -A -o json | jq -r '
  .items[] | select(
    (.spec.hostNetwork == true) or (.spec.hostPID == true) or (.spec.hostIPC == true) or
    (.spec.containers[]?.securityContext.privileged == true)
  ) | "\(.metadata.namespace)/\(.metadata.name)"'

# Cluster-wide role bindings, then inspect the broad ones
kubectl get clusterrolebindings -o wide
kubectl describe clusterrole <name>

# What a service account may do
kubectl auth can-i --list --as=system:serviceaccount:<ns>:<sa> -n <ns>

# Services and ingresses that face outside the cluster
kubectl get svc -A | grep -E 'LoadBalancer|NodePort'
kubectl get ingress -A

# Namespaces without network policies, and Pod Security labels
kubectl get networkpolicy -A
kubectl get ns --show-labels | grep pod-security
```

## Hardened container example

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: example-api
spec:
  replicas: 2
  selector:
    matchLabels: { app: example-api }
  template:
    metadata:
      labels: { app: example-api }
    spec:
      serviceAccountName: example-api
      automountServiceAccountToken: false
      securityContext:
        runAsNonRoot: true
        seccompProfile: { type: RuntimeDefault }
      containers:
        - name: api
          image: registry.example.test/example/api@sha256:<digest>   # placeholder registry and digest
          securityContext:
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
            capabilities: { drop: ["ALL"] }
          resources:
            requests: { cpu: 100m, memory: 128Mi }
            limits: { memory: 256Mi }
          volumeMounts:
            - { name: tmp, mountPath: /tmp }
      volumes:
        - { name: tmp, emptyDir: {} }
```

## Default-deny network policy

```yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: default-deny
  namespace: example
spec:
  podSelector: {}
  policyTypes: ["Ingress", "Egress"]
```

Add explicit allow policies for the traffic each workload needs, including DNS egress.

## Namespace enforcement

```bash
# Warn and audit first, then enforce, using Pod Security admission labels
kubectl label ns example pod-security.kubernetes.io/warn=restricted pod-security.kubernetes.io/audit=restricted
kubectl label ns example pod-security.kubernetes.io/enforce=baseline
```

Move `enforce` to `restricted` when warnings are clear.

## Risky settings quick table

| Setting | Risk |
| --- | --- |
| `privileged: true` | Container has nearly host-level access |
| `hostPath` to `/`, `/var/run`, or the container runtime socket | Container can control the node or other containers |
| `hostNetwork`, `hostPID`, `hostIPC` | Breaks isolation from the node |
| No `runAsNonRoot`, no dropped capabilities | Larger impact if the app is compromised |
| `automountServiceAccountToken` left on without need | Token available to any code in the pod |
| ClusterRole with `*` verbs or resources, or `secrets` read access | Cluster-wide takeover path |
| Service type `LoadBalancer` for an internal tool | Unintended internet exposure |
| No NetworkPolicy | Any pod reaches any other pod |
| Image tag `latest` or an unknown registry | Unpredictable and unverified code |
| Credentials in `env.value`, ConfigMaps, or values files | Readable by anyone with config access and stored in Git |

Related

Companion skills

Questions

How do I install the Kubernetes and Helm manifest review skill?

Download https://www.saasment.com/ai-security/skills/kubernetes-helm-manifest-review/download.zip and unzip it into your agent's skills directory (for example .cursor/skills, .claude/skills, .agents/skills, or .github/skills) so that kubernetes-helm-manifest-review/SKILL.md exists. Or connect to https://www.saasment.com/api/mcp and call the get_skill tool with the slug kubernetes-helm-manifest-review.

What license is the Kubernetes and Helm manifest review skill under?

It is original Saasment content under the MIT license, stated in the SKILL.md frontmatter and in the LICENSE file in the skill folder.

Is it safe to run this skill?

A skill is a set of instructions your agent follows, so read SKILL.md first. It tells the agent to test only systems you own or are authorized to test, to use test environments and synthetic data, and to avoid destructive probes. Downloading it does not run any code on your machine.

← All security skills

Try the platform.

Open the demo workspace with mock data. No login. Register from the banner when you want early access. No security team. No call.

Try the platform