Container forensics

From jmagly/aiwg · View interactive version

Container forensics is an AI agent skill from the GitHub repository jmagly/aiwg. Forensic investigation of Docker, containerd/CRI-O, and Kubernetes — inventory, escape detection, eBPF runtime monitoring, RBAC and etcd audit. Use when investigating container compromise.

How to use this skill

Skill file

container-forensics

Investigates containerized environments for signs of compromise, misconfiguration, or container escape. Covers standalone Docker hosts and Kubernetes clusters. Produces a structured findings document with severity tagging.

Triggers

Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):

Purpose

Container environments introduce unique attack surfaces: privileged containers, host namespace access, writable image layers, and overpermissioned service accounts. Standard host forensics misses these vectors. This skill applies container-aware investigation procedures and maps findings to MITRE ATT&CK for Containers.

Behavior

When triggered, this skill:

  1. Detect environment type:
  1. Container inventory and privilege audit:
  1. Docker — image verification:
  1. Image layer analysis with dive:
  1. Docker — volume and filesystem inspection:
  1. Docker — socket and API exposure:
  1. Container escape indicators:
  1. eBPF runtime monitoring:
  1. Kubernetes — cluster-level audit:
  1. Kubernetes — RBAC audit:
  1. Kubernetes — pod security and network policy:
  1. etcd security audit (Kubernetes control-plane only):
  1. K8s API server audit log analysis (if audit logging is enabled):
  1. Write findings document:

Usage Examples

Example 1 — Docker host

docker investigation

Audits the local Docker daemon.

Example 2 — Kubernetes cluster

kubernetes forensics

Requires kubectl configured with appropriate credentials.

Example 3 — Inside a container

container forensics

Detects the container context and adjusts collection accordingly.

Output Locations

Configuration

container_forensics:
  dangerous_capabilities:
    - SYS_ADMIN
    - NET_ADMIN
    - SYS_PTRACE
    - SYS_MODULE
  sensitive_host_paths:
    - /
    - /etc
    - /var/run/docker.sock
    - /proc
    - /sys
    - /root
  high_value_namespaces:
    - kube-system
    - kube-public
    - default

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.