Repository navigation
Closed
Labels
Description
Problem
The agent treats active attacks like ordinary outages:
- There is no security incident type.
classify_issueroutes Falco's "Terminal shell in container" to k8s (because of "container"), "SSH brute force" to server (because of "ssh"), and anything unknown to server. The model then gets an SRE playbook ("restart the service, raise limits") for an intrusion. - Nothing looks for threats in the evidence.
SecurityScannerchecks configuration and compliance (privileged flags, secrets in manifests); it doesn't detect crypto miners, reverse shells, brute force or credential theft in alert text,raw_logsor the Lokialert_logsthe agent already fetches (feat: Grafana alerts, Loki logs, and bearer auth for Alertmanager #101). - Escalation has no security path. If the model reports a security incident as "resolved", nobody is paged.
Proposal (foundation)
securityincident type, checked before all others. Triggered by security alert names (falco, guardduty, intrusion, brute force, malware, cryptominer, reverse shell, privilege escalation, unauthorized access, …), by security sources (Falco, GuardDuty, Security Command Center, Defender, Wazuh, CrowdStrike), and by labels such assecurity,threatormitre_technique.- Deterministic threat detector (
collectors/threat_detector.py) over alert text and logs, with no LLM involved. Each finding has a MITRE ATT&CK technique, severity, the matching evidence lines (PII-scrubbed and capped) and extracted indicators (IPs):- SSH/auth brute force: repeated failed logins from one source, above a threshold
- crypto mining: xmrig,
stratum+tcp://, known pool hosts, cryptonight - reverse shells:
/dev/tcp/,nc -e,bash -i >&, socket-spawned shells,mkfifopipes - shell or exec in a container (Falco terminal shell,
pods/exec) - privileged or host-namespace pod creation
- credential access (
/etc/shadow, cloud credential files, service-account tokens) - download-and-execute (
curl | sh,wget -O- | bash) - cloud findings that name a threat (GuardDuty
UnauthorizedAccess:*,CryptoCurrency:*,Backdoor:*)
- Every incident is scanned. Findings are attached as
threat_findings, and an incident with a high-severity finding is re-typed tosecurity, even when it arrived as a disk or CPU alert. A miner shows up as "high CPU" first. - Security playbook prompt. Preserve evidence (never delete pods, files or logs), gather with read-only tools, propose containment only via approval, and notify. It's treated as never "resolved" by the agent alone.
- Always escalate security incidents (
ESCALATION_ON_SECURITY=true), at critical priority for high-severity findings. - A read-only
detect_threatstool, so the model can scan more logs it fetched (for example afterquery_logs). - A metric:
devops_agent_threat_findings_total{technique,severity}([FEATURE] Expose Prometheus /metrics for the agent itself (incidents, queue, tools, approvals, tokens) #125).
Out of scope (follow-ups)
- native Falco / GuardDuty / SCC / Defender webhooks
- approval-gated containment actions
- Kubernetes audit log and CloudTrail detections
Activity
OkiriGabriel commentedon Nov 14, 2026
Picking up this foundation issue now; PR to follow. The follow-ups are tracked separately (webhooks, containment, audit-trail detections).
Merge pull request #170 from open-devops-agent/feat/threat-detection-166
OkiriGabriel commentedon Nov 14, 2026
Follow-up #171 adds injection-attack detection (SQLi, command injection, Log4Shell, path traversal, SSRF to metadata, XSS, SSTI) with volume-aware severity, and prompt-injection hardening (#118).