Files
doc-exports/docs/wafd/api-ref/ListCustomRules.html
qinweiwei 14cbe51752 wafd API 20260210 version
Reviewed-by: Belejkanic, Lukas <lukas.belejkanic@t-systems.com>
Co-authored-by: qinweiwei <qinweiwei@huawei.com>
Co-committed-by: qinweiwei <qinweiwei@huawei.com>
2026-04-21 11:31:19 +00:00

467 lines
34 KiB
HTML

<a name="ListCustomRules"></a><a name="ListCustomRules"></a>
<h1 class="topictitle1">Querying Precise Protection Rules</h1>
<div id="body1708331107508"><div class="section" id="ListCustomRules__topic1281000000"><h4 class="sectiontitle">Function</h4><p id="ListCustomRules__topic1281000002">This API is used to query the list of precise protection rules.</p>
</div>
<div class="section" id="ListCustomRules__atuogenerate_1"><h4 class="sectiontitle">URI</h4><p id="ListCustomRules__topic1281000004">GET /v1/{project_id}/waf/policy/{policy_id}/custom</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListCustomRules__topic1281000005" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="ListCustomRules__topic1281000013"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="ListCustomRules__topic1281000015">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="ListCustomRules__topic1281000017">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="ListCustomRules__topic1281000019">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="ListCustomRules__topic1281000021">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListCustomRules__topic1281000023"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="ListCustomRules__topic1281000025">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="ListCustomRules__topic1281000027">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="ListCustomRules__topic1281000029">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="ListCustomRules__topic1281000031">Project ID</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000032"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="ListCustomRules__topic1281000034">policy_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="ListCustomRules__topic1281000036">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="ListCustomRules__topic1281000038">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="ListCustomRules__topic1281000040">Policy ID. It can be obtained by calling the <strong id="ListCustomRules__topic1281000041">ListPolicy</strong> API.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListCustomRules__topic1281000042" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Query Parameters</caption><thead align="left"><tr id="ListCustomRules__topic1281000050"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.1"><p id="ListCustomRules__topic1281000052">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.2"><p id="ListCustomRules__topic1281000054">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.3"><p id="ListCustomRules__topic1281000056">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.4.2.5.1.4"><p id="ListCustomRules__topic1281000058">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListCustomRules__topic1281000060"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="ListCustomRules__topic1281000062">page</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="ListCustomRules__topic1281000064">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="ListCustomRules__topic1281000066">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="ListCustomRules__topic1281000068">Page number.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000069"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="ListCustomRules__topic1281000071">pagesize</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="ListCustomRules__topic1281000073">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="ListCustomRules__topic1281000075">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="ListCustomRules__topic1281000077">Number of records on each page. The maximum value is 2147483647.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListCustomRules__topic1281000078"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListCustomRules__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request header parameters</caption><thead align="left"><tr id="ListCustomRules__topic1281000087"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="ListCustomRules__topic1281000089">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="ListCustomRules__topic1281000091">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="ListCustomRules__topic1281000093">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="ListCustomRules__topic1281000095">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListCustomRules__topic1281000097"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="ListCustomRules__topic1281000099">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="ListCustomRules__topic1281000101">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="ListCustomRules__topic1281000103">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="ListCustomRules__topic1281000105">auth token</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000106"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="ListCustomRules__topic1281000108">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="ListCustomRules__topic1281000110">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="ListCustomRules__topic1281000112">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="ListCustomRules__topic1281000114">Content type.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListCustomRules__topic1281000115"><h4 class="sectiontitle">Response Parameters</h4><p id="ListCustomRules__topic1281000117"><strong id="ListCustomRules__topic1281000118">Status code: 200</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListCustomRules__response_ListCustomRulesResponseBody" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Response body parameters</caption><thead align="left"><tr id="ListCustomRules__topic1281000125"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.1"><p id="ListCustomRules__topic1281000127">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.2"><p id="ListCustomRules__topic1281000129">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.3.2.4.1.3"><p id="ListCustomRules__topic1281000131">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListCustomRules__topic1281000133"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="ListCustomRules__topic1281000135">total</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="ListCustomRules__topic1281000137">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="ListCustomRules__topic1281000139">Number of rules in the policy</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000140"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="ListCustomRules__topic1281000142">items</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="ListCustomRules__topic1281000144">Array of <a href="#ListCustomRules__response_CustomRuleBody">CustomRuleBody</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="ListCustomRules__topic1281000147">Array of custom rules</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="ListCustomRules__response_CustomRuleBody"></a><a name="response_CustomRuleBody"></a><table cellpadding="4" cellspacing="0" summary="" id="ListCustomRules__response_CustomRuleBody" frame="border" border="1" rules="all"><caption><b>Table 5 </b>CustomRuleBody</caption><thead align="left"><tr id="ListCustomRules__topic1281000154"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.4.2.4.1.1"><p id="ListCustomRules__topic1281000156">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.4.2.4.1.2"><p id="ListCustomRules__topic1281000158">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.4.2.4.1.3"><p id="ListCustomRules__topic1281000160">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListCustomRules__topic1281000162"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListCustomRules__topic1281000164">id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListCustomRules__topic1281000166">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListCustomRules__topic1281000168">Rule ID.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000169"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListCustomRules__topic1281000171">policyid</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListCustomRules__topic1281000173">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListCustomRules__topic1281000175">Policy ID.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000176"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListCustomRules__topic1281000178">description</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListCustomRules__topic1281000180">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListCustomRules__topic1281000182">Rule description.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000183"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListCustomRules__topic1281000185">status</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListCustomRules__topic1281000187">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListCustomRules__topic1281000189">Rule status. The value can be <strong id="ListCustomRules__topic1281000190">0</strong> or <strong id="ListCustomRules__topic1281000191">1</strong>.</p>
<ul id="ListCustomRules__topic1281000192"><li id="ListCustomRules__topic1281000193"><p id="ListCustomRules__topic1281000194"><a name="ListCustomRules__topic1281000193"></a><a name="topic1281000193"></a><strong id="ListCustomRules__topic1281000195">0</strong>: The rule is disabled.</p>
</li><li id="ListCustomRules__topic1281000196"><p id="ListCustomRules__topic1281000197"><a name="ListCustomRules__topic1281000196"></a><a name="topic1281000196"></a><strong id="ListCustomRules__topic1281000198">1</strong>: The rule is enabled.</p>
</li></ul>
</td>
</tr>
<tr id="ListCustomRules__topic1281000199"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListCustomRules__topic1281000201">conditions</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListCustomRules__topic1281000203">Array of <a href="#ListCustomRules__response_conditions">conditions</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListCustomRules__topic1281000206">List of matching conditions. All conditions must be met.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000207"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListCustomRules__topic1281000209">action</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListCustomRules__topic1281000211"><a href="#ListCustomRules__response_CustomAction">CustomAction</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListCustomRules__topic1281000214">Protective action of the precise protection rule.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000215"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListCustomRules__topic1281000217">priority</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListCustomRules__topic1281000219">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListCustomRules__topic1281000221">Priority of a rule. A small value indicates a high priority. If two rules are assigned with the same priority, the rule added earlier has higher priority. Value range: 0 to 1000.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000222"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListCustomRules__topic1281000224">timestamp</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListCustomRules__topic1281000226">Long</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListCustomRules__topic1281000228">Timestamp when the precise protection rule is created.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000229"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListCustomRules__topic1281000231">start</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListCustomRules__topic1281000233">Long</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListCustomRules__topic1281000235">Timestamp (ms) when the precise protection rule takes effect. This parameter is returned only when time is true.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000236"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListCustomRules__topic1281000238">terminal</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListCustomRules__topic1281000240">Long</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListCustomRules__topic1281000242">Timestamp (ms) when the precise protection rule expires. This parameter is returned only when time is true.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000243"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListCustomRules__topic1281000245">action_mode</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListCustomRules__topic1281000247">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListCustomRules__topic1281000249">This parameter is reserved and can be ignored currently.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000250"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListCustomRules__topic1281000252">aging_time</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListCustomRules__topic1281000254">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListCustomRules__topic1281000256">Rule aging time. This parameter is reserved and can be ignored currently.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000257"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListCustomRules__topic1281000259">producer</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListCustomRules__topic1281000261">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListCustomRules__topic1281000263">Rule creation object. This parameter is reserved and can be ignored currently.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="ListCustomRules__response_conditions"></a><a name="response_conditions"></a><table cellpadding="4" cellspacing="0" summary="" id="ListCustomRules__response_conditions" frame="border" border="1" rules="all"><caption><b>Table 6 </b>conditions</caption><thead align="left"><tr id="ListCustomRules__topic1281000270"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.5.2.4.1.1"><p id="ListCustomRules__topic1281000272">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.5.2.4.1.2"><p id="ListCustomRules__topic1281000274">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.5.2.4.1.3"><p id="ListCustomRules__topic1281000276">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListCustomRules__topic1281000278"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="ListCustomRules__topic1281000280">category</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="ListCustomRules__topic1281000282">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="ListCustomRules__topic1281000284">Field type. The options are <strong id="ListCustomRules__topic1281000285">url</strong>, <strong id="ListCustomRules__topic1281000286">user-agent</strong>, <strong id="ListCustomRules__topic1281000287">ip</strong>, <strong id="ListCustomRules__topic1281000288">params</strong>, <strong id="ListCustomRules__topic1281000289">cookie</strong>, <strong id="ListCustomRules__topic1281000290">referer</strong>, <strong id="ListCustomRules__topic1281000291">header</strong>, <strong id="ListCustomRules__topic1281000292">request_line</strong>, <strong id="ListCustomRules__topic1281000293">method</strong>, and <strong id="ListCustomRules__topic1281000294">request</strong>.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000295"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="ListCustomRules__topic1281000297">index</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="ListCustomRules__topic1281000299">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="ListCustomRules__topic1281000301">Subfield</p>
<ul id="ListCustomRules__topic1281000302"><li id="ListCustomRules__topic1281000303"><p id="ListCustomRules__topic1281000304"><a name="ListCustomRules__topic1281000303"></a><a name="topic1281000303"></a>When the field type is <strong id="ListCustomRules__topic1281000305">url</strong>, <strong id="ListCustomRules__topic1281000306">user-agent</strong>, <strong id="ListCustomRules__topic1281000307">ip</strong>, <strong id="ListCustomRules__topic1281000308">refer</strong>, <strong id="ListCustomRules__topic1281000309">request_line</strong>, <strong id="ListCustomRules__topic1281000310">method</strong>, or <strong id="ListCustomRules__topic1281000311">request</strong>, <strong id="ListCustomRules__topic1281000312">index</strong> is not required.</p>
</li><li id="ListCustomRules__topic1281000313"><p id="ListCustomRules__topic1281000314"><a name="ListCustomRules__topic1281000313"></a><a name="topic1281000313"></a>When the field type is <strong id="ListCustomRules__topic1281000315">params</strong>, <strong id="ListCustomRules__topic1281000316">header</strong>, or <strong id="ListCustomRules__topic1281000317">cookie</strong>, and the subfield is customized, the value of <strong id="ListCustomRules__topic1281000318">index</strong> is the customized subfield.</p>
</li></ul>
</td>
</tr>
<tr id="ListCustomRules__topic1281000319"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="ListCustomRules__topic1281000321">logic_operation</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="ListCustomRules__topic1281000323">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="ListCustomRules__topic1281000325">Logic for matching the condition.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000326"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="ListCustomRules__topic1281000328">contents</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="ListCustomRules__topic1281000330">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="ListCustomRules__topic1281000332">Content of the conditions.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000333"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="ListCustomRules__topic1281000335">value_list_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="ListCustomRules__topic1281000337">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="ListCustomRules__topic1281000339">Reference table ID. It can be obtained by calling the API Querying the Reference Table List. This parameter is available only when a reference table is used when a protection rule is created.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="ListCustomRules__response_CustomAction"></a><a name="response_CustomAction"></a><table cellpadding="4" cellspacing="0" summary="" id="ListCustomRules__response_CustomAction" frame="border" border="1" rules="all"><caption><b>Table 7 </b>CustomAction</caption><thead align="left"><tr id="ListCustomRules__topic1281000346"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.6.2.4.1.1"><p id="ListCustomRules__topic1281000348">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.6.2.4.1.2"><p id="ListCustomRules__topic1281000350">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.6.2.4.1.3"><p id="ListCustomRules__topic1281000352">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListCustomRules__topic1281000354"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.6.2.4.1.1 "><p id="ListCustomRules__topic1281000356">category</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.6.2.4.1.2 "><p id="ListCustomRules__topic1281000358">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.6.2.4.1.3 "><p id="ListCustomRules__topic1281000360">Operation type</p>
<ul id="ListCustomRules__topic1281000361"><li id="ListCustomRules__topic1281000362"><p id="ListCustomRules__topic1281000363"><a name="ListCustomRules__topic1281000362"></a><a name="topic1281000362"></a><strong id="ListCustomRules__topic1281000364">block</strong>: WAF blocks attacks.</p>
</li><li id="ListCustomRules__topic1281000365"><p id="ListCustomRules__topic1281000366"><a name="ListCustomRules__topic1281000365"></a><a name="topic1281000365"></a><strong id="ListCustomRules__topic1281000367">pass</strong>: WAF allows requests.</p>
</li><li id="ListCustomRules__topic1281000368"><p id="ListCustomRules__topic1281000369"><a name="ListCustomRules__topic1281000368"></a><a name="topic1281000368"></a><strong id="ListCustomRules__topic1281000370">log</strong>: WAF only logs detected attacks.</p>
</li></ul>
</td>
</tr>
<tr id="ListCustomRules__topic1281000371"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.6.2.4.1.1 "><p id="ListCustomRules__topic1281000373">followed_action_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.6.2.4.1.2 "><p id="ListCustomRules__topic1281000375">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.6.2.4.1.3 "><p id="ListCustomRules__topic1281000377">ID of a known attack source rule. This parameter can be configured only when <strong id="ListCustomRules__topic1281000378">category</strong> is set to <strong id="ListCustomRules__topic1281000379">block</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="ListCustomRules__topic1281000380"><strong id="ListCustomRules__topic1281000381">Status code: 400</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListCustomRules__response_RestErrorResponse" frame="border" border="1" rules="all"><caption><b>Table 8 </b>Response body parameters</caption><thead align="left"><tr id="ListCustomRules__topic1281000388"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.8.2.4.1.1"><p id="ListCustomRules__topic1281000390">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.8.2.4.1.2"><p id="ListCustomRules__topic1281000392">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.8.2.4.1.3"><p id="ListCustomRules__topic1281000394">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListCustomRules__topic1281000396"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.8.2.4.1.1 "><p id="ListCustomRules__topic1281000398">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.8.2.4.1.2 "><p id="ListCustomRules__topic1281000400">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.8.2.4.1.3 "><p id="ListCustomRules__topic1281000402">Error code</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000403"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.8.2.4.1.1 "><p id="ListCustomRules__topic1281000405">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.8.2.4.1.2 "><p id="ListCustomRules__topic1281000407">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.8.2.4.1.3 "><p id="ListCustomRules__topic1281000409">Error message</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="ListCustomRules__topic1281000410"><strong id="ListCustomRules__topic1281000411">Status code: 401</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListCustomRules__response_RestErrorResponse_1" frame="border" border="1" rules="all"><caption><b>Table 9 </b>Response body parameters</caption><thead align="left"><tr id="ListCustomRules__topic1281000418"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.10.2.4.1.1"><p id="ListCustomRules__topic1281000420">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.10.2.4.1.2"><p id="ListCustomRules__topic1281000422">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.10.2.4.1.3"><p id="ListCustomRules__topic1281000424">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListCustomRules__topic1281000426"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.10.2.4.1.1 "><p id="ListCustomRules__topic1281000428">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.10.2.4.1.2 "><p id="ListCustomRules__topic1281000430">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.10.2.4.1.3 "><p id="ListCustomRules__topic1281000432">Error code</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000433"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.10.2.4.1.1 "><p id="ListCustomRules__topic1281000435">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.10.2.4.1.2 "><p id="ListCustomRules__topic1281000437">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.10.2.4.1.3 "><p id="ListCustomRules__topic1281000439">Error message</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="ListCustomRules__topic1281000440"><strong id="ListCustomRules__topic1281000441">Status code: 500</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListCustomRules__response_RestErrorResponse_2" frame="border" border="1" rules="all"><caption><b>Table 10 </b>Response body parameters</caption><thead align="left"><tr id="ListCustomRules__topic1281000448"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.12.2.4.1.1"><p id="ListCustomRules__topic1281000450">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.12.2.4.1.2"><p id="ListCustomRules__topic1281000452">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.12.2.4.1.3"><p id="ListCustomRules__topic1281000454">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListCustomRules__topic1281000456"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.12.2.4.1.1 "><p id="ListCustomRules__topic1281000458">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.12.2.4.1.2 "><p id="ListCustomRules__topic1281000460">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.12.2.4.1.3 "><p id="ListCustomRules__topic1281000462">Error code</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000463"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.12.2.4.1.1 "><p id="ListCustomRules__topic1281000465">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.12.2.4.1.2 "><p id="ListCustomRules__topic1281000467">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.12.2.4.1.3 "><p id="ListCustomRules__topic1281000469">Error message</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListCustomRules__topic1281000470"><h4 class="sectiontitle">Example Requests</h4><pre class="screen" id="ListCustomRules__topic1281000472">GET https://{Endpoint}/v1/{project_id}/waf/policy/{policy_id}/custom?</pre>
</div>
<div class="section" id="ListCustomRules__topic1281000473"><h4 class="sectiontitle">Example Responses</h4><p id="ListCustomRules__topic1281000475"><strong id="ListCustomRules__topic1281000476">Status code: 200</strong></p>
<p id="ListCustomRules__topic1281000477">Request succeeded.</p>
<pre class="screen" id="ListCustomRules__topic1281000478">{
"items" : [ {
"category" : "block",
"action_mode" : false,
"conditions" : [ {
"category" : "header",
"index" : "sdfsafsda",
"logic_operation" : "contain",
"content" : [ "demo" ]
} ],
"description" : "",
"id" : "2a3caa2bc9814c09ad73d02e3485b4a4",
"policyid" : "1f016cde588646aca3fb19f277c44d03",
"priority" : 50,
"status" : 1,
"time" : false,
"timestamp" : 1656495488880,
"aging_time" : 0,
"producer" : 1
} ],
"total" : 1
}</pre>
</div>
<div class="section" id="ListCustomRules__topic1281000479"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListCustomRules__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="ListCustomRules__topic1281000485"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="ListCustomRules__topic1281000487">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p id="ListCustomRules__topic1281000489">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListCustomRules__topic1281000491"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ListCustomRules__topic1281000493">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ListCustomRules__topic1281000495">Request succeeded.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000496"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ListCustomRules__topic1281000498">400</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ListCustomRules__topic1281000500">Request failed.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000501"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ListCustomRules__topic1281000503">401</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ListCustomRules__topic1281000505">The token does not have required permissions.</p>
</td>
</tr>
<tr id="ListCustomRules__topic1281000506"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ListCustomRules__topic1281000508">500</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ListCustomRules__topic1281000510">Internal server error.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListCustomRules__topic1281000511"><h4 class="sectiontitle">Error Codes</h4><p id="ListCustomRules__topic1281000513">See <a href="ErrorCode.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="topic_300000003.html">Rule Management</a></div>
</div>
</div>