doc-exports/docs/waf/api-ref/waf_02_0075.html
Li, Qiao 914011d51b waf_api_1109
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Li, Qiao <qiaoli@huawei.com>
Co-committed-by: Li, Qiao <qiaoli@huawei.com>
2022-11-16 15:31:27 +00:00

169 lines
13 KiB
HTML

<a name="waf_02_0075"></a><a name="waf_02_0075"></a>
<h1 class="topictitle1">Querying Top N Attack Source IP Addresses</h1>
<div id="body3609106"><div class="section" id="waf_02_0075__section56466498"><h4 class="sectiontitle">Function Description</h4><p class="msonormal" id="waf_02_0075__p23902165">This API is used to query the top N attack source IP addresses.</p>
</div>
<div class="section" id="waf_02_0075__section10383651"><h4 class="sectiontitle">URI</h4><ul id="waf_02_0075__ul55802169"><li id="waf_02_0075__li32457476">URI format<p id="waf_02_0075__p23681834"><a name="waf_02_0075__li32457476"></a><a name="li32457476"></a>GET /v1/{project_id}/waf/event/attack/source?top={top}&amp;from={from}&amp;to={to}&amp;hosts={hostids}</p>
<div class="note" id="waf_02_0075__note63241148751"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="waf_02_0075__p23244481054">An example of a URI is as follows:</p>
<p id="waf_02_0075__p774833712618">GET /v1/3ac26c59e15a4a11bb680a103a29ddb6/waf/event/attack/type?from=1543976973635&amp;to=1563976973635&amp;hosts=3211757cafa3437aae24d760022e79ba&amp;hosts=93029844064b43739b51ca63036fbc4b&amp;hosts=34fe5f5c60ef4e43a9975296765d1217</p>
</div></div>
</li><li id="waf_02_0075__li11809914">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0075__table39180367" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path parameters</caption><thead align="left"><tr id="waf_02_0075__row66112983"><th align="left" class="cellrowborder" valign="top" width="25.507449255074494%" id="mcps1.3.2.2.2.1.2.5.1.1"><p id="waf_02_0075__p53551383"><strong id="waf_02_0075__b14104181815194">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.348265173482652%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="waf_02_0075__p42694776"><strong id="waf_02_0075__b7514161951920">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.348265173482652%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="waf_02_0075__p35724833"><strong id="waf_02_0075__b3967152016195">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.796020397960206%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="waf_02_0075__p8030395"><strong id="waf_02_0075__b159011022111919">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0075__row46482286"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0075__p6968801">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="waf_02_0075__p27601980">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="waf_02_0075__p21167912">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="waf_02_0075__p36879308">Specifies the project ID.</p>
</td>
</tr>
<tr id="waf_02_0075__row63478323"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0075__p41470559">top</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="waf_02_0075__p3672152">No</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="waf_02_0075__p29008901">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="waf_02_0075__p910799">Specifies the top <em id="waf_02_0075__i351184685015">n</em> attack source IP addresses to be queried. The default value is <strong id="waf_02_0075__b17640195710122">5</strong>.</p>
</td>
</tr>
<tr id="waf_02_0075__row8197194"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0075__p59992969">from</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="waf_02_0075__p27592345">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="waf_02_0075__p20387490">Long</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="waf_02_0075__p18857034">Specifies the start time (UTC) in milliseconds. For example, <strong id="waf_02_0075__b181534323509">1548172800000</strong>.</p>
</td>
</tr>
<tr id="waf_02_0075__row12564727728"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0075__p1556417274219">to</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="waf_02_0075__p1256410276220">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="waf_02_0075__p145642274213">Long</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="waf_02_0075__p676211156578">Specifies the end time (UTC) in milliseconds. For example, <strong id="waf_02_0075__b29251034135013">1548431999000</strong>.</p>
</td>
</tr>
<tr id="waf_02_0075__row31421347"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0075__p62101151">hosts</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="waf_02_0075__p64137360">No</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="waf_02_0075__p27743710">Array</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="waf_02_0075__p32648048">Specifies the domain IDs.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="waf_02_0075__section26344003"><h4 class="sectiontitle">Request</h4><p id="waf_02_0075__p17936681312">Request parameters</p>
<p class="msonormal" id="waf_02_0075__p27246255">None</p>
</div>
<div class="section" id="waf_02_0075__section35769441"><h4 class="sectiontitle">Response</h4><p id="waf_02_0075__p2077824181314">Response parameters</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0075__table29324718" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="waf_02_0075__row1824515"><th align="left" class="cellrowborder" valign="top" width="24.490000000000002%" id="mcps1.3.4.3.2.4.1.1"><p id="waf_02_0075__p13568011"><strong id="waf_02_0075__b895919219282">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.23%" id="mcps1.3.4.3.2.4.1.2"><p id="waf_02_0075__p25267083"><strong id="waf_02_0075__b124461023172819">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="58.28%" id="mcps1.3.4.3.2.4.1.3"><p id="waf_02_0075__p33367852"><strong id="waf_02_0075__b466122410285">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0075__row31875216"><td class="cellrowborder" valign="top" width="24.490000000000002%" headers="mcps1.3.4.3.2.4.1.1 "><p id="waf_02_0075__p31755717">total</p>
</td>
<td class="cellrowborder" valign="top" width="17.23%" headers="mcps1.3.4.3.2.4.1.2 "><p id="waf_02_0075__p22076270">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="58.28%" headers="mcps1.3.4.3.2.4.1.3 "><p id="waf_02_0075__p43347444">Specifies the total number of attack source IP addresses.</p>
</td>
</tr>
<tr id="waf_02_0075__row54582677"><td class="cellrowborder" valign="top" width="24.490000000000002%" headers="mcps1.3.4.3.2.4.1.1 "><p id="waf_02_0075__p59120688">items</p>
</td>
<td class="cellrowborder" valign="top" width="17.23%" headers="mcps1.3.4.3.2.4.1.2 "><p id="waf_02_0075__p24046428"><a href="#waf_02_0075__table1441245463618">Table 3</a></p>
</td>
<td class="cellrowborder" valign="top" width="58.28%" headers="mcps1.3.4.3.2.4.1.3 "><p id="waf_02_0075__p1603648">Specifies the array of items.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="waf_02_0075__table1441245463618"></a><a name="table1441245463618"></a><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0075__table1441245463618" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="waf_02_0075__b5769627123513">items</strong></caption><thead align="left"><tr id="waf_02_0075__row1241695410366"><th align="left" class="cellrowborder" valign="top" width="32.46675332466753%" id="mcps1.3.4.4.2.4.1.1"><p id="waf_02_0075__p641715493612"><strong id="waf_02_0075__b960546539">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="27.73722627737226%" id="mcps1.3.4.4.2.4.1.2"><p id="waf_02_0075__p14419115433618"><strong id="waf_02_0075__b1784478650">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.796020397960206%" id="mcps1.3.4.4.2.4.1.3"><p id="waf_02_0075__p942015493613"><strong id="waf_02_0075__b509122604">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0075__row7105349114410"><td class="cellrowborder" valign="top" width="32.46675332466753%" headers="mcps1.3.4.4.2.4.1.1 "><p id="waf_02_0075__p1860154844412">ip</p>
</td>
<td class="cellrowborder" valign="top" width="27.73722627737226%" headers="mcps1.3.4.4.2.4.1.2 "><p id="waf_02_0075__p96216488441">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.4.2.4.1.3 "><p id="waf_02_0075__p26464817444">Specifies the attack source IP addresses.</p>
</td>
</tr>
<tr id="waf_02_0075__row18105114920444"><td class="cellrowborder" valign="top" width="32.46675332466753%" headers="mcps1.3.4.4.2.4.1.1 "><p id="waf_02_0075__p1267134834416">num</p>
</td>
<td class="cellrowborder" valign="top" width="27.73722627737226%" headers="mcps1.3.4.4.2.4.1.2 "><p id="waf_02_0075__p168184818440">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.4.2.4.1.3 "><p id="waf_02_0075__p37184894413">Specifies the number of attacks came from the attack source IP addresses.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="waf_02_0075__section973562631310"><h4 class="sectiontitle">Example</h4><p id="waf_02_0075__p16104173064414"></p>
<div class="p" id="waf_02_0075__p91871032141313">Response example<pre class="screen" id="waf_02_0075__screen1674542641313">{
"total": 4,
"items": [
{"ip": "X.X.1.1", "num": 1000},
{"ip": "X.X.1.2", "num": 1000},
{"ip": "X.X.1.3", "num": 1000},
{"ip": "X.X.1.4", "num": 1000}
]
}</pre>
</div>
</div>
<div class="section" id="waf_02_0075__section53489518"><h4 class="sectiontitle">Status Code</h4><div class="p" id="waf_02_0075__waf_02_0012_a652d4922b7df48fca0a65bc1a38ea5f2"><a href="#waf_02_0075__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0">Table 4</a> describes the normal status code returned by the API.
<div class="tablenoborder"><a name="waf_02_0075__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0"></a><a name="waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0"></a><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0075__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Status code</caption><thead align="left"><tr id="waf_02_0075__waf_02_0012_r3d6e2f205c444705bdbb9daaac74e575"><th align="left" class="cellrowborder" valign="top" width="22%" id="mcps1.3.6.2.2.2.4.1.1"><p id="waf_02_0075__waf_02_0012_af3c4073076f24eca88d94e3fa1effdc6">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.41%" id="mcps1.3.6.2.2.2.4.1.2"><p id="waf_02_0075__waf_02_0012_en-us_topic_0144911667_p4531342288">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="58.589999999999996%" id="mcps1.3.6.2.2.2.4.1.3"><p id="waf_02_0075__waf_02_0012_ada185614bba24140995b8123b3e9faa8">Meaning</p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0075__waf_02_0012_rc7b2adc390904a1ba79e303017797786"><td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.6.2.2.2.4.1.1 "><p id="waf_02_0075__waf_02_0012_a93f3895d44bb4226934cc626ac50e37b">200</p>
</td>
<td class="cellrowborder" valign="top" width="19.41%" headers="mcps1.3.6.2.2.2.4.1.2 "><p id="waf_02_0075__waf_02_0012_en-us_topic_0144911667_p7538425819">OK</p>
</td>
<td class="cellrowborder" valign="top" width="58.589999999999996%" headers="mcps1.3.6.2.2.2.4.1.3 "><p id="waf_02_0075__waf_02_0012_en-us_topic_0144911667_p369874114414">The request has succeeded.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="waf_02_0075__waf_02_0012_en-us_topic_0144911667_p482819399522">For details about error status codes, see <a href="waf_02_0085.html">Status Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="waf_02_0069.html">Event Logs</a></div>
</div>
</div>