Certified Pre-Owned - backup of CA private key - rule 1
| Id | aa5eaac7-1264-4833-b620-8f062be75541 |
| Rulename | Certified Pre-Owned - backup of CA private key - rule 1 |
| Description | This query identifies someone that performs a read operation of they CA key from the file. |
| Severity | Medium |
| Tactics | DefenseEvasion |
| Techniques | T1036 |
| Required data connectors | SecurityEvents WindowsSecurityEvents |
| Kind | Scheduled |
| Query frequency | 1h |
| Query period | 1h |
| Trigger threshold | 0 |
| Trigger operator | gt |
| Source Uri | https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/FalconFriday/Analytic Rules/CertifiedPreOwned-backup-key-1.yaml |
| Version | 1.0.1 |
| Arm template | aa5eaac7-1264-4833-b620-8f062be75541.json |
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