/elastic-security:security-threat-huntingfrom elastic-security
Hypothesis-driven threat hunting in Elastic Security using iterative ES|QL exploration. Covers IOC search, anomaly identification, baseline comparison, lateral movement tracking, and turning findings into cases and detection rules.
Ships in elastic-security. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Hunt proactively for threats that detection rules have not surfaced. Start from a specific hypothesis, explore security data iteratively with ES|QL, separate anomalies from legitimate behavior, and document what you find.
This skill executes Elasticsearch operations through the elastic CLI. If the
elastic CLI is not installed, tell the user what it is needed for. Do
not guess credentials, call the HTTP API directly, or attempt other workarounds.
This skill references operations in HTTP-shorthand form (e.g., GET /, GET /_cat/indices, GET /{index}/_mapping,
GET /{index}/_settings/index.mode, POST /_query). The Operations table at the end of this document
maps each shorthand to the equivalent elastic CLI command — always use the CLI rather than calling the HTTP API
directly.
| Method | Description | When to use |
|---|---|---|
| Hypothesis-driven | Start with a specific theory about adversary behavior | New threat intel, emerging technique, "could this happen here?" |
| CTI-driven | Search for known IOCs or TTPs from threat reports | After reading a threat report, advisory, or news |
| Data-driven | Use frequency analysis and statistical outliers | Baseline hunting, anomaly detection, "what's unusual?" |
Every hunt starts with a question. Good hypotheses are specific, testable, and scoped:
Define the expected data sources and the time window. Use 7–30 days for behavioral patterns and shorter windows for IOC sweeps. Sources for hypotheses:
Data needed: a one-sentence hypothesis, the technique or actor it maps to, the data sources, and the time window.
Discover which security indices exist with GET /_cat/indices, then confirm field availability before you query. Run
POST /_query with FROM <pattern> | LIMIT 0 to list the available fields without returning documents. Use
GET /{index}/_mapping only for a single concrete index: on a wildcard pattern it returns the mapping of every backing
index, which can reach megabytes. Prefer ECS field names for cross-source portability.
Common sources are in the table under Common indices for hunting. If an index the hypothesis depends on is absent, say so and stop or adjust the hypothesis — do not query a pattern that matches nothing.
Data needed: confirmed index patterns and the fields available in each.
Run each query with POST /_query. Use an existing template from
references/query-templates.md (lateral movement, C2 beaconing, brute force, rare
process execution) or write a custom query.
Write custom ES|QL with these principles:
logs-endpoint.events.process-*.@timestamp range, such as WHERE @timestamp >= NOW() - 7 DAYS, and filter
early.COUNT(*), COUNT_DISTINCT(host.id), and VALUES() for frequency and outlier analysis. Aggregate
before you pull raw events to understand data volume.Start broad to establish a baseline, then chain WHERE clauses to narrow. Avoid one overly complex query.
Data needed: aggregate results that show the shape of the data and which entities to examine.
Look for statistical outliers using the frequency pattern: aggregate by a field, count occurrences and distinct hosts, then keep only the rare items.
FROM logs-endpoint.events.process-*
| WHERE @timestamp > NOW() - 7 day
AND host.os.family == "windows"
AND event.action == "start"
| STATS count = COUNT(*), hosts = COUNT_DISTINCT(host.id) BY process.executable
| WHERE hosts == 1 AND count <= 3
| SORT count ASC
| LIMIT 50
Interpret results:
hosts == 1 or cc == 1 in frequency hunts are the most interesting.Use percentile and standard deviation analysis (PERCENTILE(), STD_DEV()) to find volumetric anomalies. Compare
current activity against a historical baseline before you escalate. Normalize user-specific paths and GUIDs with
REPLACE() before aggregating — see references/hunting-guide.md.
Data needed: a short list of anomalous entities, each with the count and host spread that made it stand out.
For CTI-driven hunts, query for known-bad indicators: IP addresses, domains, file hashes, and registry keys. Use
POST /{index}/_search for exact-match lookups across indices, and check for related activity on the same entities
within a time window. Cross-reference findings against the threat intelligence you started from.
Data needed: which indicators matched, on which hosts, and when.
When a hunt returns an interesting result, pivot into deeper investigation. Query the process tree around the finding
with POST /_query, anchored on the finding's absolute timestamp:
FROM logs-endpoint.events.process-*
| WHERE agent.id == "<agent_id>"
AND @timestamp >= "<finding_time - 5min>"
AND @timestamp <= "<finding_time + 10min>"
| KEEP @timestamp, process.name, process.command_line, process.pid, process.parent.name, process.executable
| SORT @timestamp
| LIMIT 50
For network context, file lineage, related alerts, and entity risk pivots, see references/hunting-guide.md. For triage of related alerts, use the security-alert-analysis skill.
Data needed: enough context to classify the finding as a confirmed threat, suspicious (needs more data), or benign.
Record the hypothesis, data explored, queries used, time range, and result. Then act on the finding:
Data needed: classification, evidence summary, and the chosen follow-up action.
| Data source | Index pattern | Key fields |
|---|---|---|
| Endpoint processes | logs-endpoint.events.process-* | process.name, process.command_line, process.parent.name, process.executable |
| Endpoint network | logs-endpoint.events.network-* | destination.ip, destination.port, process.name, dns.question.name |
| Endpoint files | logs-endpoint.events.file-* | file.path, file.name, event.action |
| Endpoint registry | logs-endpoint.events.registry-* | registry.path, registry.data.strings, process.name |
| Security alerts | .alerts-security.alerts-* | kibana.alert.rule.name, kibana.alert.severity |
| AWS CloudTrail | logs-aws.cloudtrail-* | event.action, aws.cloudtrail.user_identity.type |
STATS to understand volume before you pull raw events.@timestamp, not NOW().| HTTP API (shorthand) | elastic CLI command |
|---|---|
GET /_cat/indices | elastic es cat indices --index '<pattern>' |
GET /{index}/_mapping | elastic es indices get-mapping --index '<index>' |
POST /_query | elastic es esql query --format tsv --query '<esql>' |
POST /{index}/_search | elastic es search --index '<index>' --input-file '<query.json>' |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub elastic/agent-skills --plugin elastic-security7 skills in this plugin
/security-alert-analysisInvestigate a specific Elastic Security detection alert: gather context, assess entity risk, classify the threat, document findings, and optionally acknowledge. Use when triaging a single known alert, performing SOC investigation, or following up after the security-alert-triage skill identifies a group to investigate.
/security-alert-triagePrioritize and rank the Elastic Security alert queue by weighted risk — base risk score, MITRE tactic boost, entity risk, and asset criticality — then cluster alerts into entity groups. Use when an analyst asks what to focus on, which alerts are most urgent, or wants a ranked starting point across the queue before deeper investigation begins.
/security-case-managementCreate, search, update, and manage SOC cases via the Kibana Cases API. Use when tracking incidents, linking alerts to cases, adding investigation notes, or managing triage output.
/security-detection-rule-managementCreate, tune, and manage Elastic Security detection rules (SIEM and Endpoint). Use for false positives, exceptions, new coverage, noisy rules, or rule management via Kibana API.
/security-generate-security-sample-dataGenerate sample security events, attack scenarios, and synthetic alerts for Elastic Security. Use when demoing, populating dashboards, testing detection rules, or setting up a POC.
/security-ml-integrationsInstall and manage Elastic security ML integration packages (beaconing, ded, dga, lmd, pad, problemchild, security_ai). Handles the full lifecycle: pre-flight checks, Fleet package install, component templates, ingest pipelines, transforms, data views, ML anomaly detection jobs, and detection rules. Use when a user asks to install, set up, check the status of, or troubleshoot a security ML integration package, including the technical preview Security for AI package.
2 plugins ship this exact skill · first indexed Nov 28, 2026
Other plugins' skills for the same job