Queries the detailed logs of attack traffic. Each log contains the details of a matched request.
Operation description
Attack traffic refers to requests that hit a rule and are identified as threats. The following three types of requests are not included:
Requests that hit a whitelist rule.
Requests that hit a bot rule whose action is set to Mark for Origin Fetch.
Requests that hit a rule whose action is set to Dynamic Token, Slider, Strict Slider, or JS Challenge, but are allowed because the user passed the verification.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-waf:DescribeSecurityEventLogs |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the WAF instance. Note
Call DescribeInstance to query the ID of your WAF instance. |
waf_cdnsdf3**** |
| Filter |
object |
Yes |
The filter conditions. A logical AND relationship exists between multiple filter conditions. |
|
| DateRange |
object |
Yes |
The time range to query. |
|
| StartDate |
integer |
Yes |
The start of the time range to query. The range cannot exceed the last 30 days. Specify the time as a UNIX timestamp. Unit: seconds. Note
The start time must be later than 30 days before the current time. |
1713888000 |
| EndDate |
integer |
Yes |
The end of the time range to query. Specify the time as a UNIX timestamp. Unit: seconds. |
1713888600 |
| Conditions |
array |
No |
A list of filter conditions. Each node describes a filter condition. |
|
|
object |
No |
The configuration of a single query condition. A query condition consists of a field name, an operator, and a filter value. For more information about the supported field names and operators, see the Additional information about request parameters section. |
||
| Key |
string |
No |
The name of the field to filter. This operation supports all fields. |
matched_host |
| OpValue |
string |
No |
The operator. |
eq |
| Values |
any |
No |
The filter value. |
test.waf-top |
| PageSize |
integer |
Yes |
The number of entries to return on each page for a paged query. The maximum value is 100. |
10 |
| PageNumber |
integer |
Yes |
The page number to return for a paged query. The default value is 1, which indicates the first page. |
1 |
| RegionId |
string |
No |
The region where the WAF instance resides. Valid values:
|
cn-hangzhou |
| ResourceManagerResourceGroupId |
string |
No |
The ID of the Alibaba Cloud resource group. |
rg-acfm***q |
Operator descriptions
| Operator | Meaning | Description |
| all-not-match | Not equal to any value | The field value is not equal to any value in the dataset. Example: Filter data where `real_client_ip` is not equal to any value in the collection:{"Key":"real_client_ip","OpValue":"all-not-match","Values":["1.1.1.1","2.2.2.2","3.3.3.3"]} |
| contain | Contains | The field value contains a specific string. Example: Filter data where the URL contains "test":{"Key":"request_path","OpValue":"contain","Values":"test"} |
| eq | Equals | The field value equals a specific string. Example: Filter data where the URL is "/testcase":{"Key":"request_path","OpValue":"eq","Values":"/testcase"} |
| match-one | Equals one of multiple values | The field value is equal to any value in the dataset. Example: Filter data where `real_client_ip` is equal to any value in the collection:{"Key":"real_client_ip","OpValue":"match-one","Values":["1.1.1.1","2.2.2.2","3.3.3.3"]} |
| ne | Not equal to | The field value does not equal a specific string. Example: Filter data where the URL is not "/testcase":{"Key":"request_path","OpValue":"ne","Values":"/testcase"} |
| not-contain | Does not contain | The field value does not contain a specific string. Example: Filter data where the URL does not contain "test":{"Key":"request_path","OpValue":"not-contain","Values":"test"} |
| prefix-match | Prefix match | The field value starts with a specific string. Example: Filter data where the URL prefix is "/testcase":{"Key":"request_path","OpValue":"prefix-match","Values":"/testcase"} |
| suffix-match | Suffix match | The field value ends with a specific string. Example: Filter data where the URL suffix is "/testcase":{"Key":"request_path","OpValue":"suffix-match","Values":"/testcase"} |
Supported keys for filter conditions
| Field name | Description | Supported operators |
| action | The protection action. This is the final action taken on the request. | ne, eq |
| cluster | The protection cluster. | ne, eq, match-one, all-not-match |
| defense_scene | The protection module. A request may hit multiple protection modules. Requests filtered by this field may also hit other modules. | ne, eq |
| host | The `host` field in the HTTP header. | contain, not-contain, ne, eq, match-one, all-not-match, prefix-match, suffix-match |
| http_cookie | The `cookie` field in the HTTP header. | contain, not-contain, ne, eq, match-one, all-not-match, prefix-match, suffix-match |
| http_user_agent | The `User-Agent` field in the HTTP header. | contain, not-contain, ne, eq, match-one, all-not-match, prefix-match, suffix-match |
| matched_host | The protected object. | ne, eq, match-one, all-not-match |
| real_client_ip | The source IP address of the request. The parameter that follows the operator can only be an IP address string or a list of IP address strings. CIDR block queries are not supported. | ne, eq, match-one, all-not-match |
| remote_country_id | The country to which the source IP address of the HTTP request belongs. | ne, eq, match-one, all-not-match |
| remote_region_id | The province or city to which the source IP address of the HTTP request belongs. | ne, eq, match-one, all-not-match |
| request_method | The HTTP request method. | ne, eq, match-one, all-not-match |
| request_path | The HTTP request URL, excluding the query string. | contain, not-contain, ne, eq, match-one, all-not-match, prefix-match, suffix-match |
| request_traceid | The unique ID that identifies the request. | ne, eq, match-one, all-not-match |
| rule_id | The rule ID. A request may hit multiple rules. Requests filtered by this field may also hit other rules. | ne, eq |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned data. For an example of the format, see Examples. |
||
| RequestId |
string |
The request ID. |
D827FCFE-90A7-4330-9326-******4C7726 |
| SecurityEventLogs |
array |
A list of detailed attack logs. |
|
|
any |
Each node is an attack log that corresponds to a request. For more information, see the Log field descriptions and Response example sections. |
参见返回数据示例 |
|
| SecurityEventMetaData |
object |
The metadata of the returned data. |
|
| DateRange |
object |
The time range used for the query. |
|
| StartDate |
integer |
The start of the time range to query. This is a UNIX timestamp. Unit: seconds. This value is the same as the `StartDate` request parameter. |
1713888000 |
| EndDate |
integer |
The end of the time range to query. This is a UNIX timestamp. Unit: seconds. This value is the same as the `EndDate` request parameter. |
1713888600 |
| Units |
string |
The unit of the returned statistical data. |
requests |
| SecurityEventLogsTotalCount |
integer |
The total number of attack logs found. |
1000 |
Log field descriptions
| Field name | Description | Example value |
| dst_port | The requested destination port. | 443 |
| host | The `Host` field in the client request header. It indicates the accessed domain name. Based on your business settings, this can also be an IP address. | api.example.com |
| matched_host | The WAF protected object (cloud product instance or domain name) that the client request matched. | .aliyun**.com |
| plugin_matched_detail_waf_group | The details about the web core protection rule that the current request hit. This records the reason why the data hit the rule. | |
| plugin_matched_block_rule_detail | The details about the rule in non-monitor mode that the request hit. This includes the rule ID, action, and protection module. | |
| plugin_matched_test_rule_detail | The details about the rule in monitor mode that the request hit. This includes the rule ID, action, and protection module. | |
| querystring | The query string in the client request. This is the part of the requested URL that follows the question mark (?). | title=tm_content%3Darticle&pid=123 |
| remote_region_id | The ID of the province to which the IP address belongs. | 410000 |
| remote_country_id | The ID of the country to which the source IP address belongs. | CN |
| remote_isp_id | The data center to which the source IP address belongs. | 100098 |
| request_method | The client request method. | GET |
| request_traceid | The unique ID that WAF generates for the client request. | 7837b11715410386943437009***** |
| real_client_ip | The real client IP address that WAF determines after analyzing the client request. You can use this IP address directly in your services. | 192.0.XX.XX |
| request_path | The requested relative path. This is the part of the requested URL that follows the domain name and precedes the question mark (?). It does not include the query string. | /news/search.php |
| server_protocol | The protocol between the client and WAF. | HTTP/1.1 |
| timestamp | The time when the request was processed by the DPI engine. This is a UNIX timestamp. | 1742197109 |
Response example
{
"SecurityEventLogsTotalCount": 1,
"SecurityEventLogs": [
{
"remote_region_id": "110000",
"plugin_matched_detail_waf_group": "{\"uri\":{\"hit\":[\"/.git/\"],\"raw\":\"/.git/\"}}",
"plugin_matched_block_rule_detail": "[{\"RuleId\":\"12***5\",\"Action\":\"block\",\"DefenseScene\":\"waf_base\",\"RuleType\":\"other\"}]",
"querystring": "-",
"matched_host": "i-8vbaazr2tboqsq******-443-ecs",
"remote_country_id": "CN",
"remote_isp_id": "100098",
"request_method": "GET",
"plugin_matched_test_rule_detail": "[]",
"request_traceid": "0b6261221742197109309484******",
"dst_port": "0",
"host": "39.99.***.109",
"real_client_ip": "47.92.***.14",
"request_path": "/.git/HEAD",
"server_protocol": "HTTP/1.1",
"timestamp": "1742197109"
}
],
"SecurityEventMetaData": {
"DateRange": {
"StartDate": 1742196600,
"EndDate": 1742197500
}
}
}
Examples
Success response
JSON format
{
"RequestId": "D827FCFE-90A7-4330-9326-******4C7726\n",
"SecurityEventLogs": [
"参见返回数据示例"
],
"SecurityEventMetaData": {
"DateRange": {
"StartDate": 1713888000,
"EndDate": 1713888600
},
"Units": "requests"
},
"SecurityEventLogsTotalCount": 1000
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Waf.Report.%s | Invalid parameter:%s. | Invalid parameter:%s |
| 400 | Waf.Report.InternalError | Server error occurred in report service. | Report Service Internal Error |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.