Azure - User Investigation

This playbook performs an investigation on a specific user in Azure environments, using queries and logs from Azure Log Analytics to locate the following activities performed by the user: - Script-based user agent usage - Administrative user activities - Security rules and policies changes - Failed login attempt - MFA failed login attempt - Login attempt from an uncommon country - Anomalies activities - Risky users - Uncommon high volume of actions - Action uncommonly performed by the user

Azure Enrichment and Remediation · 36 tasks · 4 inputs · 19 outputs

Inputs

  • Username — The username to investigate.
  • AzureSearchTime — The Search Time for the Azure Log Analytics search query. Default value: ago(1d)
  • failedLogonThreshold — The threshold number of failed logons by the user. Required to determine how many failed logon events count as suspicious events.
  • MfaAttemptThreshold — The threshold number of MFA failed logons by the user. Required to determine how many MFA failed logon events count as suspicious events.

Outputs

  • AzureScriptBasedUserAgentEvents — Script-based user agent events used by the user in the Azure environment.
  • CountAzureEvents.AzureScriptBasedUserAgentCount — The number of script-based user agent usages by the user in the Azure environment.
  • AzureAdminActivitiesEvents — Administrative activities performed by the user in the Azure environment.
  • CountAzureEvents.AzureAdminActivitiesCount — The number of administrative activities performed by the user in the Azure environment.
  • AzureSecurityRulesChangeEvents — Security rules that were changed by the user in the Azure environment.
  • CountAzureEvents.AzureSecurityRulesChangeCount — The number of security rules that were changed by the user in the Azure environment.
  • AzureUnsuccessSecurityRulesChangeEvents — Unsuccessful attempts to change security rules by the user in the Azure environment.
  • CountAzureEvents.AzureUnsuccessSecurityRulesChangeCount — The number of unsuccessful attempts to change security rules by the user in the Azure environment.
  • AzureFailLoginCount — The number of failed logins by the user in the Azure environment.
  • AzureFailLoginMFACount — The number of failed logins by the user using MFA in the Azure environment.
  • AzureAnomaliesEvents — Anomaly events on the user in the Azure environment.
  • CountAzureEvents.AzureAnomaliesCount — The number of anomaly events on the user in the Azure environment.
  • AzureRiskyUserCount — The number of events where the user was defined as a risky user in the Azure environment.
  • AzureUncommonCountryLogonEvents — Uncommon country logon events by the user in the Azure environment.
  • CountAzureEvents.AzureUncommonCountryLogonCount — The number of uncommon country logon events by the user in the Azure environment.
  • AzureUncommonVolumeEvents — Uncommon volume events by the user in the Azure environment.
  • CountAzureEvents.AzureUncommonVolumeCount — The number of uncommon volume events by the user in the Azure environment.
  • AzureUncommonActivitiesEvents — Uncommon activity events by the user in the Azure environment.
  • CountAzureEvents.AzureUncommonActivitiesCount — The number of uncommon activity events by the user in the Azure environment.

Commands used

azure-log-analytics-execute-query

Flowchart

yes yes yes yes yes yes yes Start Start Is Azure Log Analytics enabled and the user name is defined? Is Azure Log Analytics en... Logon attempt from uncommon country - azure-log-analytics-execute-query Logon attempt from uncomm... azure-log-analytics-execute-q... BehaviorAnalytics (Sentinel) BehaviorAnalytics (Sentinel) IdentityInfo (Sentinel) IdentityInfo (Sentinel) Anomalies (Sentinel) Anomalies (Sentinel) SigninLogs SigninLogs AzureActivity AzureActivity AuditLogs AuditLogs Uncommon high volume of actions - azure-log-analytics-execute-query Uncommon high volume of a... azure-log-analytics-execute-q... Action uncommonly performed by user - azure-log-analytics-execute-query Action uncommonly perform... azure-log-analytics-execute-q... Check if the user is defined as a risky user - azure-log-analytics-execute-query Check if the user is defi... azure-log-analytics-execute-q... Anomalies for the user - azure-log-analytics-execute-query Anomalies for the user azure-log-analytics-execute-q... Failed login attempts by the user - azure-log-analytics-execute-query Failed login attempts by ... azure-log-analytics-execute-q... Check for script-based user agent - azure-log-analytics-execute-query Check for script-based us... azure-log-analytics-execute-q... Security rules were changed successfully - azure-log-analytics-execute-query Security rules were chang... azure-log-analytics-execute-q... An unsuccessful attempt to change security rules - azure-log-analytics-execute-query An unsuccessful attempt t... azure-log-analytics-execute-q... Search for administrative user activities - azure-log-analytics-execute-query Search for administrative... azure-log-analytics-execute-q... Set events count - SetMultipleValues Set events count SetMultipleValues The user did not pass the MFA challenge - azure-log-analytics-execute-query The user did not pass the... azure-log-analytics-execute-q... Set script-based user agent events - SetAndHandleEmpty Set script-based user age... SetAndHandleEmpty Set administrative events - SetAndHandleEmpty Set administrative events SetAndHandleEmpty Set security rules changed events - SetAndHandleEmpty Set security rules change... SetAndHandleEmpty Set attempt to change security rules events - SetAndHandleEmpty Set attempt to change sec... SetAndHandleEmpty Set anomalies events - SetAndHandleEmpty Set anomalies events SetAndHandleEmpty Set event of logon attempt from uncommon country - SetAndHandleEmpty Set event of logon attemp... SetAndHandleEmpty Set events of uncommon high volume of actions - SetAndHandleEmpty Set events of uncommon hi... SetAndHandleEmpty Set events of action uncommonly performed by the user - SetAndHandleEmpty Set events of action unco... SetAndHandleEmpty Done Done Set the number of failed login attempts by the user - SetAndHandleEmpty Set the number of failed ... SetAndHandleEmpty Set the number of failed login MFA by the user - SetAndHandleEmpty Set the number of failed ... SetAndHandleEmpty Set the number that the user was defined as a risky user - SetAndHandleEmpty Set the number that the u... SetAndHandleEmpty Search for available tables - azure-log-analytics-execute-query Search for available tables azure-log-analytics-execute-q... should perform queries on Azure Sentinel Anomalies tables? should perform queries on... should perform queries on Azure Sentinel BehaviorAnalytics tables? should perform queries on... should perform queries on Azure Sentinel IdentityInfo tables? should perform queries on...