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

Certified Pre-Owned - backup of CA private key - rule 2

Back
Id88f8fbc0-345d-458e-85f6-f73921d5ef50
RulenameCertified Pre-Owned - backup of CA private key - rule 2
DescriptionThis query identifies someone that performs a backup of they CA key.
SeverityMedium
TacticsDefenseEvasion
TechniquesT1036
Required data connectorsSecurityEvents
KindScheduled
Query frequency1h
Query period1h
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/FalconFriday/Analytic Rules/CertifiedPreOwned-backup-key-2.yaml
Version1.0.0
Arm template88f8fbc0-345d-458e-85f6-f73921d5ef50.json
Deploy To Azure
SecurityEvent
// Fill in the machine name of your CA.
| where EventID == 5059 and Computer contains "<YOUR CA MACHINE NAME>"
| where EventData contains "%%2499" and EventData contains "%%2464"
| extend EventData=parse_xml(EventData)
| mv-apply d=EventData.EventData.Data on
(
    where d["@Name"]=="KeyName"
    | project KeyName=tostring(d["#text"])
)
| mv-apply d=EventData.EventData.Data on
(
    where d["@Name"]=="SubjectUserName"
    | project SubjectUserName=tostring(d["#text"])
)
| parse Account with "<YOUR DOMAIN NAME>\\" CleanAccount "$"
| where not(Computer startswith CleanAccount)
kind: Scheduled
queryPeriod: 1h
description: |
    This query identifies someone that performs a backup of they CA key.
tactics:
- DefenseEvasion
id: 88f8fbc0-345d-458e-85f6-f73921d5ef50
requiredDataConnectors:
- connectorId: SecurityEvents
  dataTypes:
  - SecurityEvent
relevantTechniques:
- T1036
severity: Medium
version: 1.0.0
status: Available
entityMappings:
- entityType: Host
  fieldMappings:
  - identifier: FullName
    columnName: Computer
name: Certified Pre-Owned - backup of CA private key - rule 2
triggerOperator: gt
query: |
  SecurityEvent
  // Fill in the machine name of your CA.
  | where EventID == 5059 and Computer contains "<YOUR CA MACHINE NAME>"
  | where EventData contains "%%2499" and EventData contains "%%2464"
  | extend EventData=parse_xml(EventData)
  | mv-apply d=EventData.EventData.Data on
  (
      where d["@Name"]=="KeyName"
      | project KeyName=tostring(d["#text"])
  )
  | mv-apply d=EventData.EventData.Data on
  (
      where d["@Name"]=="SubjectUserName"
      | project SubjectUserName=tostring(d["#text"])
  )
  | parse Account with "<YOUR DOMAIN NAME>\\" CleanAccount "$"
  | where not(Computer startswith CleanAccount)  
queryFrequency: 1h
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/FalconFriday/Analytic Rules/CertifiedPreOwned-backup-key-2.yaml
triggerThreshold: 0
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workspace": {
      "type": "String"
    }
  },
  "resources": [
    {
      "apiVersion": "2023-02-01-preview",
      "id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/88f8fbc0-345d-458e-85f6-f73921d5ef50')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/88f8fbc0-345d-458e-85f6-f73921d5ef50')]",
      "properties": {
        "alertRuleTemplateName": "88f8fbc0-345d-458e-85f6-f73921d5ef50",
        "customDetails": null,
        "description": "This query identifies someone that performs a backup of they CA key.\n",
        "displayName": "Certified Pre-Owned - backup of CA private key - rule 2",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "Host",
            "fieldMappings": [
              {
                "columnName": "Computer",
                "identifier": "FullName"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/FalconFriday/Analytic Rules/CertifiedPreOwned-backup-key-2.yaml",
        "query": "SecurityEvent\n// Fill in the machine name of your CA.\n| where EventID == 5059 and Computer contains \"<YOUR CA MACHINE NAME>\"\n| where EventData contains \"%%2499\" and EventData contains \"%%2464\"\n| extend EventData=parse_xml(EventData)\n| mv-apply d=EventData.EventData.Data on\n(\n    where d[\"@Name\"]==\"KeyName\"\n    | project KeyName=tostring(d[\"#text\"])\n)\n| mv-apply d=EventData.EventData.Data on\n(\n    where d[\"@Name\"]==\"SubjectUserName\"\n    | project SubjectUserName=tostring(d[\"#text\"])\n)\n| parse Account with \"<YOUR DOMAIN NAME>\\\\\" CleanAccount \"$\"\n| where not(Computer startswith CleanAccount)\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "PT1H",
        "severity": "Medium",
        "status": "Available",
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "DefenseEvasion"
        ],
        "techniques": [
          "T1036"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}