A security dashboard in Grafana earns its place when it answers the questions your security team asks every morning: who is attacking, what the WAF blocked that it shouldn’t have, and where abuse is growing. On Azion, those answers are already recorded in Real-Time Events, which keeps one record per request and makes it available to query within 30 seconds of the request. The Real-Time Events GraphQL API serves those same records to any tool that speaks GraphQL, and that’s how a security team turns the product into panels that show its own traffic.
This post walks through three security dashboard ideas, each with the GraphQL query from the documentation that feeds it, the panel it becomes in Grafana, and the action the result points to. Teams like FAM already monitor threats with Real-Time Events on the platform or through the API, and Todo Cartões explores security and application events to improve its defenses.
What the Real-Time Events GraphQL API gives a security dashboard
Every request that an Azion application or firewall receives produces a record in the workloadEvents dataset, and that record holds, in the same row, what happened in delivery and what happened in security. Host, path, status, client IP, country, ASN, and user agent sit next to the WAF fields, such as wafMatch (the infraction and the string that triggered it), wafScore, wafAttackFamily, wafBlock, and wafLearning, plus stacktrace, which lists the Rules Engine rules the request ran when the Debug Rules option is on. Because everything is in one record, a panel doesn’t need to join the WAF log with the CDN log to explain a block. The post WAF, Firewall, and WAAP: how Azion organizes protection explains why the WAF and the other protections write to the same event.
A query to the https://api.azion.com/v4/events/graphql endpoint names the dataset, sets the time window in tsRange, and can filter, aggregate, and sort. An events dataset accepts aggregate and groupBy, so you can count records by IP, path, or attack family without exporting anything first, and that’s what makes the API raw material for a top X panel.
Three limits shape a dashboard’s design, and they’re worth keeping in mind before the first query:
- records are kept for 7 days, so a dashboard looks back one week at most;
- each query returns up to 10,000 rows;
- the API accepts 120 requests per minute by default.
The Real-Time Events limits page lists the rest, such as the cap on rows read per query, which an unfiltered search across the full 7 days can hit.
What you need before you build a security dashboard in Grafana
The four queries in this post come from examples published in the Azion documentation, and each one links to the page it came from. The path is the same for all of them: open the query in the GraphiQL Playground, which opens at the endpoint itself when you’re signed in to Azion Console, replace the dates and example values with your account’s, and then take the query to a Grafana panel that uses the Azion plugin. You’ll need:
- a personal token for your account;
- an application or a firewall already serving traffic, so the dataset holds records;
- a firewall with WAF turned on, bound to the workload that receives the traffic, so the WAF fields are filled in;
- a local Grafana instance with the Azion plugin installed and authorized, since the plugin needs an instance that allows unsigned plugins.
If you prefer another tool, you can send the same queries with curl or from a script, with the Authorization: Token [TOKEN] header, as First steps with the GraphQL API shows.
1. Attack source dashboard, by IP and family
The first dashboard answers the most common question on a security shift: where the traffic the WAF flagged as an attack comes from, and which family it belongs to. The query below comes from the guide Find the IPs behind attack traffic, and it counts the records with a WAF infraction and groups them by IP and attack family, from the highest volume down. Replace begin and end with a window inside the last 7 days:
The wafMatchNe: "-" and wafAttackFamilyNe: "-" filters drop the requests in which the WAF found no infraction, and an IP that triggered more than one family shows up in one row per family, such as $SQL and $XSS. In Grafana, this query becomes a table of the addresses that concentrate the most attacks in the window set in tsRange.
What to do with the result. The IPs that keep showing up at the top of the table are candidates for a Network List used by a firewall block rule, and because rules reference the list, an update to it applies to every rule that uses it.
2. Unusual traffic dashboard, by country, host, and route
Credential stuffing, scraping, and API abuse rarely trigger an attack signature, because each request looks legitimate on its own, and what gives the abuse away is where the volume comes from and which route it hits. The second dashboard uses the first query in the guide Investigate a request with the GraphQL API, which counts records by host, country, URI, and status and leaves out the country most of your traffic comes from. Replace <expected-country> with that country, the hosts with your application’s, and the dates with your window:
As the documentation suggests, read the rows from the top and compare the first count with the second, because the gap between them says more than either number alone. A country that doesn’t usually reach your hosts, with a count far above the rest, is the pattern to follow, and that much volume arriving in a short period is a common sign that the application is under attack. Because each row carries the requestUri, you can also see whether that volume concentrates on a sensitive route, such as login or an API.
What to do with the result. To refuse a set of addresses or countries, use a Network List referenced by a firewall rule, and to contain the volume on a specific route, use a WAF and rate limiting rule applied to the path. If you use Bot Manager, you can also track the URLs bots reach most in a panel next to this one. After you act, running the same query with tsRange moved to a later window shows whether the pattern changed.
3. Refused requests dashboard, to find false positives
Investigating a wrongful block often takes hours when the evidence is spread across different consoles, and the third dashboard shortens that path by showing who is being refused and then why each refusal happened. The first query is the second stage of the same investigation guide, which filters refused requests by the status they received and groups them by country and user agent:
The example filters on 403, the response of the Deny behavior, and the documentation says to change the status in the filter to match the behavior you want to follow. A rate limiting rule responds 429, and the WAF in Blocking mode responds 400, so statusIn: [400] is the filter that shows the requests the WAF may have stopped. Refusals coming from user agents your own customers use, and from countries where they are, deserve attention, because they may be legitimate users stopped by a rule, and the guide points out that the user agent identifies a client better than the country, which is easy to change.
When a user complains about a block, the 400 response they received carries the x-azion-request-id header, and the query in the example Read the score of a blocked request opens the exact record of that request. Replace <start> and <end> with a window that contains the request and <request-id> with the header value:
A record the WAF blocked comes back with wafBlock set to 1, wafMatch carries one entry for each internal rule that matched, with the field it matched on, such as 1:1013:ARGS:q for rule 1013 on argument q, and wafScore carries one score per threat family. A 400 whose record shows - in those fields wasn’t a WAF block, and with the rule and the field in hand it becomes clear whether the block caught an attack or a legitimate request.
What to do with the result. If the pattern turns out to be a false positive, the next step is to tune the WAF with an allowed rule for that field and that path. After the change, running the same queries with tsRange moved to a later window confirms whether the refusals for that client profile stopped.
How to build the security dashboard in Grafana
With the Azion plugin installed, each query becomes a Grafana panel, and the documentation covers the steps in two guides: Customize a Grafana log table, which shows how to create the panel, select the Azion data source, and fill in the fields that map the query result onto the visualization, and Build a Grafana query against Azion data, which explains how to write the query the panel runs. For raw records and top X queries, like the four in this post, the documentation recommends the Table visualization.
All three dashboards look back one week, which is what Real-Time Events keeps. For longer trends, the workloadMetrics dataset, on the metrics endpoint, returns aggregated counts such as the top attack families per period, and Data Stream sends the same records to your team’s SIEM or storage, where your own retention applies.
Why a security dashboard on Azion starts from a single record
In a stack built from a CDN, a standalone WAF, bot management, and a DDoS service from different vendors, building any of these three panels first means pulling logs together from separate sources and reconciling their fields.
On Azion, the firewall that decides the block and the application that delivers the response write to the same record, so a single query answers where the attack came from, which rule acted, and what the user received.
For whoever answers for risk, the gain is evidence, because every firewall decision stays in the request’s own record for the 7-day retention period and can be shown on a panel, exported, or sent to the SIEM through Data Stream with no manual reconstruction.
The other gain is time, since the everyday question becomes a ready query that you only need to run again with another time window. The post How a unified WAAP platform reduces SOC risk goes into that effect on operations.
Frequently asked questions
Start with the panel that answers today’s question
Each security dashboard in Grafana in this post starts from the same record and the same Real-Time Events GraphQL API, and the fastest way to begin is to pick the question your team asks most often, run the matching query in the GraphiQL Playground against your own traffic, and only then take it to Grafana. From there, every WAF adjustment, every Network List, and every rate limiting rule can be checked by running the same query over a later window.
Get to know Azion. Start for free or talk to an expert to build security visibility for your applications.
