Skip to content

Elastic Security

Elastic Security is the SIEM of the Elastic Stack (Elasticsearch and Kibana), on Elastic Cloud or self-managed.

  • What DRACO uses: Detection alerts (and optional raw logs); Kibana cases for incident sync.
  • What for: Detections, hunts and the ID directory on SIEM alerts, case sync with status and comments, Elastic Defend host isolation.

Add it in Connectors > Add connector: pick Elastic Security, then choose what DRACO collects and what it may change. Add more later with Add a part on its connector page. See Connectors for how connectors, sign-in and tags work.

Parts

Part What DRACO uses Access Permissions
Logs Elastic Security read An API key with read and view_index_metadata on .alerts-security.alerts- and .internal.alerts-security.alerts- (and on the log index pattern when raw logs are collected).
Incidents Elastic Security cases read The Kibana privilege Security > Cases: Read in this space
Two-way sync: the Kibana privilege Security > Cases: All in this space
Response Isolate host (Elastic Defend), Release host (Elastic Defend) write Isolate host (Elastic Defend), Release host (Elastic Defend): an Elastic API key (or user) separate from the read-only key of logs and cases, whose role has the Kibana feature privilege Security: All with Customize sub-feature privileges: Endpoint List: Read, Host Isolation: All and Response Actions History: Read, in the Kibana space of the action. Host isolation needs the Elastic subscription (or serverless project feature tier) that includes it, and Elastic Defend on the host

Requirements

  • Elastic Security with detection rules enabled (alerts are written to .alerts-security.alerts-<space id>).
  • A user who may create API keys (manage_own_api_key) and read the alerts indices, to create the key for DRACO.
  • Network access from DRACO to Elasticsearch (Elastic Cloud: port 443; self-managed: usually 9200) over HTTPS. Plain http:// is accepted only for a private address (10.x, 172.16-31.x, 192.168.x) or an internal host name. A private address or internal host name is reachable only when your DRACO operator has enabled access to private networks for data sources (on-premise installations); otherwise use a public HTTPS endpoint.

Logs

The Elastic Security data source (elastic_security_alerts) pulls the detection alerts of Elastic Security from Elasticsearch: rule name and id, severity, risk score, workflow status, host, user, source and destination addresses, MITRE ATT&CK tactics and techniques, with a link to each alert in Kibana. Optionally it also pulls raw logs (ECS documents of an index pattern such as logs-*). Kibana cases sync both ways through the Elastic Security cases incident connector.

It works with Elastic Cloud (a Cloud ID, or the Elasticsearch endpoint of the deployment) and self-managed Elasticsearch and Kibana 8.x or later.

Setup in Elastic

  1. Sign in to Kibana and open Dev Tools > Console.
  2. Create an API key that may only read the detection alerts:

    POST /_security/api_key
    {
      "name": "draco",
      "expiration": "365d",
      "role_descriptors": {
        "draco_reader": {
          "indices": [
            {
              "names": [".alerts-security.alerts-*", ".internal.alerts-security.alerts-*"],
              "privileges": ["read", "view_index_metadata"]
            }
          ]
        }
      }
    }
    

    To collect raw logs as well, add your log index pattern (for example logs-*) with the same two privileges. You can also use Stack Management > API keys > Create API key and paste the same role descriptor under Control security privileges. 3. Copy the encoded value of the answer (shown once): it is the API key for DRACO. 4. Find the address: - Elastic Cloud: the deployment page of the Elastic Cloud console shows the Cloud ID and the Elasticsearch and Kibana endpoints. - Self-managed: https://<host>:9200 for Elasticsearch and https://<host>:5601 for Kibana.

Instead of an API key you can create a user (Stack Management > Users) with a role that has the same index privileges and use its user name and password.

Add the source in DRACO

  1. Connectors > Add connector, pick Elastic Security and tick Logs under Collectors (or Add a part on the Elastic Security connector you already have). The wizard repeats the steps above.
  2. Enter the Elastic Cloud ID, or the Elasticsearch URL. Enter the Kibana URL too: DRACO uses it for the links to the alerts.
  3. Alerts index: .alerts-security.alerts-default (the Default space). Use .alerts-security.alerts-<space id> for another space, or .alerts-security.alerts-* for every space.
  4. Self-managed cluster with its own certificate authority: paste the CA certificate (PEM, for example config/certs/http_ca.crt). Certificate checks can be turned off (Verify the TLS certificate) only for a private address or internal host name.
  5. Create (or pick) an API key credential with the encoded value, or a Basic credential with the user name and password.
  6. Test: DRACO signs in and reads the alerts of the last 24 hours (First run looks back). The source is created only after a passing test; a missing privilege is named in the message.

What DRACO collects

Event Columns
Alert (action alert.<workflow status>: open, acknowledged, closed) class Detection Finding, severity from the rule severity, host the host name, actor_user the user name, src_ip the source address, dst_ip the destination address, resource_uid the host id, url the alert in Kibana, message "High Elastic Security alert "" on ()"
Raw log (optional, action log.<event.action>) class from event.category (authentication, network, process, file, web, iam...), status from event.outcome, host, user, addresses

The whole document stays in the fields with its ECS names, so searches use them: host.name, user.name, source.ip, process.command_line, event.action, kibana.alert.rule.name... DRACO adds xdr: kind, vendor_id (the alert uuid), status, severity, rule_name, rule_id, rule_uuid, risk_score, reason, tactics and techniques (ATT&CK ids from the rule's threat mapping), console_url.

Building-block alerts (hidden in the Kibana alerts table by default) are not collected.

Raw logs

Also collect raw logs is off by default. When on, DRACO reads every document of the Log index pattern (default logs-*) in time order. This can be a large volume: every document counts against your DRACO log volume and storage. Use Log filter (a Lucene query, for example event.category:authentication AND event.outcome:failure) and Log documents per run to keep it to what you need. The API key needs read and view_index_metadata on the log index pattern.

Latency and cost

  • Polls every 5 minutes. Alerts are read by @timestamp (when the rule created the alert) on a point in time with a 10-minute overlap for rules that write alerts late; alerts already stored are skipped.
  • Raw logs are read by event.ingested, the time a document reached Elasticsearch, when the log index pattern has that field (Elastic Agent integrations set it). A document a shipper delivers late, for example a backlog after an outage, is still read, and its own @timestamp stays its time in DRACO. Documents of the pattern without event.ingested are read by @timestamp with a 2-minute overlap.
  • When the pattern has no event.ingested field at all, raw logs are read by @timestamp with a 2-minute overlap and the source shows a warning once: a document indexed more than 2 minutes after its time is missed. To avoid that, collect with Elastic Agent, or add a set processor that sets event.ingested to {{_ingest.timestamp}} in the ingest pipeline of the index.
  • Up to 2,000 alerts per run (Alerts per run) and 5,000 log documents (Log documents per run); a busier window continues on the next run right after the last document read, also when thousands of documents share one second.
  • Rate limits and 429 answers are retried (three times, at most 30 seconds each), then the next run continues.

Built-in rules (draco-elastic-wazuh)

Rule When
Elastic Security: high or critical alert (recommended) an open alert with severity high or critical
Elastic Security: medium alert the same for medium alerts (off by default)
Elastic Defend: threat detected but not prevented (recommended) an open Malware, Ransomware, Memory Threat or Malicious Behavior Detection Alert (the protection is in detect mode)
Elastic Security: endpoint security or logging tampered with (recommended) an open alert of any severity from a rule about stopping the agent, Defender, Sysmon, the firewall or auditing
Elastic Security: alert on a privileged account an open medium or higher alert whose user name looks privileged; off by default: account naming differs, duplicate it as a custom rule with your naming convention
Elastic Security: several detection rules on one host within an hour (recommended) three or more different rules with medium or higher alerts on one host
Elastic Security: same rule on many hosts one rule with medium or higher alerts on five or more hosts within two hours (off by default)
Elastic logs: member added to an administrators group (recommended) a raw ECS event adding an account to Administrators, Domain Admins, sudo, wheel and similar groups
Elastic logs: security or system log cleared (recommended) a raw ECS event audit-log-cleared or logs-cleared

One DRACO alert per Elastic alert: the rules group by the Kibana link (url) and deduplicate for seven days. Open in vendor console on the DRACO alert opens it in Kibana.

The two Elastic logs rules need raw logs turned on. The correlation rules count distinct rules and alerts and raise their own DRACO alerts.

Hunts, dashboard and Sigma

  • Threat hunting > Library: Elastic: threats not prevented and defenses tampered with, noisiest rules and hosts, and on raw logs authentication failures and successes and accounts created and added to groups.
  • Dashboards > Add prebuilt > Elastic Security: alerts by severity over time and by ATT&CK tactic, top hosts and users, agent health (detect-only threats and tampering) and the latest high alerts.
  • Sigma import: rules with logsource: {product: elastic} read this source with their ECS names; Sigma Windows names (CommandLine, Image, ParentImage, TargetFilename, QueryName...) map to their ECS fields.

With the Elastic Security cases connector too. A Kibana case is a separate object that analysts create, and the connector does not read the alerts attached to a case, so DRACO cannot tell which alerts a case holds: an alert rule's incident and a case's incident stay two DRACO incidents. Merge them in DRACO when they are the same.

ID directory

Alerts and logs teach the ID directory: host id → host name, Elastic Agent id → agent name, user id → user name, and detection rule uuid and rule id → rule name.

Incidents

Imports Elastic Security cases as DRACO incidents and keeps their status in sync; how sync works for every vendor is in Incident connectors. Import reads with the read access; two-way sync changes the case in Kibana, so it signs in with the write access.

  1. In Kibana (administrator) open Stack Management > Roles > Create role draco_cases. Under Kibana privileges add the space of your cases (Default, or your SOC space), Customize, and set Security > Cases to Read; two-way: All.
  2. Stack Management > Users > Create user draco with the role. Sign in as draco and open Stack Management > API keys > Create API key (an expiration; leave Control security privileges off so the key has the role's privileges). Copy the Encoded value.
  3. In DRACO enter the Kibana URL (Elastic Cloud: the Kibana endpoint of the deployment; self-managed https://<host>:5601; plain http:// only on a private address, and a private address only when your DRACO operator has enabled access to private networks) and the space id (after /s/ in Kibana URLs; empty for the Default space), and an API key credential with the encoded value (or a Basic credential for draco).

DRACO reads the cases changed in the window (GET /api/cases/_find, newest first by update time, plus the cases created in the window) and links each DRACO incident to the case in Kibana.

Response: host isolation

With the Response part of the connector, DRACO can isolate an Elastic Defend endpoint from the network and release it (response actions). An isolated host keeps talking to Elastic (Fleet and Elasticsearch) only. The actions sign in with the connector's write access, separate from the read-only key of alerts and cases.

  1. In Kibana open Stack Management > Roles and create a role draco_response. Under Kibana privileges add the space of the endpoints, set Security to All, turn on Customize sub-feature privileges and set Endpoint List: Read, Host Isolation: All and Response Actions History: Read. Selecting All for Security grants no sub-feature privilege by itself. Leave the Elasticsearch index privileges empty.
  2. Stack Management > Users: create a user draco-response with only that role. Signed in as that user, create an API key (Stack Management > API keys) with an expiry and copy the Encoded value; the key has the user's privileges.
  3. In DRACO create an API key credential (or Basic for the user) and pick it as the connector's write access, with the Kibana URL (not Elasticsearch's) and the space id.
  4. Test: DRACO reads the key's Kibana capabilities (Host Isolation, Endpoint List) and changes nothing; a missing privilege is named.

The host is the Elastic Agent id of the endpoint or its host name (looked up in the ID directory, then in the endpoint list). A host already isolated is not isolated again. The hosts need Elastic Agent with the Elastic Defend integration, and host isolation needs the Elastic subscription (or serverless project feature tier) that includes it. Elastic's references: Elastic Defend feature privileges, Isolate an endpoint API.

If you turn on several parts

When you connect Elastic once and tick several parts, the wizard shows one guide for all of them: what to check first, the access to create once, one list of permissions that names the part each one is for, the extra steps of each part, and one test that checks every part on its own. Turning a part on later shows only what it adds.

The alerts source and the Kibana cases connector use different keys: an API key that reads the alerts indices, and the draco_cases role (Security > Cases) with its own key. The guide lists both under the read access; two-way case sync (Cases: All) goes on the write access.

Troubleshooting

Last error Fix
Elastic Security refused the credentials (HTTP 401) The API key expired or was invalidated: create a new one and rotate the credential.
... the credentials need read and view_index_metadata on .alerts-security.alerts-* Recreate the key with the role descriptor above (or add the privileges to the user's role).
... was not found (HTTP 404) The URL is Kibana's, not Elasticsearch's, or the alerts index name is wrong.
must be an https:// URL Use HTTPS; plain HTTP only works for a private address or internal host name.
Elastic Security request failed: SSLError Paste the cluster's CA certificate.
Elastic Kibana denied the request (HTTP 403): the credentials need the Kibana privilege Security > Host Isolation: All Give the response user's role the Host Isolation sub-feature privilege (All) in the space.
Elastic Defend has no host named ... Use the Elastic Agent id of the endpoint, or check that Elastic Defend runs on it.
verify_tls: certificate checks can be turned off only for a private address Give the CA certificate instead.