Repository navigation
feat(security): falco ebpf runtime security and anomaly streamer (#113) - #214
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical live-collection failure handling and moderate validation, duration, export, severity, and sanitization issues block approval.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds a Kubernetes Falco eBPF runtime-security and syscall-anomaly stream with simulated/live collection, filtering, Rich/JSON output, CLI access, and FastMCP integration.
Changes:
- Adds Falco security-stream models, severity configuration, and processing.
- Registers CLI and MCP interfaces.
- Adds tests and updates help, documentation, references, and task tracking.
Unresolved issues include live-collection error handling, input and duration bounds, export-directory creation, severity validation, output/log sanitization, and configuration/task-tracking nits.
File summaries
| File | Description |
|---|---|
tests/test_k8s_security_stream.py |
Tests parsing, filtering, CLI, and MCP behavior. |
src/devops_cli/models/k8s.py |
Defines security-stream request/result models. |
src/devops_cli/lang/en/help.py |
Adds CLI help text. |
src/devops_cli/k8s/security_stream.py |
Implements Falco parsing, streaming, filtering, and rendering. |
src/devops_cli/config/defaults.py |
Defines stream defaults. |
src/devops_cli/config/constants.py |
Defines the severity hierarchy. |
src/devops_cli/commands/k8s/diagnostics.py |
Implements the CLI command and JSON export. |
src/devops_cli/commands/k8s/__init__.py |
Registers the Kubernetes command. |
src/devops_cli/ai/mcp/server.py |
Adds the FastMCP tool. |
README.md |
Updates the CLI command matrix. |
docs/MCP_TOOLS.md |
Documents the MCP tool. |
docs/commands/k8s.md |
Documents Kubernetes command options. |
docs/CLI_REFERENCE.md |
Updates the CLI reference. |
docs/agent/tasks/task-113-falco-ebpf-runtime-security.md |
Tracks implementation and acceptance criteria. |
Review details
Suppressed comments (4)
src/devops_cli/ai/mcp/server.py:1763
- This new MCP tool does not apply the integer-bound validation used by the other numeric tools. Callers can pass negative values, including
--tail=-1(all logs), or arbitrarily large values, causing unbounded kubectl output and avoidable memory/timeout pressure. Reject values below one and enforce a project-approved upper bound before building the command.
_validate_mcp_arg("namespace", namespace)
src/devops_cli/commands/k8s/diagnostics.py:257
- This writes directly to the requested path, so
--output reports/alerts.jsonfails whenreports/does not already exist. Other exporters create the parent directory before writing; the documented JSON export should do the same.
output.write_text(format_json(dumped), encoding="utf-8")
src/devops_cli/k8s/security_stream.py:227
- This logs raw external
kubectlstderr without the repository's required secret/private-data masking. Cluster error output can contain sensitive endpoints or other data and is persisted through application logs; sanitize the bounded stderr sample withmask_secretsbefore logging it.
logger.debug("kubectl logs failed: %s", proc.stderr[:256])
src/devops_cli/k8s/security_stream.py:264
- The color mapping repeats the same hardcoded severity groups instead of using
CONST_FALCO_SEVERITY_LEVELS, so it can disagree with filtering and counting when the severity map changes. Use rank thresholds from the canonical map here as well.
if prio in ("CRITICAL", "EMERGENCY", "ALERT"):
return "bold red"
if prio in ("WARNING", "ERROR"):
return "bold yellow"
return "bold blue"
- Files reviewed: 14/14 changed files
- Comments generated: 7
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
* feat(release): v0.2.18 * fix(security): harden secret sanitizer boundaries and safe path exclusions (#116) (#203) * fix(security): harden secret sanitizer boundaries and safe path exclusions (#116) * fix(release): default release PRs to draft mode * fix(security): harden secret boundaries, remove extension lookahead, and update task status (#116) * fix(security): remediate devsecops findings and add native rate management (#204) * test * fix(security): remediate devsecops findings and add native rate management * docs(task): update task-204 status to in review and link PR #204 * fix(security): permit token masking in filesystem path arguments * fix(security): remediate review findings, exclude home in sandbox, and relocate MockProvider (#205) (#206) * fix(security): remediate review findings, exclude home in sandbox, and relocate MockProvider (#205) * docs(task): update task-205 status to in review and link PR #206 * test(sandbox): provide explicit tmp_path workspace_dir in test_docker_sandbox_wait_timeout * fix(rag): support both gitignore and gitwildmatch pathspec factories * feat(sandbox): multi-tier networking options and decommission task.md (#207) (#208) * feat(sandbox): multi-tier networking options and decommission task.md index (#207) * docs(agent): transition task 207 to in-review with PR #208 * test(projects): update test fixtures to eliminate task.md references * fix(security): replace concrete RFC 1918 and internal homelab endpoints with standard documentation values * fix(sandbox): harden network containment, secret output masking, and rate limiter caching * fix(sandbox): remediate egress containment, dns resolution, and output masking findings (#207) * fix(security): stream sandbox container output directly to sys streams avoiding logger sink cleartext alerts (#207) * docs(agents): mandate working pull requests from oldest to newest (FIFO) * docs(roadmap): add v0.2.23 reactive workstation command center and interactive TUI * docs(agents): mandate root-cause remediation, roadmap synthesis, and interaction improvement * fix(docs): escape placeholder angle brackets and prune completed roadmap matrix items * fix(security): stream sandbox output via centralized output writers to resolve codeql cleartext alerts * fix(k8s): uncap ollama memory limits and elevate daemonset/deployment thresholds (#209) (#210) * fix(k8s): uncap ollama memory limits and elevate daemonset/deployment thresholds (#209) * fix(k8s): add CoreDNS resource configs and tighten test assertions (#209) * fix(github): enforce gh request throttling, disk quota persistence, and diff-only project sync (#211) (#212) * fix(github): enforce window-budgeted rate pacing, disk quota persistence, and diff-only project sync (#211) * docs(agent): record PR #212 in task 211 tracking * fix(github): enforce low-quota circuit breakers, preamble-tolerant JSON parsing, and casing-safe project diffing (#211) * fix(github): replace quota thresholds with logical exponential backoff (#211) * test(github): patch run_gh instead of run_subprocess in reconcile tests (#211) * fix(github): derive rate limit pacing from actual response values without hardcoded windows (#211) * fix(ci): stop running all of the ci tasks every time a pr is marked ready for review. * fix(ci): decouple project automation into dedicated workflow and add quota safety guards (#211) * fix(github): align rate limiter baseline velocity and add quota test coverage (#211) * refactor(ai): eliminate inline function parameter defaults in favor of defaults submodule * fix(github): enforce strict non-negative rate quotas, 25% threshold, and remediate review findings (#211) * fix(typecheck): resolve Path None guard and optional quota remaining in mypy (#211) * docs: refresh CLI and MCP references for updated commands and errors (#211) * fix(ci): enforce mandatory pre-push devops ci gate, handle unauthenticated acquire, and expand test coverage (#211) * fix(pr): align checks fallback to run_subprocess and isolate rate limiter sleep test (#211) * fix(ci): complete pre-push gate, argo drift tests, and coverage expansion (#211) * docs(agent): update task-211 documentation with linear window pacing and pre-push quality gate (#211) * fix(pr): guard pr ready against failing checks and fix project automation uv sync (#211) * docs(pr): update cli and mcp reference for pr ready --force * fix(github): address pr 212 review comments on workflows, sandbox, defaults, and rate limiter (#211) * fix(security): derive artifact version from package metadata and validate whitelist tokens (#211) * feat(security): sigstore cosign container provenance and image signing (#112) (#213) * fix(ci): prune all merged PR devcontainer images from ghcr and guard in-flight builds * feat(security): sigstore cosign container provenance and image signing (#112) * docs(agent): link PR 213 in task 112 tracking doc * fix(security): resolve review comments for cosign container provenance (#112) * ci: re-trigger validation after resolving all review threads * feat(security): falco ebpf runtime security and anomaly streamer (#113) (#214) * feat(security): falco ebpf runtime security and anomaly streamer (#113) * fix(security): resolve review comments for falco ebpf runtime security (#113) * chore: retrigger validation after resolving all review threads * feat(security): distributed threat intelligence valkey l2 cache and radar batching (#122) (#215) * feat(security): distributed threat intelligence valkey l2 cache and radar batching (#122) * fix(security): resolve review comments for threat intel valkey l2 cache and batching (#122) * chore: retrigger validation after resolving all review threads * perf(github): adjust rate limit no-delay used threshold to 30%
Summary
devops k8s security-stream(feat(security): falco ebpf runtime security and anomaly streamer (devops k8s security-stream) #113).k8s_security_streamfor agentic operational inspection.tests/test_k8s_security_stream.pyand 10/10 local CI gates certified.