Microsoft Sentinel Analytic Rules
cloudbrothers.infoAzure Sentinel RepoToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

User Added to Admin Role

Back
Id2a09f8cb-deb7-4c40-b08b-9137667f1c0b
RulenameUser Added to Admin Role
DescriptionDetects a user being added to a new privileged role. Monitor these additions to ensure the users are made eligible for these roles are intended to have these levels of access.

Ref: https://docs.microsoft.com/azure/active-directory/fundamentals/security-operations-privileged-accounts#changes-to-privileged-accounts
SeverityLow
TacticsPrivilegeEscalation
TechniquesT1078.004
Required data connectorsAzureActiveDirectory
KindScheduled
Query frequency1d
Query period1d
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Detections/AuditLogs/UserAddedtoAdminRole.yaml
Version1.0.1
Arm template2a09f8cb-deb7-4c40-b08b-9137667f1c0b.json
Deploy To Azure
AuditLogs
  | where OperationName in ("Add eligible member (permanent)", "Add eligible member (eligible)")
  | extend Role = tostring(TargetResources[0].displayName)
  | where Role contains "admin"
  | extend AddedBy = tostring(parse_json(tostring(InitiatedBy.user)).userPrincipalName)
  | extend AddedUser = tostring(TargetResources[2].userPrincipalName)
  | project-reorder TimeGenerated, AddedUser, Role, AddedBy
queryFrequency: 1d
metadata:
  author:
    name: Pete Bryan
  source:
    kind: Community
  categories:
    domains:
    - Security - Others
    - Identity
  support:
    tier: Community
triggerOperator: gt
tactics:
- PrivilegeEscalation
description: |
  'Detects a user being added to a new privileged role. Monitor these additions to ensure the users are made eligible for these roles are intended to have these levels of access.
    Ref: https://docs.microsoft.com/azure/active-directory/fundamentals/security-operations-privileged-accounts#changes-to-privileged-accounts'  
relevantTechniques:
- T1078.004
name: User Added to Admin Role
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Detections/AuditLogs/UserAddedtoAdminRole.yaml
severity: Low
triggerThreshold: 0
version: 1.0.1
entityMappings:
- entityType: Account
  fieldMappings:
  - identifier: FullName
    columnName: AddedBy
- entityType: Account
  fieldMappings:
  - identifier: FullName
    columnName: AddedUser
tags:
- AADSecOpsGuide
id: 2a09f8cb-deb7-4c40-b08b-9137667f1c0b
requiredDataConnectors:
- connectorId: AzureActiveDirectory
  dataTypes:
  - AuditLogs
kind: Scheduled
query: |
  AuditLogs
    | where OperationName in ("Add eligible member (permanent)", "Add eligible member (eligible)")
    | extend Role = tostring(TargetResources[0].displayName)
    | where Role contains "admin"
    | extend AddedBy = tostring(parse_json(tostring(InitiatedBy.user)).userPrincipalName)
    | extend AddedUser = tostring(TargetResources[2].userPrincipalName)
    | project-reorder TimeGenerated, AddedUser, Role, AddedBy  
queryPeriod: 1d
{
  "$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/2a09f8cb-deb7-4c40-b08b-9137667f1c0b')]",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/2a09f8cb-deb7-4c40-b08b-9137667f1c0b')]",
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules",
      "kind": "Scheduled",
      "apiVersion": "2022-11-01",
      "properties": {
        "displayName": "User Added to Admin Role",
        "description": "'Detects a user being added to a new privileged role. Monitor these additions to ensure the users are made eligible for these roles are intended to have these levels of access.\n  Ref: https://docs.microsoft.com/azure/active-directory/fundamentals/security-operations-privileged-accounts#changes-to-privileged-accounts'\n",
        "severity": "Low",
        "enabled": true,
        "query": "AuditLogs\n  | where OperationName in (\"Add eligible member (permanent)\", \"Add eligible member (eligible)\")\n  | extend Role = tostring(TargetResources[0].displayName)\n  | where Role contains \"admin\"\n  | extend AddedBy = tostring(parse_json(tostring(InitiatedBy.user)).userPrincipalName)\n  | extend AddedUser = tostring(TargetResources[2].userPrincipalName)\n  | project-reorder TimeGenerated, AddedUser, Role, AddedBy\n",
        "queryFrequency": "P1D",
        "queryPeriod": "P1D",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0,
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "PrivilegeEscalation"
        ],
        "techniques": [
          "T1078.004"
        ],
        "alertRuleTemplateName": "2a09f8cb-deb7-4c40-b08b-9137667f1c0b",
        "customDetails": null,
        "entityMappings": [
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "identifier": "FullName",
                "columnName": "AddedBy"
              }
            ]
          },
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "identifier": "FullName",
                "columnName": "AddedUser"
              }
            ]
          }
        ],
        "templateVersion": "1.0.1",
        "tags": [
          "AADSecOpsGuide"
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Detections/AuditLogs/UserAddedtoAdminRole.yaml"
      }
    }
  ]
}