insider-threat-detection-queries (18)
Description
Intent: - Use MTP capability to look for insider threat potential risk indicators - Indicators would then serve as the building block for insider threat risk modeling in subsequent tools Definition of Insider Threat: "The potential for an individual who has or had authorized access to an organization's assets to use their access, either maliciously or unintentionally, to act in a way that could negatively affect the organization." This collection of queries describes the different indicators that could be used to model and look for patterns suggesting an increased risk of an individual becoming a potential insider threat. Note: no single indicator should be used as a lone determinant of insider threat activity, but should be part of an overall program to understand the increased risk to your organization's critical assets. This in turn is used to feed an investigation by a formal insider threat program to look at the context associated with the whole person to understand the implication of a set of indicators.
Query · kql
//Reference: https://github.com/microsoft/Microsoft-threat-protection-Hunting-Queries/blob/master/Lateral%20Movement/ServiceAccountsPerformingRemotePS.txt
// --------------------------------------------------------------------------------------------------------------------------- //
//
//Outbound Email with Attachments of Interest
//
// This snippet looks for anyone sending code as an attachment based on
// extension. A more advanced version would use depend on DLP to determine
// attachment type and indicate as a potential field in EmailAttachmentInfo
//
// whitelist any senders
let okaySenders = dynamic(["postmaster@finnet.onmicrosoft.com"]);
//
let eattach = EmailAttachmentInfo
| where SenderFromAddress !in (okaySenders)
| project Timestamp, FileName, SenderFromAddress, NetworkMessageId
// add list of extensions relevant to your organization
| where FileName endswith ".cs" or
FileName endswith ".c" or
FileName endswith ".h" or
FileName endswith ".hpp" or
FileName endswith ".hxx" or
FileName endswith ".cpp" or
FileName endswith ".hh" or
FileName endswith ".cpp" or
FileName endswith ".cc" or
FileName endswith ".cxx" or
FileName endswith ".py";
// get the emails associated with attachements
eattach
| join EmailEvents on NetworkMessageId
// Remove (or change) this line for email direction
| where DeliveryLocation == "On-premises/external"
//
// report stats
// include this line if you want just summary of how often it occurs
//| summarize outbound_emails_with_attachments=count()
// or include this line if you want to know per sender
//| summarize outbound_emails_with_attachments=count() by SenderFromAddress