← Back to SOC feed Coverage →

Private Key Files

kql MEDIUM Azure-Sentinel
DeviceFileEvents
backdoorhuntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-07T23:00:00Z · Confidence: medium

Hunt Hypothesis

Attackers may exfiltrate or exploit private key files to gain unauthorized access to encrypted credentials or systems, as these files grant elevated privileges. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential credential theft or lateral movement attempts early.

KQL Query

DeviceFileEvents
| where Timestamp > ago(7d)
| where FileName endswith '.pfx' or FileName endswith '.pfn' or FileName endswith '.p12'

Analytic Rule Definition

id: 2ca01fd3-afb5-4050-8a1d-6b821bdab080
name: Private Key Files
description: |
  Private Key Files.
  This query identifies file operation with files having.
  One of the extensions commonly used to save a private.
  Key.  The risk is that if an attacker were to obtain.
  The file, they could brute force any password on it.
  And potentially obtain a powerful certificate.  To do.
  This, they would only need to obtain read access to.
  The file.
  The risk associated with these files is heavily.
  Determined by the value of the certificate.  For example,.
  Loss of a self-signed certificate created by Adobe Acrobat.
  Is significantly less impactful than loss of a website.
  SSL certificate.
  Recommendation: Know where these files are, and if possible.
  Back them up and remove them.  You might also consider.
  Creating an informational alert.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceFileEvents
query: |
  DeviceFileEvents
  | where Timestamp > ago(7d)
  | where FileName endswith '.pfx' or FileName endswith '.pfn' or FileName endswith '.p12'

Required Data Sources

Sentinel TableNotes
DeviceFileEventsEnsure this data connector is enabled

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Credential Access/Private Key Files.yaml