Write a Falco custom rule to detect suspicious exec inside a container

domain: falco.org · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create a custom rules file (e.g., custom_rules.yaml) alongside the default Falco rules directory
  2. Define a list for trusted images and a macro for container context using the `list` and `macro` keywords
  3. Write a rule with `condition: evt.type = execve and container and not proc.name in (trusted_procs)` and set `priority: WARNING`
  4. Set `output` to include `%container.id`, `%proc.name`, `%proc.cmdline`, and `%user.name` for actionable alerts
  5. Mount the custom rules file into the Falco pod or reference it in `falco.yaml` under `rules_file`
  6. Restart Falco and verify rule loading with `falco --dry-run` or by checking startup logs for rule parse errors

Known gotchas

Related routes

Write Falco rules using proc.cmdline and fd.name field selectors to detect credential file reads
falco.org · 6 steps · unrated
Write a Falco custom rule using macros and lists to detect outbound network connections from web server processes
falco.org · 6 steps · unrated
Configure Falco macros and lists for reusable container-aware conditions across multiple rules
falco.org · 5 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans