Microsoft Sentinel Triage AssistanT (STAT)

repository·main·Indexed 43 days ago

https://github.com/briandelmsft/sentinelautomationmodules

A Logic Apps Custom Connector providing a library of reusable automation modules for triaging and analyzing Microsoft Sentinel incidents and entities. It includes a Base Module for entity enrichment (supporting Accounts, IPs, Hosts, Files, and more) and specialized modules such as Get-AADUserRisksInfo for Azure AD Identity Protection risk levels and Get-FileInsights for file and hash analysis via Microsoft Defender.

Tokens
15.7K
Snippets
24
Records
59
Agent score
54%

What's inside STAT

  1. Overview of Microsoft Sentinel Triage AssistanT (STAT)

    main

    Microsoft Sentinel Triage AssistanT (STAT) is a Logic Apps Custom Connector designed to simplify automated incident triage in Microsoft Sentinel. It provides access to a library of Automation Modules that can be called directly from Incident or alert-based Microsoft Sentinel playbooks.

    Instead of building complex logic within every individual playbook, you can offload heavy lifting to these callable modules. This ensures consistency and ease of use when performing automated analysis, such as assessing whether an 'impossible travel' incident is a true threat or a false positive based on customized criteria.

  2. Overview of STAT Automation Modules

    main
    The Microsoft Sentinel Triage AssistanT (STAT) Automation Modules are a collection of callable Azure Logic Apps designed to automate routine security triage tasks. Instead of building complex logic from scratch, developers can call these modules to enrich incident data, query security products, and calculate risk scores. These modules are designed to work together, often using the output of one module as the input for another.
  3. Overview of the STAT Custom Logic Apps Connector

    main
    The STAT Custom Logic Apps Connector is a specialized connector designed for Azure Logic Apps. It serves as an orchestration layer that links various STAT (Sentinel Triage AssistanT) modules together. This allows users to interact with individual modules through a unified interface, simplifying the process of calling specific automation modules and handling their returned results within a Logic App workflow.
  4. Use the Get-ThreatIntel module

    main

    The Get-ThreatIntel module checks incident entities in Microsoft Sentinel against existing threat intelligence in the ThreatIntelligenceIndicators table. It supports the following entity types:

    • IP
    • Domain
    • URL
    • FileHash

    This module is useful for automating the triage process by identifying if any indicators associated with an incident have known threat intelligence matches.

  5. How to use STAT modules in Microsoft Sentinel playbooks

    main

    To use STAT for incident triage, follow this workflow:

    1. Call the Base Module: Every automation flow must start by calling the Base Module. This module prepares and enriches the Incident and entity data.
    2. Call Triage Modules: Once the Base Module has enriched the data, you can call specific triage modules. These modules consume the enriched data to perform analysis against the entities related to the Microsoft Sentinel incident.
    3. Evaluate Results: Triage modules return well-documented, easy-to-use results. Use these outputs in your Logic App to decide whether to close the incident, lower its severity, or trigger a remediation playbook.
  6. Understand scoring logic for supported STAT modules

    main

    The Calculate-RiskScore module applies specific logic depending on the input module:

    • AAD Risks: Based on Azure AD Identity Protection risk levels (High: 10, Medium: 5, Low: 3, None: 0). If ScorePerItem=True, returns the sum; otherwise, returns the highest severity score.
    • Microsoft Defender for Endpoint (MDE): Calculated from UsersHighestRiskScore, HostsHighestRiskScore, and IPsHighestRiskScore. If ScorePerItem=True, returns the sum of the three; otherwise, returns the maximum value. (High: 10, Medium: 5, Low: 3, Informational: 1).
    • Related Alerts: Based on Alert Severity (High: 10, Medium: 5, Low: 3, Informational: 1). If ScorePerItem=True, returns the sum; otherwise, returns the highest severity. Note: Adds 10 points per unique MITRE tactic associated with the incident/alerts.
    • KQL Module: If ScorePerItem=True, score is 5 * ItemCount * ScoreMultiplier. If False, score is 5 * ScoreMultiplier if results exist.
    • Threat Intelligence: If ScorePerItem=True, score is 10 * MatchedTIItemCount * ScoreMultiplier. If False, score is 10 * ScoreMultiplier if matches found.
    • Watchlist: If ScorePerItem=True, score is 10 * WatchlistMatchCount * ScoreMultiplier. If False, score is 10 * ScoreMultiplier if matches found.
    • UEBA: Sum of InvestigationPriorityMax * ScoreMultiplier, plus 10 * ScoreMultiplier if TI matches are found, plus AnomalyTacticsCount * 10 * ScoreMultiplier for unique MITRE tactics in anomalies.
    • File Module: Calculated as (HashesLinkedToThreatCount * 10 * ScoreMultiplier). ScorePerItem has no impact.
    • MDCA: If ScorePerItem=True, score is (AboveThresholdCount * 10 * ScoreMultiplier). If False, score is 10 * ScoreMultiplier if AboveThresholdCount > 0.
  7. Build KQL queries using entity tables

    main

    When running queries, you have access to three specialized tables built from the entity data of the Sentinel Incident. You can use these via join or where clauses to correlate incident data with other logs.

    Available Entity Tables

    accountEntities

    Contains user-related data:

    • UserPrincipalName
    • SamAccountName
    • ObjectSID
    • AADUserId
    • ManagerUPN

    ipEntities

    Contains IP-related data:

    • IPAddress
    • Latitude
    • Longitude
    • Country
    • State

    hostEntities

    Contains host-related data:

    • FQDN
    • Hostname

    Query Examples

    Using a Join:

    accountEntities
    | join kind=inner (SigninLogs | where ResultType == 50126 | summarize FailureCount=count() by UserPrincipalName | where FailureCount >= 10) on UserPrincipalName

    Using a Where clause:

    let UPNs = accountEntities | project UserPrincipalName;
    SigninLogs
    | where UserPrincipalName in (UPNs) and ResultType == 50126
    | summarize FailureCount=count() by UserPrincipalName
    | where FailureCount >= 10
  8. Use the Base Module for entity enrichment

    main

    The BaseModule is a mandatory prerequisite that must be called before any other modules in the Microsoft Sentinel Triage AssistanT (STAT) solution. Its primary purpose is to enrich entity data and format it into a consistent structure for downstream modules.

    Supported Entity Types:

    • Account
    • IP
    • Host
    • File
    • FileHash
    • DnsDomain
    • URL

    Note: Any entity types not listed above will be returned in the OtherEntities array without enrichments.

  9. Integrate custom scoring data into Calculate-RiskScore

    main

    You can incorporate scores from external sources (e.g., 3rd party threat intelligence or vulnerability management) by formatting a custom JSON message.

    Requirements:

    • The ModuleName must be set to Custom.
    • The ScoringData array must contain objects with a Score property as an integer. If the property is missing or not an integer, the item is dropped.
    • ScorePerItem and ScoreLabel are ignored for custom data; the ScoreLabel from the JSON will be used, and all items in the array are processed regardless of the ScorePerItem setting.
    • The Score provided in the ScoringData will be multiplied by the ScoringData-ScoreMultiplier parameter.
    {
       "ModuleName": "Custom",
       "ScoringData": [
          {
             "Score": 5,
             "ScoreLabel": "Virus Total - Medium Risk"
          },
          {
             "Score": 10,
             "ScoreLabel": "Custom Vulnerability Management Score"
          }
       ]
    }
  10. Use the Get-MDEInsights module

    main

    The Get-MDEInsights module retrieves risk scores and exposure levels from Microsoft Defender for Endpoint (MDE). It analyzes machines where a user has logged on interactively or machines associated with specific IP addresses.

    Supported Entity Types

    • Accounts: Requires objectSid to be available.
    • IPs: Analyzes specific IP addresses.
    • Hosts: Uses MdatpDeviceId if present; otherwise, it constructs the FQDN from the raw entity.

    Trigger Parameters

    ParameterExpected ValuesDescription
    AddIncidentCommentsTrue/False (Default: True)If true, query results are automatically added to the Microsoft Sentinel Incident Comments.
    Base Module BodyBody (dynamic content)Must be selected from the Dynamic content of the Base-Module response.
    LookbackInDays1-30Defines the lookback period in the DeviceLogonEvents table in MDE.
    /* Example of expected parameter usage in a playbook context */
    {
      "AddIncidentComments": true,
      "Base Module Body": "{{BaseModuleBody}}",
      "LookbackInDays": 7
    }