/devops-skills:kubernetes-securityfrom devops-skills
Hardens Kubernetes clusters with RBAC least-privilege, Pod Security Standards, admission control via OPA/Kyverno, securityContext, secrets at rest, image provenance, and disabling default service-account automount. Use when asked about RBAC roles, pod security hardening, admission policies, or reducing compromised pod impact.
Ships in devops-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Kubernetes ships permissive by default: any pod gets a service-account token mountable for API access, RBAC starts wide open until you constrain it, and nothing stops a container from running as root unless you tell it not to. Security here is subtractive work — removing default permissions the platform hands out for convenience, not adding a product on top.
Assume every pod will eventually be compromised and ask what that gets the attacker. The right default is the least the workload needs to function, enforced at admission, not caught in review.
The most common RBAC mistake is binding ClusterRole: edit or cluster-admin because a narrower
role was fiddly to write. A Role/ClusterRole should list exact verbs (get, list, watch,
create) against exact resources — "can read Pods in this namespace" is a different, much smaller
grant than "edit everything."
kubectl auth can-i --list --as=<sa> rather than reading YAML and hoping — it's
the ground truth the API server actually enforces.iam-access-management.Done when: kubectl auth can-i --list for the workload's service account shows nothing beyond
what it demonstrably calls.
Every pod gets a service-account token mounted by default, whether or not it ever calls the Kubernetes API. That token is exactly what an attacker inside a compromised container reaches for first — disabling automount removes a capability most workloads never needed.
spec:
automountServiceAccountToken: false # set at pod or ServiceAccount level
Only workloads that genuinely call the API (controllers, operators — see operators-and-crds)
should have a token, and it should be bound to a ServiceAccount scoped by rule 1, not default.
Done when: automountServiceAccountToken: false is set for every workload that doesn't call the
Kubernetes API.
A securityContext written correctly once and never checked again drifts the moment someone copies
an old manifest. Pod Security Admission (the built-in restricted/baseline/privileged labels)
or an admission controller like Kyverno/OPA Gatekeeper turns "we ask people not to run as root" into
"the API server rejects it."
restricted profile requires non-root, no privilege escalation, a disallowed hostPath/hostPID,
and a defined seccomp profile — treat it as the namespace-wide floor, not an aspiration.:latest tags, require resource
limits) is what OPA/Kyverno add — write policies as code and test them like code; broader
organizational policy patterns live in policy-as-code.audit/warn first, watch violations in logs,
then flip to enforce — flipping straight to enforce breaks things you didn't know existed.Done when: every namespace has an enforced Pod Security Standard label, and no exceptions exist without an explicit, documented reason.
A Kubernetes Secret is base64, not encrypted, by default — anyone with get on it or etcd access
reads it in plaintext. Encryption at rest (EncryptionConfiguration on the API server, or a KMS
provider) and keeping actual secret material out of Git are separate problems that both need
solving.
secrets resources should be as tight as anything in rule 1 — read access to Secrets
is equivalent to read access to whatever they protect.secrets-management — this skill only covers the
in-cluster storage posture.Done when: encryption at rest is confirmed enabled and no application secret exists as a plaintext file in version control.
Scanning an image for CVEs (image-scanning) tells you what's inside it; provenance tells you the
image you're running is the one you built, not something swapped in the registry or a compromised
CI step. Without signature verification at admission, a scanned-clean image and a tampered one are
indistinguishable to the cluster.
supply-chain-security; this rule is only about what the admission controller checks before
scheduling.Done when: the admission controller rejects an unsigned or unverified image in a test run.
State the RBAC scope granted to each workload identity, whether automount is disabled by default, which Pod Security Standard is enforced per namespace, the secrets-at-rest encryption status, and whether image signature verification is active. Call out any namespace still in audit/warn mode instead of enforce, or any workload still holding broader RBAC than it uses — naming the gap beats implying the cluster is fully locked down.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub arjunprabhulal/devops-skills --plugin devops-skills88 skills in this plugin
/alertingCovers designing alerts that page a human only when a human needs to act — symptom-based alerting over cause-based, multi-window burn-rate alerts on error budgets, severity tiers that route between page/ticket/dashboard, requiring every page to link a runbook, and tuning out alert fatigue. Use this whenever the user is writing a new alert rule, asking why on-call is paged too often or missing real incidents, choosing an alert threshold, or designing severity routing. For the SLO the burn-rate math comes from use `slo-definition`, and for what a runbook should contain use `runbooks`./api-gatewayCovers the managed front-door pattern for APIs — request routing, centralized auth, rate limiting and quotas, request/response shaping, and recognizing when a gateway helps versus becomes a bottleneck or single point of failure. Use this whenever the user is designing an API entry point, adding rate limits or quotas, centralizing auth for several backend services, transforming a request between an external and internal contract, or debugging a gateway timeout. For east-west traffic between internal services use `service-connectivity`, and for token issuance details use `iam-access-management`./argocd-operationsCovers running Argo CD day to day — structuring app-of-apps, choosing sync policies and waves, reading health versus sync status correctly, and unsticking a degraded or hung Application. Use this whenever the user mentions Argo CD, an Application stuck "Progressing" or "OutOfSync," app-of-apps or ApplicationSets, sync waves and hooks, or asks why a deploy shows synced but the workload is unhealthy. For the underlying model this tool implements use `gitops`; for automated canary analysis on top of it use `progressive-delivery`; for the workloads it manages use `kubernetes-operations`./artifact-managementVersions, stores, and promotes build outputs — registries, immutability, build-once-promote-many, retention and garbage collection, and provenance metadata. Use this whenever the user sets up an artifact or container registry, asks how to promote a build between environments without rebuilding, needs a retention or cleanup policy, or wants to trace where an artifact came from. For an image's contents and size use `image-optimization`; for vulnerability scanning use `image-scanning`./autoscalingCovers scaling Kubernetes workloads and nodes to demand — HPA on the right metric, VPA, cluster autoscaler, custom/external metrics, avoiding thrash with stabilization windows, and requests as the foundation underneath it all. Use this whenever the user is configuring an HPA, deciding between HPA and VPA, debugging autoscaling that flaps, or sizing a cluster autoscaler. For the requests/limits autoscaling depends on use `kubernetes-operations`; for cost tradeoffs use `cost-optimization`./backup-and-restoreDefines the discipline of building backups you can actually restore under pressure — RPO-driven frequency, restores rehearsed on a schedule, offsite immutable copies, encryption, and treating a backup that has never been restored as equivalent to no backup at all. Use this whenever the user sets up a backup job, chooses a retention policy, argues about RPO or RTO, asks whether current backups are enough, or plans for ransomware or accidental deletion. For the wider recovery plan use `disaster-recovery`, and for stateful platform durability use `stateful-workloads`.