let LastHeartbeatTime = Heartbeat
| summarize LastHeartbeat_Time = arg_max(TimeGenerated, *) by ResourceId;
Heartbeat
| where TimeGenerated > ago(14d)
| summarize LastHeartbeat_Hours = datetime_diff("hour",now(), max(TimeGenerated)) by ResourceId
| where ResourceId <> ""
| where ResourceId <> "None"
| join kind=inner (LastHeartbeatTime) on ResourceId
| where LastHeartbeat_Hours > 24
| project LastHeartbeat_Hours, LastHeartbeat_Time, Computer, ComputerIP, Category, OSType, OSName, ResourceId, SubscriptionId, ResourceGroup, RemoteIPCountry
| sort by LastHeartbeat_Hours desc
description: |
'This alert is designed to monitor assets within the Maturity Model for Event Log Management (M-21-31) standard. The alert triggers when a monitored asset fails to provide a heartbeat within 24 hours.'
kind: Scheduled
tactics:
- Discovery
requiredDataConnectors: []
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/MaturityModelForEventLogManagementM2131/Analytic Rules/M2131AssetStoppedLogging.yaml
severity: Medium
name: M2131_AssetStoppedLogging
triggerThreshold: 0
queryPeriod: 14d
query: |
let LastHeartbeatTime = Heartbeat
| summarize LastHeartbeat_Time = arg_max(TimeGenerated, *) by ResourceId;
Heartbeat
| where TimeGenerated > ago(14d)
| summarize LastHeartbeat_Hours = datetime_diff("hour",now(), max(TimeGenerated)) by ResourceId
| where ResourceId <> ""
| where ResourceId <> "None"
| join kind=inner (LastHeartbeatTime) on ResourceId
| where LastHeartbeat_Hours > 24
| project LastHeartbeat_Hours, LastHeartbeat_Time, Computer, ComputerIP, Category, OSType, OSName, ResourceId, SubscriptionId, ResourceGroup, RemoteIPCountry
| sort by LastHeartbeat_Hours desc
relevantTechniques:
- T1082
id: 4be5b645-1d08-49e4-b58d-07294ff19223
queryFrequency: 1d
status: Available
triggerOperator: gt
version: 1.0.0
entityMappings:
- entityType: AzureResource
fieldMappings:
- columnName: ResourceId
identifier: ResourceId