AWS Builder Center
[Analytics Optimization] Under Attack? Switch to QuickSight: AI-Powered Threat Visibility ๐Ÿš€๐Ÿ”

[Analytics Optimization] Under Attack? Switch to QuickSight: AI-Powered Threat Visibility ๐Ÿš€๐Ÿ”

See Threats, Not Logs โ€” AI Dashboards in QuickSight. Amazon QuickSight build visuals with NLPs, auto-refresh with SPICE, and go from nested JSON chaos to attack insights in minutes.

๐Ÿ“Œ Empowering Business: Cloud Network & Edge Services๐Ÿ“Œ ๐ŸŽฏ Subject Matter Expert: WAF & Route 53 ๐ŸŽฏ

Introduction

AWS WAF logs every request evaluated, every action taken, every rule triggered, client fingerprints. geographic data and security labels. The problem? Most of the time, this goldmine sits in S3 as deeply nested JSON. Getting answers means either writing Athena queries from scratch every single time โ€” or bleeding thousands per month piping it into a SIEM.

๐Ÿ”ฅ Sound Familiar?

It's 2 AM. An alert fires โ€” latency spiking, request rate climbing. โš ๏ธ
You scramble to Athena and start writing queries against your WAF logs. Or worse โ€” you're downloading .gz files from S3 and running gunzip | jq chains on your laptop like it's 2024. ๐Ÿ’ป
Twenty minutes in, you're neck-deep in CROSS JOIN UNNEST(httprequest.headers) syntax errors. ๐Ÿ˜ค You know requests are being blocked. But by who? What fingerprint? What endpoint are they targeting? Are they all using the same tool?

โœจ Now Imagine This Instead

You open a URL. One click and the dashboard shows in one view WAF traffic โ€” pre-correlated, pre-filtered, ready to act on: No Athena. No syntax errors. No guessing. You write your mitigation rule in minutes, not an hour.
A QuickSight analysis connected to your WAF logs via Athena โ€” set up once, then it just works.
Here's what you'll have when you're done:

๐ŸŽฏ Why This Works

๐Ÿง  AI-powered โ€” Build visuals with NLP, Ask questions, get charts. No SQL needed in QuickSight.
๐Ÿ“Š Easy-built visuals โ€” IP, fingerprint correlation, label and geo breakdown โ€” all in one place
๐Ÿ”„ Auto-refreshing โ€” SPICE incremental refresh every 15 minutes
๐Ÿ’ฐ Cost effective โ€” SPICE stores data in-memory. Dashboard users query SPICE directly
๐Ÿšซ No extra infrastructure โ€” No Lambda, no Glue Crawler, no EventBridge
๐Ÿ” Interact with your data โ€” Filter, drill down, explore patterns โ€” everything in one dashboard

โœ… What You Need First

  1. WAF logging enabled โ€” Logs delivered to S3 via Kinesis Data Firehose
  2. Athena table โ€” With partition projection. See AWS docs: Create WAF log table in Athenaย 
  3. QuickSight Enterprise โ€” With SPICE capacity available

๐Ÿงน Tame the Nested Beast

WAF logs are nested structs and arrays. QuickSight needs flat columns. Let's fix that. ๐Ÿ”ง

Option A: Full history

1
2
3
4
5
6
7
8
9
10
11
12
13
14
CREATE OR REPLACE VIEW waf_logs_flat AS
SELECT
from_unixtime(timestamp / 1000) AS request_time,
action,
httprequest.clientip AS client_ip,
httprequest.country AS country,
httprequest.uri AS uri,
httprequest.httpmethod AS http_method,
element_at(filter(httprequest.headers, x -\> lower(x.name) = 'host'), 1).value AS request_host,
ja3fingerprint,
ja4fingerprint,
array_join(transform(labels, x -\> x.name), ' | ') AS all_labels,
requestid AS request_id
FROM waf_logs;

Option B: Last 7 days (recommended โ€” bounds SPICE size)

1
2
3
CREATE OR REPLACE VIEW waf_logs_flat_7d AS
SELECT * FROM waf_logs_flat
WHERE request_time \>= current_timestamp - interval '7' day;

๐Ÿš€ From Zero to Dashboard

Step 1: Create Your Dataset in QuickSight

  1. QuickSight Console โ†’ Datasets โ†’ New dataset โ†’ Athena
  2. Select your flat view (waf_logs_flat or waf_logs_flat_7d)
  3. Import to SPICE
  4. Note your Dataset ID:
1
2
3
4
aws quicksight list-data-sets \
--aws-account-id $(aws sts get-caller-identity --query Account --output text) \
--region us-east-1 \
--query 'DataSetSummaries[?contains(Name,`waf`)].{Name:Name,Id:DataSetId}'

Step 2: Build Your Visuals

Create visuals using a --definition JSON with the CLI. But honestly? Life's too short for JSON. ๐Ÿ˜… Use QuickSight's Build (Q) AI feature with natural language prompts instead see next section.ย 
Example 1: Top Client IPs Table
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
"TableVisual": {
"VisualId": "top-client-ips",
"Title": { "Visibility": "VISIBLE" },
"ChartConfiguration": {
"FieldWells": {
"TableAggregatedFieldWells": {
"GroupBy": [
{ "CategoricalDimensionField": {
"FieldId": "client-ip-field",
"Column": { "DataSetIdentifier": "waf_logs_flat", "ColumnName": "client_ip" }
}},
{ "CategoricalDimensionField": {
"FieldId": "country-field",
"Column": { "DataSetIdentifier": "waf_logs_flat", "ColumnName": "country" }
}}
],
"Values": [
{ "CategoricalMeasureField": {
"FieldId": "request-count",
"Column": { "DataSetIdentifier": "waf_logs_flat", "ColumnName": "request_id" },
"AggregationFunction": "DISTINCT_COUNT"
}}
]
}
},
"SortConfiguration": {
"RowSort": [{ "FieldSort": { "FieldId": "request-count", "Direction": "DESC" }}]
}
}
}
}
Example 2: Anti-DDoS Severity Donut Chart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"PieChartVisual": {
"VisualId": "anti-ddos-donut",
"Title": { "Visibility": "VISIBLE" },
"ChartConfiguration": {
"FieldWells": {
"PieChartAggregatedFieldWells": {
"Category": [{ "CategoricalDimensionField": {
"FieldId": "ddos-label-field",
"Column": { "DataSetIdentifier": "waf_logs_flat", "ColumnName": "anti_ddos_label 1" }
}}],
"Values": [{ "CategoricalMeasureField": {
"FieldId": "ddos-count",
"Column": { "DataSetIdentifier": "waf_logs_flat", "ColumnName": "request_id" },
"AggregationFunction": "DISTINCT_COUNT"
}}]
}
},
"DonutOptions": { "ArcOptions": { "ArcThickness": "MEDIUM" } }
}
}
}

Step 3: Import the Analysis

1
2
3
4
5
6
aws quicksight create-analysis \
--aws-account-id "$ACCOUNT_ID" \
--analysis-id "$(uuidgen | tr '[:upper:]' '[:lower:]')" \
--name "WAF Security Dashboard" \
--definition file://waf-dashboard-definition.json \
--region us-east-1
Go grab a โ˜•. By the time you're back, open QuickSight โ†’ Analyses โ†’ "WAF Security Dashboard" โ€” it's already there waiting for you.

๐Ÿ”ฎ Type What You Want. AI Builds It. That's It.

โœจ QuickSight has a built-in AI assistant โ€” Build (Q). Instead of writing JSON definitions, you describe what you want in plain English and it builds the visual for you.
Prompts in, charts out. Here are examples that generate the same visuals:

Top JA3 Fingerprints:

1
Top 50 ja3fingerprint by unique number of request_id sorted descending

Requests by Country:

1
Unique number of request_id by country
๐Ÿ’ฌ That's it. No JSON. No field IDs. No syntax docs. Just tell it what you want to see โ€” and it appears. Your security team just went from "let me write a query" to "let me ask a question." That's the shift. ๐ŸŽค โฌ‡๏ธ

๐Ÿš€ Fuel Up: Docs That Actually Help

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article