{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workspace": {
      "type": "String"
    }
  },
  "resources": [
    {
      "apiVersion": "2024-01-01-preview",
      "id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/634a69b4-0e46-4349-8463-af1c8d191620')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/634a69b4-0e46-4349-8463-af1c8d191620')]",
      "properties": {
        "alertDetailsOverride": {
          "alertDescriptionFormat": "The following Tier 0 {{ObjectName}} object was added to the Allow RODC Password Replication Group.",
          "alertDisplayNameFormat": "(TM017.1) A Tier 0 member was added to the Allow RODC Password Replication Group"
        },
        "alertRuleTemplateName": "634a69b4-0e46-4349-8463-af1c8d191620",
        "customDetails": {
          "Account": "Account",
          "ActivityType": "ActivityType",
          "Channel": "Channel",
          "Computer": "Computer",
          "Domain": "Domain",
          "EventData": "EventData",
          "EventID": "EventID",
          "GroupName": "GroupName",
          "ObjectName": "ObjectName",
          "ObjectTier": "ObjectTier",
          "ObjectType": "ObjectType",
          "OperationType": "OperationType"
        },
        "description": "Adding a Tier 0 object to the Allow RODC Password Replication Group.\n",
        "displayName": "PROD (TM017.1) - GROUP - Tier 0 Added to Allow RODC Password Replication Group",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "ObjectName",
                "identifier": "FullName"
              }
            ]
          },
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "GroupName",
                "identifier": "FullName"
              }
            ]
          },
          {
            "entityType": "Host",
            "fieldMappings": [
              {
                "columnName": "Computer",
                "identifier": "HostName"
              }
            ]
          },
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "Account",
                "identifier": "FullName"
              }
            ]
          }
        ],
        "eventGroupingSettings": {
          "aggregationKind": "AlertPerResult"
        },
        "incidentConfiguration": {
          "createIncident": true,
          "groupingConfiguration": {
            "enabled": false,
            "lookbackDuration": "PT5H",
            "matchingMethod": "AllEntities",
            "reopenClosedIncident": false
          }
        },
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Microsoft%20Active%20Directory%20Tier%20Model/Analytic%20Rules/TM017_GROUPTier0AddedToAllowRODCPasswordReplicationGroup.yaml",
        "query": "SecurityEvent \n| where EventID == 5136\n    and Activity has \"modified\"\n    and EventData matches regex \"(?i)CN=Allowed RODC Password Replication Group,CN=Users\"\n    and EventData has '\"AttributeLDAPDisplayName\">member'\n    and EventData has 'OperationType\">14674', \"Added\", tostring(OperationType))\n| project TimeGenerated \n        , ObjectName\n        , ObjectTier\n        , ObjectType = AccountType\n        , GroupName\n        , ActivityType\n        , OperationType\n        , Account\n        , Domain\n        , Computer\n        , Channel\n        , EventID\n        , EventData\n",
        "queryFrequency": "PT5M",
        "queryPeriod": "PT5M",
        "severity": "High",
        "status": "Available",
        "subTechniques": [
          "T1078.002"
        ],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "PrivilegeEscalation"
        ],
        "techniques": [
          "T1078"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}
