How to identify the Top IPs generating attack traffic using GraphQL API
You can use information from the httpEvents
dataset to monitor traffic patterns, detect anomalies, and analyze potential threats. This guide explains how to filter the 5 IPs that generated the most requests identified by the WAF as attacks.
Querying data
To query the Top 5 IPs generating attack traffic, according to the WAF, proceed as follows:
- Access the GraphiQL Playground at this link:
https://manager.azion.com/metrics/graphql
.- You must be logged in to your Azion account. Otherwise, you’ll receive an error message.
- Send a query following this format:
Where:
Field | Description |
---|---|
limit | Specifies the maximum number of results to return. In this case, 5 |
filter | Defines the criteria used to filter the data returned by the query |
tsRange | A subfield of filter . Specifies a time range for filtering data. It includes begin and end fields to define the start and end date and times. Format: "YYYY-MM-DDTHH:mm:ss" ; example: "2024-04-11T00:00:00" |
wafMatchNe | Filters out entries where the wafMatch field is equal to ”-”, meaning it only includes events with valid WAF matches |
wafAttackFamilyNe | Filters out entries where the wafAttackFamily field is equal to ”-”, ensuring only events with identified WAF attack families are included |
count: rows | As a subfield of aggregate , counts the number of events matching the query’s filters and groups |
orderBy | Specifies the order in which the results should be returned. Examples: [count_DESC] , for descending order, and [count_ASC] , for ascending order |
groupBy | Specifies the fields by which the query results should be grouped. In the example: [remoteAddress, wafAttackFamily] to group by IP and the family of attacks detected by the WAF |
- You’ll receive a response similar to this:
Where:
Field | Description |
---|---|
remoteAddress | IP address of the origin that generated the requests. Example: 127.0.0.1 |
wafAttackFamily | Category or type of attack detected by the Web Application Firewall (WAF), based on their characteristics. Example: $SQL , $RFI , $SQL , $XSS , $OTHERS |
count | Requests identified by the WAF as attacks. Example: 1194 |