ESXi Multiple Logon Failures by User and Source
Description
Detects three or more failed ESXi logons for the same account from the same remote address within 10 minutes.
Hostd records each failure from pam_do_authenticate with the login name and rhost. Repeated failures from
one source are password guessing against that account and can lock it or come just before a successful login.
Query · esql
FROM logs-vsphere.log-*
| WHERE data_stream.dataset == "vsphere.log" AND event.module == "vsphere"
AND message LIKE "*pam_do_authenticate: error*"
| GROK message "%{DATA}rhost=%{IP:source_ip}%{DATA}login:%{DATA:user}]%{GREEDYDATA}"
| WHERE user IS NOT NULL AND source_ip IS NOT NULL
| EVAL user.name = user, source.ip = source_ip
| STATS
Esql.failure_count = COUNT(*),
Esql.first_seen = MIN(@timestamp),
Esql.last_seen = MAX(@timestamp),
Esql.message_values = VALUES(message)
BY user.name, source.ip, host.ip
| WHERE Esql.failure_count >= 3
| EVAL message = MV_FIRST(Esql.message_values)
| KEEP message, user.name, source.ip, host.ip, Esql.failure_count, Esql.first_seen, Esql.last_seen, Esql.message_values
Investigation fields
Pivot points the source recommends for triage.
user.namesource.ipmessagehost.ipEsql.failure_countEsql.first_seenEsql.last_seen
Implementation guide
This rule requires ESXi host logs collected by the Elastic vSphere integration: https://www.elastic.co/docs/reference/integrations/vsphere
Known false positives
- An administrator who mistypes the root password in the Host Client a few times can reach three failures. Confirm the source address is a known workstation and that a successful login did not follow.
Analyst notes
Investigating ESXi Multiple Logon Failures by User and Source
Each failed Host Client or API logon is a hostd line pam_do_authenticate: error with rhost=
and login:. The query uses GROK to take those two values from message, then counts failures for the same account and remote address. The rule lookback is 9 minutes, and the alert requires at least 3 failures within 10 minutes apart.Possible investigation steps
- Read user.name, source.ip, and Esql.failure_count.
- Compare source.ip with known jump hosts and administrator workstations.
- Look for a following Accepted password for user for the same account from that address.
- On the host, check whether the account is locked: esxcli system account list.
False positive analysis
A short run of mistyped passwords from one workstation is commonly benign. Failures from an unknown address, or failures followed by a successful login, deserve review.
Response and remediation
- If the source is not approved, block it and rotate the targeted account password.
- Unlock the account if the lockout threshold was reached and the activity was not approved.
- Preserve hostd.log for the source address and account.