Detecting Files Containing Potentially Sensitive Data
// Define a list of strings that might indicate sensitive information
let FileNameStrings = dynamic([
"pass",
"password",
"passwords",
"cred",
"creds",
"credential",
"credentials",
"secret",
"secrets",
"keys"
]);
// Define a list of file extensions to look for
let FileExtensions = dynamic([
"txt",
"doc",
"docx",
"bat",
"cmd",
"ps1",
"rtf",
"png",
"jpg",
"jpeg"
]);
DeviceFileEvents
| where TimeGenerated > ago(30d) // Filter events that occurred in the last 30 days
| where FileName has_any(FileNameStrings) // Filter file events where the file name contains any of the strings in FileNameStrings
| extend FileExtension = split(FileName, ".")[-1] // Extract the file extension from the file name
| where FileExtension in~(FileExtensions) // Filter file events where the file extension matches any of the extensions in FileExtensions
| project Timestamp, DeviceName, FileName, FolderPath, InitiatingProcessAccountName, InitiatingProcessCommandLine, InitiatingProcessFileName // Project relevant columns for the final output
| order by Timestamp desc // Order the results by Timestamp in descending order
PreviousDetecting Command Line Interpreters Launched via Scheduled TasksNextDetecting DeviceNetworkEvents From Windows Processes and Domains by TLD
Last updated