Inbound Authentication From Public IP
Description
This query can be used to identify devices that are publicly disclosed to the internet by monitoring for inbound authentication attempts.
Query · kql
let AllowedEntpoints = pack_array('devicename');
SecurityEvent
| where EventID in ('4625', '4624')
| where Computer !in(AllowedEntpoints)
| where not(ipv4_is_private(IpAddress))
| summarize arg_min(TimeGenerated, *) by Computer
| lookup kind=leftouter (DeviceInfo
| summarize arg_max(TimeGenerated, *) by DeviceId
| project DeviceName = toupper(DeviceName), DeviceType, PublicIP, ExposureLevel, MachineGroup) on $left.Computer == $right.DeviceName