Query Details

32 Coverage Operations Incident Outcomes Mttr And Fidelity

Query

// REVIEW ONLY - AWS Security Operations Workbook Visual Query
// Tab: CoverageOperations | Panel: incident-outcomes-mttr-and-fidelity | Visualization: table | Mode: All
// Security Question: Which AWS detections produce true positives versus benign/false-positive noise, and what are SOC MTTA/MTTR metrics?
// Drill-Through: Prioritize rules with NoisyTuningCandidate == true for watchlist tuning (AWS_ApprovedAutomationPrincipals / AWS_TrustedDomainsAndScanners).
// Empty/No-Data Contract: No AWS-related SecurityIncident records in the selected window.
let Start = {TimeRange:start};
let End = {TimeRange:end};
let OrgFilter = base64_decode_tostring("{Organization:base64}");
let AccountFilter = base64_decode_tostring("{AwsAccount:base64}");
let RegionFilter = base64_decode_tostring("{AwsRegion:base64}");
let EnvFilter = base64_decode_tostring("{Environment:base64}");
let WorkloadFilter = base64_decode_tostring("{Workload:base64}");
let SeverityFilter = base64_decode_tostring("{Severity:base64}");
let SourceFilter = base64_decode_tostring("{SourceTable:base64}");
let SummaryPref = base64_decode_tostring("{SummaryMode:base64}");
let SelectedPrincipalFilter = base64_decode_tostring("{SelectedPrincipal:base64}");
let SelectedIpFilter = base64_decode_tostring("{SelectedIp:base64}");
union isfuzzy=true
    (datatable(TimeGenerated:datetime, IncidentName:string, Title:string, Severity:string, Status:string, Classification:string, CreatedTime:datetime, FirstModifiedTime:datetime, ClosedTime:datetime)[]),
    (SecurityIncident | where TimeGenerated between (Start .. End)
     | project TimeGenerated, IncidentName, Title, Severity, Status, Classification, CreatedTime, FirstModifiedTime, ClosedTime)
| summarize arg_max(TimeGenerated, *) by IncidentName
| where Title has_any ("AWS", "GuardDuty", "CloudTrail", "Route 53", "WAF", "VPC", "EKS", "S3")
| extend TriageMinutes = iff(FirstModifiedTime > CreatedTime, round(datetime_diff('second', FirstModifiedTime, CreatedTime) / 60.0, 1), real(null)),
    CloseMinutes = iff(Status == "Closed" and ClosedTime > CreatedTime, round(datetime_diff('second', ClosedTime, CreatedTime) / 60.0, 1), real(null)),
    Outcome = iff(isempty(Classification), "OpenOrUnclassified", Classification)
| summarize
    TotalIncidents = count(),
    OpenIncidents = countif(Status != "Closed"),
    TruePositives = countif(Outcome == "TruePositive"),
    BenignPositives = countif(Outcome == "BenignPositive"),
    FalsePositives = countif(Outcome == "FalsePositive"),
    MeanTimeToAckMin = round(avg(TriageMinutes), 1),
    MeanTimeToCloseMin = round(avg(CloseMinutes), 1)
    by Title, Severity
| extend NoisyTuningCandidate = (FalsePositives + BenignPositives >= 3 and TruePositives == 0)
| order by NoisyTuningCandidate desc, TotalIncidents desc
| take 5000

Explanation

This query is designed to analyze AWS security incidents and evaluate their outcomes and response times. Here's a simplified explanation:

  1. Purpose: The query aims to identify which AWS security detections are true positives (actual threats) versus benign or false positives (non-threats or noise). It also calculates the Security Operations Center (SOC) metrics for Mean Time to Acknowledge (MTTA) and Mean Time to Resolve (MTTR) incidents.

  2. Filters: It applies several filters based on organization, AWS account, region, environment, workload, severity, source, and other parameters to narrow down the data to the relevant incidents.

  3. Data Collection: It gathers security incident data within a specified time range, focusing on incidents related to AWS services like GuardDuty, CloudTrail, and others.

  4. Metrics Calculation:

    • Total Incidents: Counts all incidents.
    • Open Incidents: Counts incidents that are not closed.
    • True Positives: Counts incidents classified as true threats.
    • Benign Positives: Counts incidents that are benign but not threats.
    • False Positives: Counts incidents incorrectly identified as threats.
    • MTTA (Mean Time to Acknowledge): Average time taken to acknowledge an incident.
    • MTTR (Mean Time to Resolve): Average time taken to resolve an incident.
  5. Noisy Tuning Candidate: Identifies rules that may need tuning because they generate a lot of noise (false or benign positives) without any true positives.

  6. Output: The results are sorted to prioritize potential tuning candidates and are limited to the top 5000 incidents.

This query helps security teams focus on improving detection rules by identifying noisy rules and provides insights into the efficiency of incident response processes.