Iniciar sesión

ECS powers detections

12 min · 2 ejercicio(s)

Elastic Security ships more than 1,000 prebuilt detection rules. Every one of them is written against ECS fields:

process where event.type == "start" and
  process.parent.name : ("WINWORD.EXE", "EXCEL.EXE", "POWERPNT.EXE") and
  process.name : ("powershell.exe", "cmd.exe", "wscript.exe", "mshta.exe")

The rule doesn't care whether the process events came from Elastic Defend, Sysmon via Winlogbeat or a third-party EDR. If the source is mapped to ECS, the rule fires.

Fields the rules rely on

Field Used for
event.category, event.type Selecting the right events (EQL categories)
process.name, process.parent.name, process.command_line, process.args Process behaviour
process.entity_id, process.parent.entity_id Reliable process trees (PIDs are reused)
host.id, host.name Grouping sequences per host (sequence by host.id)
user.name, user.id Account activity
destination.ip, destination.port Network behaviour
file.path, file.extension File activity

Required fields

Every prebuilt rule lists its required fields in Kibana. If one of them is missing in your data, the rule can't match anything, and you don't get an error, you just get no alerts. Checking required fields against your sources is one of the first steps of a detection engineering review.

Threat fields

Alerts are enriched with threat.* fields, which map the rule to MITRE ATT&CK: threat.tactic.name, threat.technique.id. Threat intelligence indicators use threat.indicator.*. The lab's lab-threatintel index uses a simplified version of this.

🔎 Profundiza: funciones, errores habituales y práctica

Coverage, not just rules

A rule set is only as good as the data under it. A practical way to measure coverage:

  1. List the rules you want (for example by MITRE tactic).
  2. Collect their required fields and event.category values.
  3. Check, per data source, which of them are populated (FROM logs-* | STATS COUNT(field) BY event.dataset in ES|QL).

Gaps show you which sources need better ECS mapping before more rules make sense.

Writing your own rules

Write custom rules against ECS fields as well, even if only one of your sources has the data today. When the next source is onboarded, the rule already covers it.

Ejercicios prácticos de esta lección

Resuelve estos ejercicios con una consulta en el laboratorio Elasticsearch real. Inicia sesión gratis para acceder al laboratorio, las pistas y la corrección automática.

  1. 1. A PID you can trust

    PIDs are reused by the operating system, so detection rules follow process trees with a unique process ID instead. Which ECS field is it?

  2. 2. Feed the brute-force rules

    The prebuilt brute-force rules look for many failed authentication events per user.name and source.ip. The shop's admin panel logs:

    2026-03-13T21:18:43.204Z WARN  [admin] admin login failed user=admin client=203.0.113.66

    The lab extracted user and client. Map them and set event.category, event.type and event.outcome so the rules can see these lines.