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 1

Back
Idaa5eaac7-1264-4833-b620-8f062be75541
RulenameCertified Pre-Owned - backup of CA private key - rule 1
DescriptionThis query identifies someone that performs a read operation of they CA key from the file.
SeverityMedium
TacticsDefenseEvasion
TechniquesT1036
Required data connectorsSecurityEvents
WindowsSecurityEvents
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-1.yaml
Version1.0.1
Arm templateaa5eaac7-1264-4833-b620-8f062be75541.json
Deploy To Azure
SecurityEvent
// Fill in the machine name of your CA.
| where EventID == 5058 and Computer contains "<YOUR CA MACHINE NAME>"
| where EventData contains "%%2499" // Machine key.
| 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"])
)
| mv-apply d=EventData.EventData.Data on
(
    where d["@Name"]=="Operation"
    | project Operation=tostring(d["#text"])
)
| extend Operation=iff(Operation == "%%2458", "Read persisted key from file", Operation)
// This one is a guess and very poorly documented :(
| extend Operation=iff(Operation == "%%2459", "Write persisted key to file", Operation)
// Fill in the keyname of the CA key.
| where KeyName == "<INSERT ISSUING CA KEY HERE>" // Or any other key you want to monitor.
description: |
    This query identifies someone that performs a read operation of they CA key from the file.
kind: Scheduled
tactics:
- DefenseEvasion
requiredDataConnectors:
- connectorId: SecurityEvents
  dataTypes:
  - SecurityEvent
- connectorId: WindowsSecurityEvents
  dataTypes:
  - SecurityEvent
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/FalconFriday/Analytic Rules/CertifiedPreOwned-backup-key-1.yaml
severity: Medium
name: Certified Pre-Owned - backup of CA private key - rule 1
triggerThreshold: 0
queryPeriod: 1h
query: |
  SecurityEvent
  // Fill in the machine name of your CA.
  | where EventID == 5058 and Computer contains "<YOUR CA MACHINE NAME>"
  | where EventData contains "%%2499" // Machine key.
  | 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"])
  )
  | mv-apply d=EventData.EventData.Data on
  (
      where d["@Name"]=="Operation"
      | project Operation=tostring(d["#text"])
  )
  | extend Operation=iff(Operation == "%%2458", "Read persisted key from file", Operation)
  // This one is a guess and very poorly documented :(
  | extend Operation=iff(Operation == "%%2459", "Write persisted key to file", Operation)
  // Fill in the keyname of the CA key.
  | where KeyName == "<INSERT ISSUING CA KEY HERE>" // Or any other key you want to monitor.  
relevantTechniques:
- T1036
id: aa5eaac7-1264-4833-b620-8f062be75541
queryFrequency: 1h
status: Available
triggerOperator: gt
version: 1.0.1
entityMappings:
- entityType: Host
  fieldMappings:
  - columnName: Computer
    identifier: FullName