05 Pack Alert Coverage
Query
// REVIEW ONLY workbook query: 2.2 Pack Catalog Alert Volume — All 26 Custom AWS & Cross-Cloud Rules
let Start = {TimeRange:start};
let End = {TimeRange:end};
let Catalog = datatable(PackCode:string, RuleId:string, RuleName:string, DefaultSeverity:string)["A01-risky-identity-log-to-secrets",
"54f1f278-4d53-4f20-a2a1-0e357f02da01",
"AWS cross-cloud - Risky Entra identity pivots from log searches to secrets",
"High",
"A02-screenconnect-to-aws-secrets",
"54f1f278-4d53-4f20-a2a1-0e357f02da02",
"AWS cross-cloud - ScreenConnect-launched AWS secret retrieval",
"High",
"A03-python-startup-to-aws-secrets",
"54f1f278-4d53-4f20-a2a1-0e357f02da03",
"AWS cross-cloud - Python startup artifacts and metadata access precede secrets use",
"High",
"A04-webworker-metadata-to-aws-secrets",
"54f1f278-4d53-4f20-a2a1-0e357f02da04",
"AWS cross-cloud - PHP descendant contacts metadata before EC2 role secrets use",
"High",
"A05-workload-new-source-aws-secrets",
"54f1f278-4d53-4f20-a2a1-0e357f02da05",
"AWS cross-cloud - New Entra workload source also retrieves AWS secrets",
"Medium",
"A06-aws-secrets-to-entra-app-credentials",
"54f1f278-4d53-4f20-a2a1-0e357f02da06",
"AWS cross-cloud - AWS secrets use precedes Entra application credential change",
"High",
"P0-01-root-breakglass-activity",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P0-01 - Root or Break-Glass Runtime Activity and Escalation",
"High",
"P0-02-iam-credential-persistence",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P0-02 - Coordinated IAM Credential Persistence and Cross-Principal Backdooring",
"High",
"P0-03-iam-privesc-trust-passrole-inline",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P0-03 - Trust Policy Backdoor, Inline Escalation and Sensitive PassRole Abuse",
"High",
"P0-04-sts-assumerole-chain",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P0-04 - Autonomous Cross-Account or Sensitive STS AssumeRole Chain",
"High",
"P0-05-cloudtrail-selector-delivery-evasion",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P0-05 - CloudTrail Selector Downgrade and Logging Delivery Tampering",
"High",
"P0-06a-guardduty-high-dedup-baseline",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P0-06a - GuardDuty High Severity Prioritized Baseline (Single-Source)",
"High",
"P0-06b-guardduty-multitable-correlated",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P0-06b - GuardDuty Correlated with CloudTrail Mutations, VPC Egress and Entra Bridge",
"High",
"P0-07a-s3-publicblock-and-anomalous-read-baseline",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P0-07a - S3 PublicAccessBlock Weakening and Sensitive Bucket Burst Read (Single-Source)",
"High",
"P0-07b-s3-exfil-guardduty-vpc-correlated",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P0-07b - S3 Exfiltration GuardDuty Finding Correlated with Permission Change or VPC Egress",
"High",
"P0-08-aws-telemetry-blindspot-and-health",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P0-08 - AWS Connector Failure, Ingestion Lag and Per-Source Blind Spot",
"High",
"P1-01a-route53-dns-tunneling-dga-baseline",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P1-01a - Route 53 DNS Tunneling, Subdomain Fan-Out and High NXDOMAIN Ratio (Single-Source)",
"Medium",
"P1-01b-route53-dns-ti-vpc-guardduty-correlated",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P1-01b - Route 53 Queries Matching Threat Intel and Correlated VPC Egress",
"High",
"P1-02-waf-campaign-and-block-to-allow-bypass",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P1-02 - AWS WAF Attack Campaign and Block-to-Allow Bypass Candidate",
"High",
"P1-03a-vpcflow-scan-and-unusual-egress-baseline",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P1-03a - VPC Flow Port/Host Scan and High-Byte Rare-Port Egress (Single-Source)",
"Medium",
"P1-03b-vpcflow-ti-and-beacon-correlated",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P1-03b - VPC Flow Threat-Intel IP Egress and Low-Jitter Beaconing",
"High",
"P1-04a-eks-audit-privesc-baseline",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P1-04a - EKS Audit Pod Exec, Privileged Workload and Cluster-Admin Escalation (Single-Source)",
"High",
"P1-04b-eks-audit-guardduty-cloudtrail-correlated",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P1-04b - EKS Audit Risk Correlated with GuardDuty Container Findings or CloudTrail EKS Role Changes",
"High",
"P1-05-cloudfront-origin-and-credential-abuse",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P1-05 - CloudFront Signed-URL Abuse, Path Enumeration and Automation Anomaly",
"Medium",
"P2-01a-network-firewall-alert-baseline",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P2-01a - AWS Network Firewall High-Severity Alert and Allowed Threat Signature (Single-Source)",
"High",
"P2-01b-network-firewall-vpc-guardduty-iam-correlated",
"REPLACE_WITH_RULE_GUID",
"AWS SecOps P2-01b - AWS Network Firewall Correlated with VPC Flow, GuardDuty and IAM Changes",
"High"];
let Observed = union isfuzzy=true
(datatable(TimeGenerated:datetime, SystemAlertId:string, AlertName:string)[]),
(SecurityAlert | where TimeGenerated between (Start .. End) | project TimeGenerated, SystemAlertId, AlertName)
| summarize arg_max(TimeGenerated, *) by SystemAlertId
| summarize ObservedAlerts=count(), LastObserved=max(TimeGenerated) by RuleName=AlertName;
Catalog
| join kind=leftouter Observed on RuleName
| extend ObservedAlerts=coalesce(ObservedAlerts, long(0)),
StatusNote=iff(isnull(LastObserved), "0 alerts in window (check Panel 2.1 ARM table to confirm rule is installed & enabled)", "Alerts triggered in window — review Tab 3")
| project PackCode, RuleName, DefaultSeverity, ObservedAlerts, LastObserved, StatusNote, RuleId
| order by ObservedAlerts desc, PackCode asc
| take 50Explanation
This query is designed to analyze and summarize alert data for a set of custom AWS and cross-cloud security rules. Here's a simplified breakdown of what it does:
-
Define Time Range: It sets a start and end time for the analysis period using
StartandEndvariables. -
Catalog of Rules: It creates a table (
Catalog) containing information about specific security rules, including their IDs, names, and default severity levels. Some rules have placeholder IDs that need to be replaced. -
Observed Alerts: It gathers alert data from a security alert source within the specified time range. It combines this data with an empty table to ensure compatibility and then summarizes it to count the number of alerts observed for each rule and the last time an alert was observed.
-
Join and Analyze: The query performs a left outer join between the
CatalogandObserveddata to match rules with their observed alerts. It calculates the number of alerts observed and notes whether any alerts were triggered during the time window. -
Output: It extends the data with a status note indicating whether alerts were observed or not. It then projects relevant columns, such as the rule code, name, severity, number of alerts, last observed time, and status note.
-
Sort and Limit: Finally, it sorts the results by the number of observed alerts in descending order and by rule code in ascending order, and limits the output to the top 50 entries.
The purpose of this query is to provide a summary of alert activity for a set of security rules, helping to identify which rules have been triggered and require further review.