20 Network Network Firewall Alerts
Query
// REVIEW ONLY - AWS Security Operations Workbook Visual Query
// Tab: Network | Panel: network-firewall-alerts | Visualization: table | Mode: All
// Security Question: Which Network Firewall threat signatures fired, and were any high-risk connections passed instead of dropped?
// Drill-Through: Click SrcIp to inspect Panel 5.4 raw flows or Tab 10 Cross-Cloud Pivot.
// Empty/No-Data Contract: No AWSNetworkFirewallAlert records in window (table is NOT_CONNECTED or zero alerts fired; verify Tab 2).
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, FirewallName:string, AvailabilityZone:string, VerdictAction:string, AlertAction:string, Severity:string, Category:string, SignatureId:string, Signature:string, SrcIp:string, DestIp:string, Sni:string)[]),
(AWSNetworkFirewallAlert | where TimeGenerated between (Start .. End)
| project TimeGenerated, FirewallName, AvailabilityZone, VerdictAction, AlertAction, Severity=tostring(Severity), Category, SignatureId=tostring(SignatureId), Signature, SrcIp, DestIp, Sni)
| summarize Hits=count(), FirstSeen=min(TimeGenerated), LastSeen=max(TimeGenerated),
SampleSnis=make_set(Sni, 10), DestIps=make_set(DestIp, 10)
by FirewallName, AvailabilityZone, VerdictAction, AlertAction, Severity, Category, SignatureId, Signature, SrcIp
| order by VerdictAction asc, Hits desc
| take 5000Explanation
This query is designed to analyze network firewall alerts within a specified time range and provide a summary of threat signatures that were triggered. Here's a simplified breakdown of what the query does:
-
Time Range and Filters: It sets a time range (
StartandEnd) and applies various filters based on organization, account, region, environment, workload, severity, source table, summary mode, selected principal, and selected IP. These filters are decoded from base64 format. -
Data Source: It pulls data from a table named
AWSNetworkFirewallAlertwithin the specified time range. The query extracts specific fields such as the time the alert was generated, firewall name, availability zone, verdict action, alert action, severity, category, signature ID, signature, source IP, destination IP, and server name indication (SNI). -
Data Aggregation: The query summarizes the data by counting the number of hits (alerts) and noting the first and last time each alert was seen. It also collects a sample of up to 10 SNIs and destination IPs for each alert.
-
Sorting and Limiting Results: The results are sorted by the verdict action (e.g., allowed or blocked) in ascending order and by the number of hits in descending order. The query limits the output to the top 5000 results.
-
Purpose: The main goal is to identify which network firewall threat signatures were triggered and to check if any high-risk connections were allowed instead of being blocked.
-
Drill-Through Capability: Users can click on the source IP to inspect more detailed raw flow data or pivot to a cross-cloud analysis.
-
Empty Data Handling: If no alerts are found within the specified window, it indicates that either the table is not connected or no alerts were fired, and suggests verifying another tab for more information.
Overall, this query helps security analysts quickly assess network firewall activity and identify potential security threats based on predefined criteria.