Detection rules › Splunk

Azure Automation Runbook Created

Status
production
Severity
medium
Group by
aws::recipientAccountId, dest, object, object_path, src, user, vendor_product
Author
Mauricio Velazco, Brian Serocki, Splunk
Source
github.com/splunk/security_content

The following analytic detects the creation of a new Azure Automation Runbook within an Azure tenant. It leverages Azure Audit events, specifically the Azure Activity log category, to identify when a new Runbook is created or updated. This activity is significant because adversaries with privileged access can use Runbooks to maintain persistence, escalate privileges, or execute malicious code. If confirmed malicious, this could lead to unauthorized actions such as creating Global Administrators, executing code on VMs, and compromising the entire Azure environment.

MITRE ATT&CK coverage

TacticTechniques
PersistenceT1136.003 Create Account: Cloud Account

Rule body splunk

name: Azure Automation Runbook Created
id: 178d696d-6dc6-4ee8-9d25-93fee34eaf5b
version: 14
creation_date: '2022-08-22'
modification_date: '2026-05-13'
author: Mauricio Velazco, Brian Serocki, Splunk
status: production
type: TTP
description: The following analytic detects the creation of a new Azure Automation Runbook within an Azure tenant. It leverages Azure Audit events, specifically the Azure Activity log category, to identify when a new Runbook is created or updated. This activity is significant because adversaries with privileged access can use Runbooks to maintain persistence, escalate privileges, or execute malicious code. If confirmed malicious, this could lead to unauthorized actions such as creating Global Administrators, executing code on VMs, and compromising the entire Azure environment.
data_source:
    - Azure Audit Create or Update an Azure Automation Runbook
search: |-
    `azure_audit` operationName.value="Microsoft.Automation/automationAccounts/runbooks/write" object!=AzureAutomationTutorial* status.value=Succeeded
      | dedup object
      | rename claims.ipaddr as src, subscriptionId as vendor_account, operationName.value as operationName
      | stats count min(_time) as firstTime max(_time) as lastTime
        BY dest user src
           vendor_account vendor_product object
           object_path
      | `security_content_ctime(firstTime)`
      | `security_content_ctime(lastTime)`
      | `azure_automation_runbook_created_filter`
how_to_implement: You must install the latest version of Splunk Add-on for Microsoft Cloud Services from Splunkbase (https://splunkbase.splunk.com/app/3110/#/details). You must be ingesting Azure Audit events into your Splunk environment. Specifically, this analytic leverages the Azure Activity log category.
known_false_positives: Administrators may legitimately create Azure Automation Runbooks. Filter as needed.
references:
    - https://docs.microsoft.com/en-us/azure/automation/overview
    - https://docs.microsoft.com/en-us/azure/automation/automation-runbook-types
    - https://docs.microsoft.com/en-us/azure/automation/manage-runbooks
    - https://www.inversecos.com/2021/12/how-to-detect-malicious-azure.html
    - https://www.netspi.com/blog/technical/cloud-penetration-testing/maintaining-azure-persistence-via-automation-accounts/
    - https://microsoft.github.io/Azure-Threat-Research-Matrix/Persistence/AZT503/AZT503-3/
    - https://attack.mitre.org/techniques/T1136/003/
drilldown_searches:
    - name: View the detection results for - "$user$"
      search: '%original_detection_search% | search  user = "$user$"'
      earliest_offset: $info_min_time$
      latest_offset: $info_max_time$
    - name: View risk events for the last 7 days for - "$user$"
      search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$") | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
      earliest_offset: 7d
      latest_offset: "0"
finding:
    title: A new Azure Automation Runbook $object$ was created by $user$
    entity:
        field: user
        type: user
        score: 50
analytic_story:
    - Azure Active Directory Persistence
asset_type: Azure Tenant
mitre_attack_id:
    - T1136.003
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: cloud
security_domain: audit
tests:
    - name: True Positive Test
      attack_data:
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1078.004/azure_automation_runbook/azure-activity.log
          source: mscs:azure:audit
          sourcetype: mscs:azure:audit
      test_type: unit

Stages and Predicates

Stage 1: search

`azure_audit` operationName.value="Microsoft.Automation/automationAccounts/runbooks/write" object!=AzureAutomationTutorial* status.value=Succeeded

Stage 2: dedup

| dedup object

Stage 3: rename

| rename claims.ipaddr as src, subscriptionId as vendor_account, operationName.value as operationName

Stage 4: stats

| stats count min(_time) as firstTime max(_time) as lastTime
    BY dest user src
       vendor_account vendor_product object
       object_path

Stage 5: search

| `security_content_ctime(firstTime)`

Stage 6: search

| `security_content_ctime(lastTime)`

Stage 7: search

| `azure_automation_runbook_created_filter`

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
objectne
  • AzureAutomationTutorial*
operationName.valueeq
  • "Microsoft.Automation/automationAccounts/runbooks/write"
sourcetypeeq
  • mscs:azure:audit
status.valueeq
  • Succeeded