Event ID 5058 — Key file operation.
Description
Key file operation.
Message #
Fields #
| Name | Description |
|---|---|
SubjectUserSid SID | [Subject] Security ID |
SubjectUserName UnicodeString | [Subject] Account Name |
SubjectDomainName UnicodeString | [Subject] Account Domain |
SubjectLogonId HexInt64 | [Subject] Logon ID |
ClientProcessId UInt32 | [Process Information] Process ID |
ClientCreationTime FILETIME | [Process Information] Process Creation Time |
ProviderName UnicodeString | [Cryptographic Parameters] Provider Name |
AlgorithmName UnicodeString | [Cryptographic Parameters] Algorithm Name |
KeyName UnicodeString | [Cryptographic Parameters] Key Name |
KeyType UnicodeString | [Cryptographic Parameters] Key Type Known values
|
KeyFilePath UnicodeString | [Key File Operation Information] File Path |
Operation UnicodeString | [Key File Operation Information] Operation Known values
|
ReturnCode HexInt32 | [Key File Operation Information] Return Code |
Example Event #
{
"system": {
"provider": "Microsoft-Windows-Security-Auditing",
"guid": "54849625-5478-4994-A5BA-3E3B0328C30D",
"event_source_name": "",
"event_id": 5058,
"version": 1,
"level": 0,
"task": 12292,
"opcode": 0,
"keywords": 9232379236109516800,
"time_created": "2023-11-06T06:25:39.883187+00:00",
"event_record_id": 2882,
"correlation": {
"ActivityID": "F590C418-1079-0001-5BC5-90F57910DA01"
},
"execution": {
"process_id": 808,
"thread_id": 856
},
"channel": "Security",
"computer": "WinDev2310Eval",
"security": {
"user_id": ""
}
},
"event_data": {
"SubjectUserSid": "S-1-5-18",
"SubjectUserName": "WINDEV2310EVAL$",
"SubjectDomainName": "WORKGROUP",
"SubjectLogonId": "0x3e7",
"ClientProcessId": 1612,
"ClientCreationTime": "2023-11-06T06:25:38.635483Z",
"ProviderName": "Microsoft Software Key Storage Provider",
"AlgorithmName": "UNKNOWN",
"KeyName": "b87f845a-3278-6909-ee85-d3025f077fea",
"KeyType": "%%2500",
"KeyFilePath": "C:\\ProgramData\\Microsoft\\Crypto\\SystemKeys\\fb28f36d176f9b9a964a506f1b386c99_31383106-803d-411b-9763-a28cdc0f0c3f",
"Operation": "%%2458",
"ReturnCode": "0x0"
},
"message": ""
}
Detection Rules #
View all rules referencing this event →
Kusto Query Language # view in reference
- Certified Pre-Owned - backup of CA private key - rule 1 source medium: This query identifies someone that performs a read operation of they CA key from the file.
References #
- Microsoft Learn https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/event-5058
- Microsoft Learn Audit Policy https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/audit-other-system-events
- Ultimate Windows Security https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventid=5058
- Example event sourced from https://github.com/NextronSystems/evtx-baseline