detecting-container-drift-at-runtime

Detect unauthorized binary execution and filesystem changes in running containers using Falco rules.

954|172|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/xalgord/xalgorix --skill detecting-container-drift-at-runtime
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: detecting-container-drift-at-runtime
Source: https://github.com/xalgord/xalgorix/tree/main/internal/tools/skills/data/container-security/detecting-container-drift-at-runtime
Command: npx skills add https://github.com/xalgord/xalgorix --skill detecting-container-drift-at-runtime

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Running containers that deviate from their original image state—through dropped binaries, package installs, or file writes—are a strong indicator of compromise, but these changes are hard to spot without dedicated runtime monitoring. This Skill provides ready-to-use detection rules and procedures to surface container drift before attackers establish persistence.

Core Features & Use Cases

  • Falco Drift Detection Rules: Pre-built rules for detecting new binary execution, interactive shells, package manager usage, and filesystem writes inside containers.
  • Kubernetes Hardening Guidance: Configurations for readOnlyRootFilesystem, Pod Security Standards, and image digest verification to enforce immutability.
  • Detection Gap Analysis: Documents known evasion techniques (fileless execution via memfd_create, interpreter abuse, writable volumeMounts) and how to validate rule coverage.
  • Use Case: A SOC analyst investigating a suspicious pod uses the Falco rules to confirm a binary was executed from the container's upper layer, then follows the drift response playbook to isolate the pod with a NetworkPolicy and evict it.

Quick Start

Ask the AI to generate Falco rules that detect new binary execution and shell spawns in Kubernetes containers, then validate them by exec-ing into a test pod and running a dropped payload.

Frequently Asked Questions about detecting-container-drift-at-runtime

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect container drift at runtime in Kubernetes?

Deploy Falco with rules that flag spawned processes where proc.is_exe_upper_layer is true, indicating a binary not present in the original image. Complement this with rules for shell spawns, package manager execution, and unexpected file writes to the container filesystem.

What Falco rules detect new binary execution in containers?

A rule matching spawned_process and container with proc.is_exe_upper_layer = true detects binaries written to the overlay upper layer. Add a second rule matching proc.name in (bash, sh, dash, zsh) to catch interactive shells spawned outside the container entrypoint.

Does readOnlyRootFilesystem fully prevent container drift?

No. Writable volumeMounts such as /tmp or cache directories remain legitimate write targets where attackers can stage payloads. Combine readOnlyRootFilesystem with Falco file-write rules and digest verification for broader coverage.

Why does container drift detection miss fileless malware?

Rules based on proc.is_exe_upper_layer only catch binaries written to the overlay upper layer. Payloads executed via memfd_create or from emptyDir/tmpfs mounts run from different layers, so add proc.cmdline content matching for interpreters like python -c or node -e.

How do I validate that Falco drift detection rules fire correctly?

Exec into a test pod with kubectl, download a payload with curl, make it executable, and run it. Confirm the Drift Detected and Container Shell Spawned rules emit alerts, then repeat with the binary dropped into a mounted emptyDir to verify the known coverage gap.

Can Microsoft Defender for Containers detect binary drift on AKS?

Yes. Microsoft Defender for Containers provides built-in binary drift detection with the K8S.NODE_ImageBinaryDrift alert type, which fires when a binary not part of the original image executes and includes remediation steps like enabling readOnlyRootFilesystem.