Changes to Application Ownership
Id | cc5780ce-3245-4bba-8bc1-e9048c2257ce |
Rulename | Changes to Application Ownership |
Description | Detects changes to the ownership of an appplicaiton. Monitor these changes to make sure that they were authorized. Ref: https://docs.microsoft.com/azure/active-directory/fundamentals/security-operations-applications#new-owner |
Severity | Medium |
Tactics | Persistence PrivilegeEscalation |
Techniques | T1078.004 |
Required data connectors | AzureActiveDirectory |
Kind | Scheduled |
Query frequency | 1d |
Query period | 1d |
Trigger threshold | 0 |
Trigger operator | gt |
Source Uri | https://github.com/Azure/Azure-Sentinel/blob/master/Detections/AuditLogs/ChangestoApplicationOwnership.yaml |
Version | 1.0.1 |
Arm template | cc5780ce-3245-4bba-8bc1-e9048c2257ce.json |
AuditLogs
| where Category =~ "ApplicationManagement"
| where OperationName =~ "Add owner to application"
| extend appName = tostring(parse_json(tostring(InitiatedBy.app)).displayName)
| extend UPN = tostring(parse_json(tostring(InitiatedBy.user)).userPrincipalName)
| extend UpdatedBy = iif(isnotempty(appName), appName, UPN)
| extend mod_props = TargetResources[0].modifiedProperties
| extend AddedUser = TargetResources[0].userPrincipalName
| mv-expand mod_props
| where mod_props.displayName =~ "Application.DisplayName"
| extend AppName = tostring(parse_json(tostring(mod_props.newValue)))
| project-reorder TimeGenerated, OperationName, AppName, AddedUser, UpdatedBy
triggerOperator: gt
version: 1.0.1
query: |
AuditLogs
| where Category =~ "ApplicationManagement"
| where OperationName =~ "Add owner to application"
| extend appName = tostring(parse_json(tostring(InitiatedBy.app)).displayName)
| extend UPN = tostring(parse_json(tostring(InitiatedBy.user)).userPrincipalName)
| extend UpdatedBy = iif(isnotempty(appName), appName, UPN)
| extend mod_props = TargetResources[0].modifiedProperties
| extend AddedUser = TargetResources[0].userPrincipalName
| mv-expand mod_props
| where mod_props.displayName =~ "Application.DisplayName"
| extend AppName = tostring(parse_json(tostring(mod_props.newValue)))
| project-reorder TimeGenerated, OperationName, AppName, AddedUser, UpdatedBy
entityMappings:
- entityType: Account
fieldMappings:
- columnName: UpdatedBy
identifier: FullName
- entityType: Account
fieldMappings:
- columnName: AddedUser
identifier: FullName
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Detections/AuditLogs/ChangestoApplicationOwnership.yaml
queryFrequency: 1d
requiredDataConnectors:
- connectorId: AzureActiveDirectory
dataTypes:
- AuditLogs
metadata:
source:
kind: Community
author:
name: Pete Bryan
categories:
domains:
- Security - Others
support:
tier: Community
tags:
- AADSecOpsGuide
name: Changes to Application Ownership
queryPeriod: 1d
severity: Medium
kind: Scheduled
tactics:
- Persistence
- PrivilegeEscalation
id: cc5780ce-3245-4bba-8bc1-e9048c2257ce
description: |
'Detects changes to the ownership of an appplicaiton.
Monitor these changes to make sure that they were authorized.
Ref: https://docs.microsoft.com/azure/active-directory/fundamentals/security-operations-applications#new-owner'
relevantTechniques:
- T1078.004
triggerThreshold: 0
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspace": {
"type": "String"
}
},
"resources": [
{
"id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/cc5780ce-3245-4bba-8bc1-e9048c2257ce')]",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/cc5780ce-3245-4bba-8bc1-e9048c2257ce')]",
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules",
"kind": "Scheduled",
"apiVersion": "2022-11-01-preview",
"properties": {
"displayName": "Changes to Application Ownership",
"description": "'Detects changes to the ownership of an appplicaiton.\n Monitor these changes to make sure that they were authorized.\n Ref: https://docs.microsoft.com/azure/active-directory/fundamentals/security-operations-applications#new-owner'\n",
"severity": "Medium",
"enabled": true,
"query": "AuditLogs\n | where Category =~ \"ApplicationManagement\"\n | where OperationName =~ \"Add owner to application\"\n | extend appName = tostring(parse_json(tostring(InitiatedBy.app)).displayName)\n | extend UPN = tostring(parse_json(tostring(InitiatedBy.user)).userPrincipalName)\n | extend UpdatedBy = iif(isnotempty(appName), appName, UPN)\n | extend mod_props = TargetResources[0].modifiedProperties\n | extend AddedUser = TargetResources[0].userPrincipalName\n | mv-expand mod_props\n | where mod_props.displayName =~ \"Application.DisplayName\"\n | extend AppName = tostring(parse_json(tostring(mod_props.newValue)))\n | project-reorder TimeGenerated, OperationName, AppName, AddedUser, UpdatedBy\n",
"queryFrequency": "P1D",
"queryPeriod": "P1D",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0,
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"Persistence",
"PrivilegeEscalation"
],
"techniques": [
"T1078.004"
],
"alertRuleTemplateName": "cc5780ce-3245-4bba-8bc1-e9048c2257ce",
"customDetails": null,
"entityMappings": [
{
"fieldMappings": [
{
"columnName": "UpdatedBy",
"identifier": "FullName"
}
],
"entityType": "Account"
},
{
"fieldMappings": [
{
"columnName": "AddedUser",
"identifier": "FullName"
}
],
"entityType": "Account"
}
],
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Detections/AuditLogs/ChangestoApplicationOwnership.yaml",
"templateVersion": "1.0.1",
"tags": [
"AADSecOpsGuide"
]
}
}
]
}