SIEM with the Elastic Stack

Use Elasticsearch, Kibana and Elastic Security to ingest logs, hunt with KQL/ES|QL and run detection rules.

Intermediate · about 14 hours · difficulty 3/5

Learn first: Log Sources and Telemetry

The Elastic Stack (Elasticsearch, Kibana, Beats or Elastic Agent) is a popular open-core option for security analytics. Elastic Security adds SIEM features, prebuilt detection rules and endpoint protection on top.

Core concepts

  • Elastic Agent or Beats ship logs; integrations parse common sources into the Elastic Common Schema (ECS).
  • ECS gives consistent field names like source.ip, user.name and process.command_line, so one query works across sources.
  • Kibana Discover is where you search; Timeline in Elastic Security is where you investigate.

Query languages

  • KQL for quick filtering: event.code : "4625" and user.name : "admin"
  • EQL for sequences: find a process start followed by a network connection from the same host.
  • ES|QL for piped analytics similar to SPL, with STATS ... BY.

Detection features

  • Hundreds of prebuilt rules mapped to MITRE ATT&CK, which you enable and tune.
  • Custom rules: query based, threshold, EQL sequence, and machine learning.
  • Cases for tracking investigations.

Pitfalls

  • Skipping ECS mapping for custom logs, which breaks prebuilt rules.
  • Enabling every prebuilt rule at once without checking noise in your environment.

Move on when you can ingest Windows and Linux logs into a local Elastic stack, write a KQL and an EQL query, and enable and tune one prebuilt rule.

Key concepts

  • Elastic Agent and integrations
  • Elastic Common Schema (ECS)
  • KQL in Discover
  • EQL sequences
  • ES|QL analytics
  • Prebuilt detection rules
  • Timeline and cases

Other options for this step

  • SIEM with Splunk: Search, filter and visualise security logs using Splunk and its Search Processing Language (SPL).

Mini project

Run Elastic Security locally with Docker, onboard a Windows VM with Sysmon, generate benign admin activity, and write a custom rule that alerts when a new local administrator is created.

Check yourself

What problem does the Elastic Common Schema solve for detection rules?

Free resources