mirror of
https://github.com/mukul975/Anthropic-Cybersecurity-Skills.git
synced 2026-07-24 05:30:58 +03:00
- Add validated mitre_attack frontmatter to all 754 skills (286 distinct techniques), verified against MITRE ATT&CK v19.1 via the official mitreattack-python library: 0 revoked, deprecated, or invalid IDs - Curate precise per-skill technique IDs for forensics, malware-analysis, threat-intel, and red-team skills (e.g. DCSync -> T1003.006, Kerberoasting -> T1558.003, Pass-the-Ticket -> T1550.003) - Reconcile v19.1 tactic restructuring: Defense Evasion split into Stealth (TA0005) and Defense Impairment (TA0112); revoked T1562.* family and T1070.001/.002 remapped to active equivalents (T1685.*) - Normalize word-split tags across 35 skills (remove filename-derived stopword tags, add semantic cybersecurity tags) - Add api-reference.md for 3 skills that were missing it - Update README ATT&CK section with accurate v19.1 tactic distribution
83 lines
2.3 KiB
Markdown
83 lines
2.3 KiB
Markdown
---
|
|
name: performing-container-escape-detection
|
|
description: 'Detects container escape attempts by analyzing namespace configurations,
|
|
privileged container checks, dangerous capability assignments, and host path mounts
|
|
using the kubernetes Python client. Identifies CVE-2022-0492 style escapes via cgroup
|
|
abuse. Use when auditing container security posture or investigating escape attempts.
|
|
|
|
'
|
|
domain: cybersecurity
|
|
subdomain: container-security
|
|
tags:
|
|
- container-security
|
|
- container-escape
|
|
- privileged-container
|
|
- namespace-analysis
|
|
- linux-capabilities
|
|
- threat-detection
|
|
version: '1.0'
|
|
author: mahipal
|
|
license: Apache-2.0
|
|
nist_csf:
|
|
- PR.PS-01
|
|
- PR.IR-01
|
|
- ID.AM-08
|
|
- DE.CM-01
|
|
mitre_attack:
|
|
- T1610
|
|
- T1611
|
|
- T1609
|
|
- T1525
|
|
---
|
|
|
|
# Performing Container Escape Detection
|
|
|
|
|
|
## When to Use
|
|
|
|
- When conducting security assessments that involve performing container escape detection
|
|
- When following incident response procedures for related security events
|
|
- When performing scheduled security testing or auditing activities
|
|
- When validating security controls through hands-on testing
|
|
|
|
## Prerequisites
|
|
|
|
- Familiarity with container security concepts and tools
|
|
- Access to a test or lab environment for safe execution
|
|
- Python 3.8+ with required dependencies installed
|
|
- Appropriate authorization for any testing activities
|
|
|
|
## Instructions
|
|
|
|
Audit Kubernetes pods for container escape vectors including privileged mode,
|
|
dangerous capabilities, host namespace sharing, and writable hostPath mounts.
|
|
|
|
```python
|
|
from kubernetes import client, config
|
|
config.load_kube_config()
|
|
v1 = client.CoreV1Api()
|
|
|
|
pods = v1.list_pod_for_all_namespaces()
|
|
for pod in pods.items:
|
|
for container in pod.spec.containers:
|
|
sc = container.security_context
|
|
if sc and sc.privileged:
|
|
print(f"PRIVILEGED: {pod.metadata.namespace}/{pod.metadata.name}")
|
|
```
|
|
|
|
Key escape vectors:
|
|
1. Privileged containers (full host access)
|
|
2. CAP_SYS_ADMIN capability
|
|
3. Host PID/Network/IPC namespace sharing
|
|
4. Writable hostPath mounts to / or /etc
|
|
5. Docker socket mount (/var/run/docker.sock)
|
|
|
|
## Examples
|
|
|
|
```python
|
|
# Check for docker socket mounts
|
|
for vol in pod.spec.volumes or []:
|
|
if vol.host_path and "docker.sock" in (vol.host_path.path or ""):
|
|
print(f"Docker socket exposed: {pod.metadata.name}")
|
|
```
|