01 Overview Critical Posture Tiles
Query
// REVIEW ONLY - AWS Security Operations Workbook Visual Query
// Tab: Overview | Panel: critical-posture-tiles | Visualization: tiles | Mode: All
// Security Question: What are the headline AWS security posture indicators requiring immediate attention?
// Drill-Through: Use the domain jump links above to inspect each tile category in detail.
// Empty/No-Data Contract: Summary tiles always render 6 posture indicators.
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}");
let GdHigh = toscalar(union isfuzzy=true
(datatable(TimeGenerated:datetime, Id:string, AccountId:string, Region:string, ServiceDetails:dynamic, Severity:real)[]),
(AWSGuardDuty | where TimeGenerated between (Start .. End) | project TimeGenerated, Id, AccountId, Region, ServiceDetails=todynamic(ServiceDetails), Severity=todouble(Severity))
| where (AccountFilter == "*" or AccountId == AccountFilter) and (RegionFilter == "*" or Region == RegionFilter)
| summarize arg_max(TimeGenerated, *) by Id
| where tobool(ServiceDetails.archived) != true and Severity >= 7.0
| count);
let OpenIncidents = toscalar(union isfuzzy=true
(datatable(TimeGenerated:datetime, IncidentName:string, Status:string, Title:string)[]),
(SecurityIncident | where TimeGenerated between (Start .. End) | project TimeGenerated, IncidentName, Status, Title)
| summarize arg_max(TimeGenerated, *) by IncidentName
| where Status != "Closed" and Title has_any ("AWS", "GuardDuty", "CloudTrail", "Route 53", "VPC", "S3", "EKS")
| count);
let Trail = union isfuzzy=true
(datatable(TimeGenerated:datetime, RecipientAccountId:string, AWSRegion:string, UserIdentityType:string, SessionMfaAuthenticated:string, ReadOnly:bool, EventSource:string, EventName:string, ErrorCode:string, SourceIpAddress:string)[]),
(AWSCloudTrail | where TimeGenerated between (Start .. End)
| project TimeGenerated, RecipientAccountId, AWSRegion, UserIdentityType, SessionMfaAuthenticated=tostring(SessionMfaAuthenticated), ReadOnly, EventSource, EventName, ErrorCode, SourceIpAddress)
| where (AccountFilter == "*" or RecipientAccountId == AccountFilter) and (RegionFilter == "*" or AWSRegion == RegionFilter);
let RootOrNoMfa = toscalar(Trail | where UserIdentityType =~ "Root" or (tolower(SessionMfaAuthenticated) != "true" and ReadOnly == false and EventSource in ("iam.amazonaws.com", "kms.amazonaws.com", "cloudtrail.amazonaws.com")) | count);
let DeniedCalls = toscalar(Trail | where isnotempty(ErrorCode) | count);
let ExternalCountries = toscalar(Trail | where isnotempty(SourceIpAddress) and isnotnull(parse_ipv4(SourceIpAddress)) and not(ipv4_is_private(SourceIpAddress))
| extend Country = tostring(geo_info_from_ip_address(SourceIpAddress).country) | where isnotempty(Country) | summarize dcount(Country));
let UebaAnom = toscalar(union isfuzzy=true
(datatable(TimeGenerated:datetime)[]),
(Anomalies | where TimeGenerated between (Start .. End) and (AnomalyTemplateName has_any ("AwsCloudTrail", "AWS", "GuardDuty") or RuleName has_any ("AwsCloudTrail", "AWS", "GuardDuty")) | project TimeGenerated),
(SentinelBehaviorInfo | where TimeGenerated between (Start .. End) and (DataSources has_any ("AWS", "CloudTrail") or AdditionalFields has "AWSCloudTrail") | project TimeGenerated)
| count);
print
M1 = "🔴 High/Critical GuardDuty", V1 = GdHigh,
M2 = "🚨 Open AWS Incidents", V2 = OpenIncidents,
M3 = "👑 Root / No-MFA Mutations", V3 = RootOrNoMfa,
M4 = "❌ AccessDenied API Calls", V4 = DeniedCalls,
M5 = "🌍 External Geo Countries", V5 = ExternalCountries,
M6 = "🧠 UEBA & Anomaly Signals", V6 = UebaAnom
| project Metric = pack_array(M1, M2, M3, M4, M5, M6),
Value = pack_array(V1, V2, V3, V4, V5, V6)
| mv-expand Metric to typeof(string), Value to typeof(long)
| take 5000Explanation
This query is designed to provide an overview of critical AWS security posture indicators that require immediate attention. It summarizes six key metrics related to AWS security operations:
-
High/Critical GuardDuty Alerts (🔴 High/Critical GuardDuty): Counts the number of high-severity alerts from AWS GuardDuty that are not archived and have a severity level of 7.0 or higher.
-
Open AWS Incidents (🚨 Open AWS Incidents): Counts the number of open security incidents related to AWS services such as GuardDuty, CloudTrail, Route 53, VPC, S3, and EKS.
-
Root / No-MFA Mutations (👑 Root / No-MFA Mutations): Counts the number of actions performed by root users or users without MFA (Multi-Factor Authentication) on critical AWS services like IAM, KMS, and CloudTrail.
-
AccessDenied API Calls (❌ AccessDenied API Calls): Counts the number of API calls that resulted in an "AccessDenied" error.
-
External Geo Countries (🌍 External Geo Countries): Counts the distinct number of external countries from which AWS resources were accessed, based on IP addresses that are not private.
-
UEBA & Anomaly Signals (🧠 UEBA & Anomaly Signals): Counts the number of anomaly signals detected by User and Entity Behavior Analytics (UEBA) related to AWS services.
The query uses various filters such as time range, organization, account, region, environment, workload, severity, source, selected principal, and selected IP to refine the data. It ensures that summary tiles always display six posture indicators, regardless of data availability. The results are presented in a format suitable for visualization in a dashboard, with each metric paired with its corresponding value.