doc-exports/docs/wafd/umn/waf_01_0010.html
Li, Qiao e8a6dc40f2 WAF Dedicated UMN 20230329 version
Reviewed-by: Belejkanic, Lukas <lukas.belejkanic@t-systems.com>
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>
2023-06-01 11:05:42 +00:00

215 lines
31 KiB
HTML

<a name="waf_01_0010"></a><a name="waf_01_0010"></a>
<h1 class="topictitle1">Configuring a Precise Protection Rule</h1>
<div id="body1499850551754"><p id="waf_01_0010__p054151120552">WAF allows you to customize protection rules by combining HTTP headers, cookies, URLs, request parameters, and client IP addresses.</p>
<p id="waf_01_0010__p3915713154217">You can combine common HTTP fields, such as <strong id="waf_01_0010__b12755105814206">IP</strong>, <strong id="waf_01_0010__b99803394216">Path</strong>, <strong id="waf_01_0010__b14936444102014">Referer</strong>, <strong id="waf_01_0010__b368818500204">User Agent</strong>, and <strong id="waf_01_0010__b198188545207">Params</strong> in a protection rule to let WAF allow, block, or only log the requests that match the combined conditions.</p>
<p id="waf_01_0010__p189583316115">A reference table can be added to a precise protection rule. The reference table takes effect for all protected domain names.</p>
<div class="note" id="waf_01_0010__note5421182994812"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="waf_01_0010__waf_01_0008_p1976613493524">If you have enabled enterprise projects, ensure that you have all operation permissions for the project where your WAF instance locates. Then, you can select the project from the <strong id="waf_01_0010__waf_01_0008_b1434003118502">Enterprise Project</strong> drop-down list and configure protection policies for the domain names in the project.</p>
</div></div>
<div class="section" id="waf_01_0010__section5903171661012"><h4 class="sectiontitle">Prerequisites</h4><p id="waf_01_0010__waf_01_0054_waf_01_0001_p173267390016">A website has been added to WAF.</p>
</div>
<div class="section" id="waf_01_0010__section176179617302"><h4 class="sectiontitle">Constraints</h4>
<ul id="waf_01_0010__ul97102913118"><li id="waf_01_0010__li17181185975714">It takes several minutes for a new rule to take effect. After the rule takes effect, protection events triggered by the rule will be displayed on the <strong id="waf_01_0010__waf_01_0012_b35831521175415">Events</strong> page.</li><li id="waf_01_0010__li21686130324">If you configure <strong id="waf_01_0010__b1360311366590">Protective Action</strong> to <strong id="waf_01_0010__b1460573614596">Block</strong> for a precise protection rule, you can configure a known attack source rule by referring to <a href="waf_01_0271.html">Configuring a Known Attack Source Rule</a>. WAF will block requests matching the configured IP address, Cookie, or Params for a length of time configured as part of the rule.</li></ul>
</div>
<div class="section" id="waf_01_0010__section16438640193314"><h4 class="sectiontitle">Application Scenarios</h4><p id="waf_01_0010__p186899546338">Precise protection rules are used for anti-leeching and website management background protection.</p>
</div>
<div class="section" id="waf_01_0010__section61533550183130"><h4 class="sectiontitle">Procedure</h4><ol id="waf_01_0010__ol202261245463"><li id="waf_01_0010__li16374183013585"><span>Log in to the management console.</span></li><li id="waf_01_0010__li1392155773219"><span>Click <span><img id="waf_01_0010__waf_01_0002_image10410329111410" src="en-us_image_0000001532904513.jpg"></span> in the upper left corner of the management console and select a region or project.</span></li><li id="waf_01_0010__li13897125313222"><span>Click <span><img id="waf_01_0010__image074281418325" src="en-us_image_0000001288266230.png"></span> in the upper left corner and choose <strong id="waf_01_0010__b1163357125820">Web Application Firewall (Dedicated)</strong> under <strong id="waf_01_0010__b196341877585">Security</strong>.</span></li><li id="waf_01_0010__li099971734316"><span>In the navigation pane on the left, choose <strong id="waf_01_0010__b86512413112">Website Settings</strong>.</span></li><li id="waf_01_0010__li35971439114220"><span>In the <strong id="waf_01_0010__b1084583310343">Policy</strong> column of the row containing the target website, click the number to go to the policy configuration page.</span></li><li id="waf_01_0010__li184373297154"><span>In the <strong id="waf_01_0010__b04712245720">Precise Protection</strong> configuration area, change <strong id="waf_01_0010__b74862205720">Status</strong> as needed and click <strong id="waf_01_0010__b9494285719">Customize Rule</strong> to go to the <strong id="waf_01_0010__b1750172195714">Precise Protection</strong> page.</span><p><div class="fignone" id="waf_01_0010__fig275911394277"><span class="figcap"><b>Figure 1 </b>Precise Protection configuration area</span><br><span><img id="waf_01_0010__image106061056182218" src="en-us_image_0000001337808105.png" title="Click to enlarge" class="imgResize"></span></div>
<p id="waf_01_0010__p10540743101215"></p>
</p></li><li id="waf_01_0010__li14378299150"><span>On the <strong id="waf_01_0010__b4436104412813">Precise Protection</strong> page, set <strong id="waf_01_0010__b124361544282">Detection Mode</strong>.</span><p><div class="p" id="waf_01_0010__p1723518470525">Two detection modes are available:<ul id="waf_01_0010__ul19633123184913"><li id="waf_01_0010__li1436312319133"><strong id="waf_01_0010__b71495584102">Instant Detection</strong>: If a request matches a configured precise protection rule, WAF immediately ends threat detection and blocks the request.</li><li id="waf_01_0010__li46330315494"><strong id="waf_01_0010__b20772104119112">Full Detection</strong>: If a request matches a configured precise protection rule, WAF finishes its scan first and then blocks all requests that match the configured precise protection rule.<div class="fignone" id="waf_01_0010__fig1818193165213"><span class="figcap"><b>Figure 2 </b>Setting Detection Mode</span><br><span><img id="waf_01_0010__image32521106269" src="en-us_image_0000001338129425.png" title="Click to enlarge" class="imgResize"></span></div>
</li></ul>
</div>
</p></li><li id="waf_01_0010__li15438192913157"><span>Click <strong id="waf_01_0010__b123590261098">Add Rule</strong>.</span></li><li id="waf_01_0010__li19438129101516"><span>In the displayed dialog box, add a rule by referring to <a href="#waf_01_0010__table2299936310457">Table 1</a>.</span><p><p id="waf_01_0010__p71861629141614">The settings shown in <a href="#waf_01_0010__fig39459217174738">Figure 3</a> are used as an example. If a visitor tries to access a URL containing <span class="parmvalue" id="waf_01_0010__parmvalue1715095611917"><b>/admin</b></span>, WAF will block the request.</p>
<div class="notice" id="waf_01_0010__note4801412162217"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="waf_01_0010__p78011112112213">To ensure that WAF blocks only attack requests, configure <strong id="waf_01_0010__b9945141099">Protective Action</strong> to <strong id="waf_01_0010__b174681393920">Log only</strong> first and check whether normal requests are blocked on the <strong id="waf_01_0010__b1378620353914">Events</strong> page. If no normal requests are blocked, configure <strong id="waf_01_0010__b124404701019">Protective Action</strong> to <strong id="waf_01_0010__b17131152171015">Block</strong>.</p>
</div></div>
<div class="p" id="waf_01_0010__p0459503915"><div class="fignone" id="waf_01_0010__fig39459217174738"><a name="waf_01_0010__fig39459217174738"></a><a name="fig39459217174738"></a><span class="figcap"><b>Figure 3 </b>Add Precise Protection Rule</span><br><span><img id="waf_01_0010__image1578317704020" src="en-us_image_0000001327470582.png" title="Click to enlarge" class="imgResize"></span></div>
</div>
<div class="p" id="waf_01_0010__p119227446166">
<div class="tablenoborder"><a name="waf_01_0010__table2299936310457"></a><a name="table2299936310457"></a><table cellpadding="4" cellspacing="0" summary="" id="waf_01_0010__table2299936310457" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Rule parameters</caption><thead align="left"><tr id="waf_01_0010__row6587906910457"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.8.2.9.2.4.1.2.4.1.1"><p id="waf_01_0010__p4300370110457">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="49%" id="mcps1.3.8.2.9.2.4.1.2.4.1.2"><p id="waf_01_0010__p6074778910457">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="34%" id="mcps1.3.8.2.9.2.4.1.2.4.1.3"><p id="waf_01_0010__p49407333103735">Example Value</p>
</th>
</tr>
</thead>
<tbody><tr id="waf_01_0010__row985919110457"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.1 "><p id="waf_01_0010__p6039702210457">Protective Action</p>
</td>
<td class="cellrowborder" valign="top" width="49%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.2 "><p id="waf_01_0010__p6032064210457">You can select <strong id="waf_01_0010__b1415113017316">Block</strong>, <strong id="waf_01_0010__b1480912331637">Allow</strong>, or <strong id="waf_01_0010__b15282385316">Log only</strong>. Default value: <strong id="waf_01_0010__b19967114335620">Block</strong></p>
</td>
<td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.3 "><p id="waf_01_0010__p42571074103735"><strong id="waf_01_0010__b842352706175637">Block</strong></p>
</td>
</tr>
<tr id="waf_01_0010__row1630016275502"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.1 "><p id="waf_01_0010__p957518413304">Known Attack Source</p>
</td>
<td class="cellrowborder" valign="top" width="49%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.2 "><p id="waf_01_0010__p8575441133012">If you set <strong id="waf_01_0010__b16391105117593">Protective Action</strong> to <strong id="waf_01_0010__b13392155115920">Block</strong>, you can select a blocking type for a known attack source rule. Then, WAF blocks requests matching the configured <strong id="waf_01_0010__b154212138295">IP</strong>, <strong id="waf_01_0010__b64315131291">Cookie</strong>, or <strong id="waf_01_0010__b164391313297">Params</strong> for a length of time that depends on the selected blocking type.</p>
</td>
<td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.3 "><p id="waf_01_0010__p105756414304"><strong id="waf_01_0010__b841448111816">Long-term IP address blocking</strong></p>
</td>
</tr>
<tr id="waf_01_0010__row67041622103812"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.1 "><p id="waf_01_0010__p6704202210380">Effective Date</p>
</td>
<td class="cellrowborder" valign="top" width="49%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.2 "><p id="waf_01_0010__p1070492283816">Select <strong id="waf_01_0010__b7608152217812">Immediate</strong> to enable the rule immediately, or select <strong id="waf_01_0010__b15970204010">Custom</strong> to configure when you wish the rule to be enabled.</p>
</td>
<td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.3 "><p id="waf_01_0010__p87041322113820"><strong id="waf_01_0010__b1018125311812">Immediate</strong></p>
</td>
</tr>
<tr id="waf_01_0010__row601487010457"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.1 "><p id="waf_01_0010__p1744246310457">Condition List</p>
</td>
<td class="cellrowborder" valign="top" width="49%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.2 "><p id="waf_01_0010__p355343310457">Click <strong id="waf_01_0010__b842352706154928">Add</strong> to add conditions. At least one condition needs to be added. You can add up to 30 conditions to a protection rule. If more than one condition is added, all of the conditions must be met for the rule to be applied. A condition includes the following parameters:</p>
<div class="p" id="waf_01_0010__p7949331142211">Parameters for configuring a condition are described as follows:<ul id="waf_01_0010__ul61829843104748"><li id="waf_01_0010__li18188182033310"><strong id="waf_01_0010__b842352706134812">Field</strong></li><li id="waf_01_0010__li168603561498"><strong id="waf_01_0010__b136405281019">Subfield</strong>: Configure this field only when <span class="parmvalue" id="waf_01_0010__parmvalue10793315133817"><b>Params</b></span>, <span class="parmvalue" id="waf_01_0010__parmvalue7793131533815"><b>Cookie</b></span>, or <span class="parmvalue" id="waf_01_0010__parmvalue242742372716"><b>Header</b></span> is selected for <strong id="waf_01_0010__b9654143874510">Field</strong>.</li><li id="waf_01_0010__li45757787104748"><strong id="waf_01_0010__b14964124454514">Logic</strong>: Select a logical relationship from the drop-down list.<div class="note" id="waf_01_0010__note1264220793210"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="waf_01_0010__ul103946551112"><li id="waf_01_0010__li16394185519111">If <strong id="waf_01_0010__b197661226143011">Include any value</strong>, <strong id="waf_01_0010__b2767826143018">Exclude any value</strong>, <strong id="waf_01_0010__b11769142613301">Equal to any value</strong>, <strong id="waf_01_0010__b167701826153013">Not equal to any value</strong>, <strong id="waf_01_0010__b2077162612304">Prefix is any value</strong>, <strong id="waf_01_0010__b14772162613308">Prefix is not any of them</strong>, <strong id="waf_01_0010__b4773226133019">Suffix is any value</strong>, or <strong id="waf_01_0010__b9774172619301">Suffix is not any of them</strong> is selected, select an existing reference table in the <strong id="waf_01_0010__b1844110614506">Content</strong> drop-down list. For details, see <a href="waf_01_0081.html">Adding a Reference Table</a>.</li><li id="waf_01_0010__li9133135815118"><strong id="waf_01_0010__b14755827204517">Exclude any value</strong>, <strong id="waf_01_0010__b375662764517">Not equal to any value</strong>, <strong id="waf_01_0010__b19756192794516">Prefix is not any of them</strong>, and <strong id="waf_01_0010__b187571327144515">Suffix is not any of them</strong> indicates, respectively, that WAF performs the protection action (block, allow, or log only) when the field in the access request does not contain, is not equal to, or the prefix or suffix is not any value set in the reference table. For example, assume that <strong id="waf_01_0010__b1655617550485">Path</strong> field is set to <strong id="waf_01_0010__b172914312492">Exclude any value</strong> and the <strong id="waf_01_0010__b1424283516494">test</strong> reference table is selected. If <em id="waf_01_0010__i42279375505">test1</em>, <em id="waf_01_0010__i1161511416502">test2</em>, and <em id="waf_01_0010__i210020487509">test3</em> are set in the <strong id="waf_01_0010__b1245816297500">test</strong> reference table, WAF performs the protection action when the path of the access request does not contain <em id="waf_01_0010__i1874291115512">test1</em>, <em id="waf_01_0010__i374291116514">test2</em>, or <em id="waf_01_0010__i19743171145115">test3</em>.</li></ul>
</div></div>
</li><li id="waf_01_0010__li14531210104748"><strong id="waf_01_0010__b842352706125548">Content</strong>: Enter or select the content of condition matching.</li></ul>
</div>
<div class="note" id="waf_01_0010__note661931813411"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="waf_01_0010__p106195186413">For more details about the configurations in general, see <a href="#waf_01_0010__table13543174312394">Table 2</a>.</p>
</div></div>
</td>
<td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.3 "><p id="waf_01_0010__p247213553318"><strong id="waf_01_0010__b7768165834314">Path</strong> <strong id="waf_01_0010__b13769175864317">Include</strong> <span class="parmvalue" id="waf_01_0010__parmvalue276915586432"><b>/admin</b></span></p>
</td>
</tr>
<tr id="waf_01_0010__row1662111271019"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.1 "><p id="waf_01_0010__p10621172711012">Priority</p>
</td>
<td class="cellrowborder" valign="top" width="49%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.2 "><p id="waf_01_0010__p1462172718019">Rule priority. If you have added multiple rules, rules are matched by priority. The smaller the value you set, the higher the priority.</p>
<p id="waf_01_0010__p14394154011378"></p>
</td>
<td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.3 "><p id="waf_01_0010__p662112271010"><strong id="waf_01_0010__b842352706174327">5</strong></p>
</td>
</tr>
<tr id="waf_01_0010__row1749220184218"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.1 "><p id="waf_01_0010__p14492418122119">Rule Description</p>
</td>
<td class="cellrowborder" valign="top" width="49%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.2 "><p id="waf_01_0010__p349315182212">A brief description of the rule. This parameter is optional.</p>
</td>
<td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.8.2.9.2.4.1.2.4.1.3 "><p id="waf_01_0010__p17493181812219">None</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="waf_01_0010__table13543174312394"></a><a name="table13543174312394"></a><table cellpadding="4" cellspacing="0" summary="" id="waf_01_0010__table13543174312394" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Condition list configurations</caption><thead align="left"><tr id="waf_01_0010__row4545174315393"><th align="left" class="cellrowborder" valign="top" width="20.71792820717928%" id="mcps1.3.8.2.9.2.4.2.2.5.1.1"><p id="waf_01_0010__p754544383917">Field</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25.35746425357464%" id="mcps1.3.8.2.9.2.4.2.2.5.1.2"><p id="waf_01_0010__p25459434391">Subfield</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="28.947105289471054%" id="mcps1.3.8.2.9.2.4.2.2.5.1.3"><p id="waf_01_0010__p254519433398">Logic</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24.97750224977502%" id="mcps1.3.8.2.9.2.4.2.2.5.1.4"><p id="waf_01_0010__p198160263426">Example Content</p>
</th>
</tr>
</thead>
<tbody><tr id="waf_01_0010__row1545114318391"><td class="cellrowborder" valign="top" width="20.71792820717928%" headers="mcps1.3.8.2.9.2.4.2.2.5.1.1 "><p id="waf_01_0010__p14545943123913"><strong id="waf_01_0010__b1771255132710">Path</strong>: Part of a URL that does not include a domain name. This value supports exact matches only. For example, if the path to be protected is <span class="parmvalue" id="waf_01_0010__parmvalue1768152135715"><b>/admin</b></span>, <strong id="waf_01_0010__b7684121155720">Path</strong> must be set to <span class="parmvalue" id="waf_01_0010__parmvalue86861421185719"><b>/admin</b></span>.</p>
</td>
<td class="cellrowborder" valign="top" width="25.35746425357464%" headers="mcps1.3.8.2.9.2.4.2.2.5.1.2 "><p id="waf_01_0010__p854510433396">None</p>
</td>
<td class="cellrowborder" rowspan="11" valign="top" width="28.947105289471054%" headers="mcps1.3.8.2.9.2.4.2.2.5.1.3 "><p id="waf_01_0010__p179031626154610">Select a logical relationship from the drop-down list.</p>
</td>
<td class="cellrowborder" valign="top" width="24.97750224977502%" headers="mcps1.3.8.2.9.2.4.2.2.5.1.4 "><p id="waf_01_0010__p3816126184210"><strong id="waf_01_0010__b1069515911449">/buy/phone/</strong></p>
<div class="notice" id="waf_01_0010__note15986103748"><span class="noticetitle"> NOTICE: </span><div class="noticebody"><p id="waf_01_0010__p1598618311415">If <strong id="waf_01_0010__b89181015134312">Path</strong> is set to <strong id="waf_01_0010__b119191115104314">/</strong>, all paths of the website are protected.</p>
</div></div>
</td>
</tr>
<tr id="waf_01_0010__row362081410432"><td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.1 "><p id="waf_01_0010__p14550191054413"><strong id="waf_01_0010__b76123351226">User Agent</strong>: A user agent of the scanner to be checked.</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.2 "><p id="waf_01_0010__p662081414436">None</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.3 "><p id="waf_01_0010__p6620111410435"><strong id="waf_01_0010__b130712328562">Mozilla/5.0 (Windows NT 6.1)</strong></p>
</td>
</tr>
<tr id="waf_01_0010__row323411238439"><td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.1 "><p id="waf_01_0010__p723419233430"><strong id="waf_01_0010__b162061481921">IP</strong>: An IP address of the visitor for the protection.</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.2 "><p id="waf_01_0010__p33561559193816">--</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.3 "><p id="waf_01_0010__p5299121911268">XXX.XXX.1.1</p>
</td>
</tr>
<tr id="waf_01_0010__row17545184303914"><td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.1 "><p id="waf_01_0010__p1654518431392"><strong id="waf_01_0010__b186907431422">Params</strong>: A request parameter.</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.2 "><ul id="waf_01_0010__ul179874773220"><li id="waf_01_0010__li19988178327">All fields</li><li id="waf_01_0010__li998815718328">Any subfield</li><li id="waf_01_0010__li1998812763213">Custom</li></ul>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.3 "><p id="waf_01_0010__p124131623102"><strong id="waf_01_0010__b15732135131516">201901150929</strong></p>
</td>
</tr>
<tr id="waf_01_0010__row371633435320"><td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.1 "><p id="waf_01_0010__p1328162011433"><strong id="waf_01_0010__b1433018561622">Referer</strong>: A user-defined request resource.</p>
<p id="waf_01_0010__p3649202911486">For example, if the protected path is <strong id="waf_01_0010__b97241919319">/admin/xxx</strong> and you do not want visitors to access the page from <strong id="waf_01_0010__b77240192114">www.test.com</strong>, set <strong id="waf_01_0010__b1372416191110">Content</strong> to <strong id="waf_01_0010__b117249191210">http://www.test.com</strong>.</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.2 "><p id="waf_01_0010__p137454216498">--</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.3 "><p id="waf_01_0010__p1671911347538">http://www.test.com</p>
</td>
</tr>
<tr id="waf_01_0010__row15281420164313"><td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.1 "><p id="waf_01_0010__p8281172044315"><strong id="waf_01_0010__b18627194144014">Cookie</strong>: A small piece of data to identify web visitors.</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.2 "><ul id="waf_01_0010__ul1318046183318"><li id="waf_01_0010__li131811267330">All fields</li><li id="waf_01_0010__li118111643314">Any subfield</li><li id="waf_01_0010__li131811467335">Custom</li></ul>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.3 "><p id="waf_01_0010__p19281162034311">jsessionid</p>
</td>
</tr>
<tr id="waf_01_0010__row22811220114314"><td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.1 "><p id="waf_01_0010__p4281120114316"><strong id="waf_01_0010__b1472121436">Header</strong>: A user-defined HTTP header.</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.2 "><ul id="waf_01_0010__ul0244121419334"><li id="waf_01_0010__li13244114173315">All fields</li><li id="waf_01_0010__li124491413336">Any subfield</li><li id="waf_01_0010__li024451413319">Custom</li></ul>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.3 "><p id="waf_01_0010__p2028152064316"><strong id="waf_01_0010__b10842145118168">text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8</strong></p>
</td>
</tr>
<tr id="waf_01_0010__row8327101912481"><td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.1 "><p id="waf_01_0010__p6328819104811"><strong id="waf_01_0010__b783542845613">Method</strong>: the user-defined request method.</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.2 "><p id="waf_01_0010__p1167313571079">None</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.3 "><p id="waf_01_0010__p4328201904815"><strong id="waf_01_0010__b59318504567">GET</strong>, <strong id="waf_01_0010__b154731154155618">POST</strong>, <strong id="waf_01_0010__b206518214458">PUT</strong>, <strong id="waf_01_0010__b115862269459">DELETE</strong>, and <strong id="waf_01_0010__b17993084519">PATCH</strong></p>
</td>
</tr>
<tr id="waf_01_0010__row37275297488"><td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.1 "><p id="waf_01_0010__p4728152964817"><strong id="waf_01_0010__b5898242194514">Request Line</strong>: Length of a user-defined request line.</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.2 "><p id="waf_01_0010__p0728929104812">None</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.3 "><p id="waf_01_0010__p32923524917"><strong id="waf_01_0010__b72881113204615">50</strong></p>
</td>
</tr>
<tr id="waf_01_0010__row13028247483"><td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.1 "><p id="waf_01_0010__p1230210246488"><strong id="waf_01_0010__b1847014196465">Request</strong>: Length of a user-defined request. It includes the request header, request line, and request body.</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.2 "><p id="waf_01_0010__p123021324194813">None</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.3 "><p id="waf_01_0010__p630282434820">None</p>
</td>
</tr>
<tr id="waf_01_0010__row18406106587"><td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.1 "><p id="waf_01_0010__p1740717019587"><strong id="waf_01_0010__b1013514517354">Protocol</strong>: the protocol of the request.</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.2 "><p id="waf_01_0010__p74071304581">None</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.8.2.9.2.4.2.2.5.1.3 "><p id="waf_01_0010__p11407140105815">http</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</p></li><li id="waf_01_0010__li643812971514"><span>Click <span class="uicontrol" id="waf_01_0010__uicontrol4176193313215"><b>Confirm</b></span>. You can then view the added precise protection rule in the protection rule list.</span><p><ul id="waf_01_0010__ul32152522327"><li id="waf_01_0010__li7955184513317">To disable a rule, click <strong id="waf_01_0010__waf_01_1209_b022115243516">Disable</strong> in the <strong id="waf_01_0010__waf_01_1209_b202222247513">Operation</strong> column of the rule. The default <strong id="waf_01_0010__waf_01_1209_b2222724105113">Rule Status</strong> is <strong id="waf_01_0010__waf_01_1209_b18222192419516">Enabled</strong>.</li><li id="waf_01_0010__li142141252173210">To modify a rule, click <strong id="waf_01_0010__b2077526122010">Modify</strong> in the row containing the rule.</li><li id="waf_01_0010__li82151952133210">To delete a rule, click <strong id="waf_01_0010__b842352706102537">Delete</strong> in the row containing the rule.</li></ul>
</p></li></ol>
</div>
<div class="section" id="waf_01_0010__section1410161231312"><h4 class="sectiontitle">Protection Effect</h4><p id="waf_01_0010__p13688122011">If you have configured a precise protection rule as shown in <a href="#waf_01_0010__fig39459217174738">Figure 3</a> for your domain name, to verify WAF is protecting your website (<strong id="waf_01_0010__b3250122915119">www.example.com</strong>) against the rule:</p>
<ol id="waf_01_0010__ol16341201137"><li id="waf_01_0010__li934202019133"><span>Clear the browser cache and enter the domain name in the address bar to check whether the website is accessible.</span><p><ul id="waf_01_0010__waf_01_0008_ul112081054104215"><li id="waf_01_0010__li181201354134518">If the website is inaccessible, connect the website domain name to WAF by following the instructions in <a href="waf_01_0250.html">Step 1: Add a Website to WAF</a>.</li><li id="waf_01_0010__waf_01_0008_li15572817174415">If the website is accessible, go to <a href="#waf_01_0010__li1160182620213">Step 2</a>.</li></ul>
</p></li><li id="waf_01_0010__li1160182620213"><a name="waf_01_0010__li1160182620213"></a><a name="li1160182620213"></a><span>Clear the browser cache and enter <strong id="waf_01_0010__b19449159535">http://www.example.com/admin</strong> (or any page containing <strong id="waf_01_0010__b310911531240">/admin</strong>) in the address bar. Normally, WAF blocks the requests that meet the conditions and returns the block page.</span></li><li id="waf_01_0010__li168851237104814"><span>Return to the WAF console. In the navigation pane, click <strong id="waf_01_0010__b54812261431">Events</strong>. On the displayed page, view or <a href="waf_01_0077.html">download events data</a>.</span></li></ol>
</div>
<div class="section" id="waf_01_0010__section293512615491"><h4 class="sectiontitle">Configuration Example - Blocking a Certain Type of Attack Requests</h4><p id="waf_01_0010__p1492264045211">Analysis of a specific type of WordPress pingback attack shows that the <strong id="waf_01_0010__b041163413394">User Agent</strong> field contains WordPress.</p>
<div class="fignone" id="waf_01_0010__fig16451834185616"><span class="figcap"><b>Figure 4 </b>WordPress pingback attack</span><br><span><img id="waf_01_0010__image445133413562" src="en-us_image_0168632822.png" title="Click to enlarge" class="imgResize"></span></div>
<p id="waf_01_0010__p83921526165718">A precise rule as shown in the figure can block this type of attack.</p>
<div class="fignone" id="waf_01_0010__fig116717261909"><span class="figcap"><b>Figure 5 </b>User Agent configuration</span><br><span><img id="waf_01_0010__image18322102444111" src="en-us_image_0000001378030725.png" title="Click to enlarge" class="imgResize"></span></div>
</div>
<div class="section" id="waf_01_0010__section699886111110"><h4 class="sectiontitle">Configuration Example - Blocking Specified File Types (ZIP, TAR, and DOCX)</h4><p id="waf_01_0010__p899876161112">You can configure file types that match the path field to block specific files of certain types. For example, if you want to block .zip files, you can configure a precise protection rule as shown in <a href="#waf_01_0010__fig1599818616112">Figure 6</a> to block access requests of .zip files.</p>
<div class="fignone" id="waf_01_0010__fig1599818616112"><a name="waf_01_0010__fig1599818616112"></a><a name="fig1599818616112"></a><span class="figcap"><b>Figure 6 </b>Blocking requests of specific file types</span><br><span><img id="waf_01_0010__image6792112121313" src="en-us_image_0000001499416648.png" title="Click to enlarge" class="imgResize"></span></div>
</div>
<div class="section" id="waf_01_0010__section11765134112520"><h4 class="sectiontitle">Configuration Example - Allowing a Specific IP Address to Access a Certain URL</h4><p id="waf_01_0010__p15765541132517">You can configure multiple conditions in the <strong id="waf_01_0010__b622313238519">Condition List</strong> field. If an access request meets the conditions in the list, WAF will allow the request from a specific IP address to access a specified URL.</p>
<div class="fignone" id="waf_01_0010__fig1976618419256"><span class="figcap"><b>Figure 7 </b>Allowing specific IP addresses to access specified URLs</span><br><span><img id="waf_01_0010__image782484053614" src="en-us_image_0000001182095000.png" title="Click to enlarge" class="imgResize"></span></div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="waf_01_0007.html">Rule Configuration</a></div>
</div>
</div>
<script language="JavaScript">
<!--
image_size('.imgResize');
var msg_imageMax = "view original image";
var msg_imageClose = "close";
//--></script>