Skip to content
Skillpedia
Agents35k · #5650

detecting-container-escape-attempts

Enables your agent to identify container escape attempts, where malicious code tries to break out of the isolated environment.

What it does

This tool helps identify when someone tries to break out of an isolated container to access the main system or other containers. It monitors suspicious activities like system manipulation, misuse of permissions, and access to sensitive files.

When to use it

  • ✓Investigating a potential container escape attack.
  • ✓Setting up systems to monitor escape attempts.
  • ✓Checking if security is covering known escape techniques.

Example of what to ask your AI

“Detect if a container is trying to access the Docker socket.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-container-escape-attempts/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-container-escape-attempts/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

It works by monitoring system calls and process activities within containers. If something unusual is detected, like trying to access host system files, an alert is generated.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill detecting-container-escape-attempts

Or download just the file:

curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/detecting-container-escape-attempts/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Detecting Container Escape Attempts

Overview

Container escape is a critical attack technique where an adversary breaks out of container isolation to access the host system or other containers. Detection involves monitoring for escape indicators such as namespace manipulation, capability abuse, kernel exploits, mounted sensitive paths, and anomalous syscall patterns using runtime security tools like Falco, Sysdig, and custom seccomp/audit rules.

When to Use

  • When investigating security incidents that require detecting container escape attempts
  • When building detection rules or threat hunting queries for this domain
  • When SOC analysts need structured procedures for this analysis type
  • When validating security monitoring coverage for related attack techniques

Prerequisites

  • Linux host with kernel 5.10+ (eBPF support)
  • Falco 0.37+ installed (kernel module or eBPF probe)
  • Docker Engine or containerd runtime
  • auditd configured
  • Root access for eBPF/kernel module loading

Core Concepts

Common Container Escape Vectors

Vector Technique MITRE ID
Privileged containers Mount host filesystem, load kernel modules T1611
Docker socket mount Create privileged container from within T1610
Kernel exploits CVE-2022-0185 (fsconfig), Dirty Pipe, runc CVEs T1068
Capability abuse CAP_SYS_ADMIN, CAP_SYS_PTRACE, CAP_NET_ADMIN T1548
Sensitive mounts /proc/sysrq-trigger, /proc/kcore, cgroup release_agent T1611
Namespace escape nsenter, unshare to host namespaces T1611
Symlink/bind mount Escape through /proc/self/root T1611

Detection Layers

  1. Syscall monitoring - eBPF/kernel module captures syscalls in real-time
  2. File integrity - Detect modification of escape-enabling paths
  3. Process monitoring - Track process creation, namespace changes
  4. Network monitoring - Detect container-to-host connections
  5. Audit logging - Linux auditd for capability and mount operations

Workflow

Step 1: Deploy Falco for Runtime Detection

# falco-values.yaml for Helm deployment
falco:
  driver:
    kind: ebpf   # or modern_ebpf for kernel 5.8+
  rules_files:
    - /etc/falco/falco_rules.yaml
    - /etc/falco/falco_rules.local.yaml
    - /etc/falco/rules.d
  json_output: true
  json_include_output_property: true
  http_output:
    enabled: true
    url: "http://falcosidekick:2801"
  grpc:
    enabled: true
  priority: warning
# Install Falco via Helm
helm repo add falcosecurity https://falcosecurity.github.io/charts
helm install falco falcosecurity/falco \
  --namespace falco-system --create-namespace \
  -f falco-values.yaml

Step 2: Custom Falco Rules for Escape Detection

# /etc/falco/rules.d/container_escape.yaml

# Detect container escape via privileged container
- rule: Container Escape via Privileged Mode
  desc: Detect attempts to escape container using privileged capabilities
  condition: >
    spawned_process and container and
    (proc.name in (nsenter, unshare, mount, umount, modprobe, insmod) or
     (proc.name = chroot and proc.args contains "/host"))
  output: >
    Container escape attempt via privileged operation
    (user=%user.name container=%container.name image=%container.image.repository
     command=%proc.cmdline pid=%proc.pid %container.info)
  priority: CRITICAL
  tags: [container, escape, T1611]

# Detect Docker socket access from container
- rule: Container Access to Docker Socket
  desc: Detect container reading/writing to Docker socket
  condition: >
    (open_read or open_write) and container and
    fd.name = /var/run/docker.sock
  output: >
    Docker socket accessed from container
    (user=%user.name container=%container.name image=%container.image.repository
     fd=%fd.name command=%proc.cmdline %container.info)
  priority: CRITICAL
  tags: [container, escape, docker_socket]

# Detect sensitive proc filesystem access
- rule: Container Access to Sensitive Proc Paths
  desc: Detect container accessing host-sensitive proc paths
  condition: >
    open_read and container and
    (fd.name startswith /proc/sysrq-trigger or
     fd.name startswith /proc/kcore or
     fd.name startswith /proc/kmsg or
     fd.name startswith /proc/kallsyms or
     fd.name startswith /sys/kernel)
  output: >
    Sensitive proc/sys access from container
    (user=%user.name container=%container.name path=%fd.name

…
FAQ

What is 'container escape'?

It's when an attacker manages to break out of a container's isolated environment to access the system it's running on or other containers.

What tools are used?

Tools like Falco, Sysdig, auditd, and EDRs (Endpoint Detection and Response) can be used to collect the necessary data.

Do I need advanced technical knowledge to use it?

The tool is designed to help understand and investigate these events, but the initial setup of the monitoring tools might require technical expertise.

Details

Original description by the author

Detects container escape at runtime across tooling - namespace manipulation, capability abuse, kernel exploits, sensitive host mounts, and anomalous syscalls - and explains which signals matter regardless of whether Falco, Sysdig, auditd, or an EDR is doing the collection. Use when deciding what breakout behaviour to monitor, investigating a suspected Docker or Kubernetes breakout, or comparing es

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularity

GitHub stars
35k
Ranking position
#5650
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills