Query Details

05 Overview Executive Action Ownership

Query

// REVIEW ONLY - AWS Security Operations Workbook Visual Query
// Tab: Overview | Panel: executive-action-ownership | Visualization: table | Mode: Executive
// Security Question: Which business/security teams own open high-severity AWS incidents requiring leadership attention?
// Drill-Through: Review OwnerAssigned/Status and navigate to Tab 10 (Coverage & Operations) for MTTR and rule fidelity.
// Empty/No-Data Contract: No open AWS-related Sentinel incidents 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, Status:string, Title:string, Severity:string, Owner:dynamic, CreatedTime:datetime)[]),
    (SecurityIncident | where TimeGenerated between (Start .. End) | project TimeGenerated, IncidentName, Status, Title, Severity, Owner=todynamic(Owner), CreatedTime)
| summarize arg_max(TimeGenerated, *) by IncidentName
| where Status != "Closed" and Title has_any ("AWS", "GuardDuty", "CloudTrail", "S3", "VPC", "Route 53", "EKS")
| extend OwnerAssigned = iff(isempty(tostring(Owner.assignedTo)), "🔴 UNASSIGNED_ACTION_REQUIRED", strcat("🟢 ", tostring(Owner.assignedTo))),
    AgeHours = round(datetime_diff('minute', now(), CreatedTime) / 60.0, 1)
| summarize OpenIncidents=count(), MaxAgeHours=max(AgeHours), SampleTitles=make_set(Title, 5)
    by Severity, Status, OwnerAssigned
| order by MaxAgeHours desc
| take 5000

Explanation

This query is designed to provide an overview of high-severity AWS security incidents that are currently open and require attention from leadership. Here's a simplified breakdown of what the query does:

  1. Time Range and Filters: The query starts by setting a time range and applying various filters based on organization, AWS account, region, environment, workload, severity, source, principal, and IP address. These filters are decoded from base64 strings.

  2. Data Collection: It gathers data from a table of security incidents, focusing on incidents generated within the specified time range.

  3. Incident Filtering: The query looks for incidents that are not closed and have titles related to AWS services like GuardDuty, CloudTrail, S3, VPC, Route 53, and EKS.

  4. Ownership and Age Calculation: For each incident, it checks if an owner is assigned. If not, it marks the incident as "UNASSIGNED_ACTION_REQUIRED." It also calculates how long each incident has been open in hours.

  5. Summarization: The query summarizes the data by counting the number of open incidents, finding the maximum age of these incidents, and listing up to five sample titles for each combination of severity, status, and ownership.

  6. Ordering and Limiting Results: The results are ordered by the maximum age of the incidents in descending order, and the query returns up to 5000 records.

In essence, this query helps identify which business or security teams need to address open, high-severity AWS incidents, highlighting those that have been open the longest and whether they have been assigned to someone for action.