Skip to main content
Version: 0.10

Elastic asset owner (WIP)

Works out who uses a host by aggregating logon events in Elasticsearch and attributing the host to the user who appears most. It creates no assets — it fills in asset_owner on the ones you already have.

Type nameelastic_asset_owner
CreatesNothing — enriches existing endpoints
Runs onA sensor with network reach to Elasticsearch
Fields writtenasset_owner, optionally department and criticality

How ownership is resolved​

  1. For each existing endpoint that has a value in the Platform Hostname Field, query the configured index for logon events from that host (the document's hostname field equal to the endpoint's value) over the last 30 days, aggregated by user. The 50 most frequent users are kept.
  2. If exactly one user appears for a host, that user wins.
  3. If several appear, the one accounting for more than 60% of the host's events wins. If no user clears that bar, the host is left unowned.
  4. Match the winning username against existing user assets by the part before any @, compared without case against the same part of the user-asset field named in the second Platform User Field (by default user_email).
  5. Write the matched user asset's ID into the host's asset_owner.

The host is found again by an exact, case-insensitive match of the document hostname against the Platform Hostname Field. No other correlation applies, and nothing is ever created: the integration only updates endpoints that already exist, and its silence does not count towards an asset being decommissioned.

Ownership is a link, not a string

asset_owner holds the ID of a user asset. If the person has no user asset — because no directory integration has imported them — the host stays unowned no matter how clear the logon evidence is. Run Active Directory users or Azure users first.

An existing owner is never overwritten

If a host already has an asset_owner and this run resolves a different one, the conflict is logged and the run moves on. Ownership assigned by hand, or by another integration, therefore wins permanently.

Requirements​

The integration is outbound-only: it searches an index on a schedule, so nothing is installed in the Elastic stack, nothing changes on the hosts whose logs it reads, and nothing has to reach into the deployment.

Network access​

FromToProtocolPort
The sensor running the integrationElasticsearch, at the URL configured on the instanceHTTPS over TCPWhatever the URL names — 9200 on a default self-managed install, 443 on Elastic Cloud

One host, and it is Elasticsearch itself rather than Kibana: the run issues GET /{index}/_search, with a search body, once per endpoint. This is usually an internal destination rather than an internet one, so the rule belongs in the internal firewall.

Access in Elastic​

NeedWhy
An account that can create Elasticsearch users or rolesThe credential is a user with read and view_index_metadata on the index pattern — see Permissions in Elastic
Logon events present in the index patternOwnership is inferred from authentication logs; an index without them resolves no owners while the run still succeeds

If Elasticsearch presents a certificate the sensor host does not trust, install the CA on the host in preference to enabling Ignore SSL — the credential is sent on every request, and these are authentication logs.

In this deployment​

NeedWhy
A registered, healthy sensor with reach to ElasticsearchThe integration runs on a sensor, on the platform's schedule — see Sensors
Endpoints already in the inventoryThis integration creates nothing — it writes asset_owner onto hosts that already exist, matched on the Platform hostname field
Users in the inventory, for department and criticalityThe enrichment copies the owning user's user_department and criticality onto the host, so those fields need a user source such as Azure users

Configuration​

FieldRequiredDefaultNotes
NameYesLabel for this instance
URLYesElasticsearch base URL
UsernameYesElasticsearch user
PasswordYesPassword for that user. Write-only: once saved it is never shown again, only replaced, and is sent only to the sensor
CookiesNoExtra cookies added to requests. Write-only like Password, and can be removed
Elastic IndexNologs-*Index pattern to search
Elastic QueryNoWindows logon events (see below)Query selecting logon events
Elastic User FieldNouser.nameDocument field holding the username
Elastic Hostname FieldNoagent.nameDocument field holding the hostname
Platform Hostname FieldNoelastic_agent_nameAsset field matched against the document hostname
Platform User Field (first)Noasset_ownerMeant as the asset field written with the resolved owner, but currently not applied: the owner always goes to asset_owner
Platform User Field (second)Nouser_emailUser-asset field used to match the username
SensorYesSensor that will run the integration
Ignore SSLNoSkips certificate validation
Two fields share one label

The console labels both the owner field and the username-matching field Platform User Field. The first, defaulting to asset_owner, is the owner field; the second, defaulting to user_email, is the one that matters for matching.

The default query targets successful interactive Windows logons:

winlog.event_id: "4624" AND process.executable: "C:\\Windows\\System32\\svchost.exe"

Its scan template adds a Look-back window and an Enrich host information by asset owner checkbox, on unless unticked, which copies the owner's user_department into the host's department and the owner's criticality into the host's criticality, each only where the host's field is empty.

The look-back window is fixed

The sensor always searches the last 30 days. The scan template's Look-back window is not applied yet.

Tune the query before widening the window

Event 4624 covers service and network logons as well as people at keyboards. Narrowing on logon type gives cleaner ownership than looking back further does — a noisy query with a long window mostly produces hosts owned by service accounts.

Permissions in Elastic​

A user with read and view_index_metadata on the configured index pattern. The integration issues GET /{index}/_search. The connection test checks the credentials against the cluster, then runs an empty search on the index pattern to prove read.

TODO

Only read on the index pattern is checked by the connection test. Confirm whether view_index_metadata is actually needed.

These are authentication logs

Whatever index you point this at contains who-logged-in-where. Scope the Elasticsearch role to exactly that pattern, and keep this integration's credential separate from any other Elastic integration.

See also​