// ThreatDeck detection pack (esql) version 2026.11.22-ce61b79a // Generated 2026-11-22. 2 queries. // Source: https://threatdeck.net/detections/ . Hunting queries are starting points: tune before alerting. Defensive use only. // ATT&CK ids are MITRE ATT&CK Enterprise v20.1. Adapted rules keep their original licence (see attribution lines). // Vertex AI inference from a principal not seen in the previous two weeks // id: vertex-ai-inference-new-principal | maturity: hunt | techniques: AML.T0040, AML.T0012, LLM10, AML.T0034 // MITRE ATT&CK: T1078.004, T1496.004 // log source: Google Cloud audit logs via the Elastic GCP integration (logs-gcp.audit-*), Data Access logs enabled for aiplatform.googleapis.com // page: https://threatdeck.net/detections/vertex-ai-inference-new-principal/ // source: https://docs.cloud.google.com/vertex-ai/docs/general/audit-logging // source: https://sysdig.com/blog/llmjacking-stolen-cloud-credentials-used-in-new-ai-attack/ // source: https://github.com/elastic/detection-rules/blob/main/rules/integrations/gcp_vertexai/initial_access_gcp_vertexai_inference_by_caller_from_new_asn.toml FROM logs-gcp.audit-* | WHERE @timestamp > NOW() - 14 days AND event.action LIKE "*PredictionService.*" AND (event.action LIKE "*GenerateContent" OR event.action LIKE "*Predict") | STATS first_seen = MIN(@timestamp), last_seen = MAX(@timestamp), calls = COUNT(*), source_ips = COUNT_DISTINCT(source.ip), resources = COUNT_DISTINCT(gcp.audit.resource_name) BY client.user.email | WHERE first_seen > NOW() - 1 day | SORT calls DESC // AI CLI run non-interactively with a bypass flag by a script interpreter (s1ngularity pattern) // id: ai-cli-scripted-by-interpreter-with-bypass | maturity: hunt | techniques: ASI02, LLM03, AML.T0053, AML.T0010, AML.T0055 // MITRE ATT&CK: T1195.002, T1552.001 // log source: Elastic Defend process events (logs-endpoint.events.process-*) // page: https://threatdeck.net/detections/ai-cli-scripted-by-interpreter-with-bypass/ // source: https://www.stepsecurity.io/blog/supply-chain-security-alert-popular-nx-build-system-package-compromised-with-data-stealing-malware // source: https://www.wiz.io/blog/s1ngularity-supply-chain-attack // source: https://github.com/nrwl/nx/security/advisories/GHSA-cxm3-wv7p-598c // source: https://cloud.google.com/blog/topics/threat-intelligence/threat-actor-usage-of-ai-tools FROM logs-endpoint.events.process-* | WHERE @timestamp > NOW() - 30 days AND event.type == "start" AND (process.command_line LIKE "*--dangerously-skip-permissions*" OR process.command_line LIKE "*bypassPermissions*" OR process.command_line LIKE "*--yolo*" OR process.command_line LIKE "*--trust-all-tools*" OR process.command_line LIKE "*--dangerously-bypass-approvals-and-sandbox*") AND (process.command_line LIKE "* -p *" OR process.command_line LIKE "*--print*" OR process.command_line LIKE "*--no-interactive*" OR process.command_line LIKE "* exec *") AND process.parent.name IN ("node", "node.exe", "bun", "bun.exe", "deno", "python", "python3", "sh", "dash") | KEEP @timestamp, host.name, user.name, process.parent.name, process.parent.command_line, process.command_line | SORT @timestamp DESC