2020-06-23 21:02:32 +08:00
*** Settings ***
Force Tags tsg_adc_wp security_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
2021-01-28 20:48:01 +08:00
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
2021-05-17 13:24:29 +06:00
# Resource ../../../03-Variable/ApplicationID.txt
2021-01-28 20:48:01 +08:00
Resource ../../../05-Other/AllFlowCaseVariable.txt
2020-06-23 21:02:32 +08:00
*** Test Cases ***
SecurityPolicy-Deny-Http-00001
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00001.bat
2021-03-01 09:08:49 +08:00
... ELSE set variable curl -m 10 -kv http://www.lkong.net/forum.php
2021-03-05 11:37:54 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
2021-04-14 10:51:13 +08:00
... ELSE Create List timed out
2020-06-23 21:02:32 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-01-28 20:48:01 +08:00
Comment 改变阻断策略
2021-02-01 18:19:18 +08:00
${policyDict} Create Dictionary policyId=${deny_http_policyId} source=${deny_http_objectId35}|TSG_SECURITY_SOURCE_LOCATION policyName=SecurityPolicy-Deny-Http-00001-1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${deny_http_objectId36}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
2021-01-28 20:48:01 +08:00
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
2021-03-01 09:08:49 +08:00
sleep ${policyModifySleepSeconds}
2021-01-28 20:48:01 +08:00
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00001.bat
2021-03-01 09:08:49 +08:00
... ELSE set variable curl -m 10 http://www.lkong.net/forum.php
2021-01-28 20:48:01 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
2021-04-20 10:37:27 +08:00
... ELSE Create List timed out
2021-01-28 20:48:01 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
2020-06-23 21:02:32 +08:00
SecurityPolicy-Deny-Http-00002
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00002.bat
2021-01-28 20:48:01 +08:00
... ELSE set variable curl http://bellaircraftmuseum.org/
2020-06-23 21:02:32 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Deny-Http-00003
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00003.bat
2021-02-01 18:19:18 +08:00
... ELSE set variable curl http://www.icbc.com.cn/
2020-06-23 21:02:32 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00003_1.bat
... ELSE set variable curl http://www.ccb.com/cn/home/indexv3.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00003_2.bat
... ELSE set variable curl http://www.gotohoroscope.com/daily-horoscope.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00003_3.bat
... ELSE set variable curl http://government.ru/news/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Deny-Http-00004
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00004.bat
2020-06-28 19:19:04 +08:00
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' \http://www.tsutmb.ru/sveden
2021-02-01 18:19:18 +08:00
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' \http://www.tsutmb.ru/sveden
2020-06-23 21:02:32 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List yyyyy
... ELSE Create List yyyyy
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-01-28 20:48:01 +08:00
Comment 改变阻断策略
${policyDict} Create Dictionary policyId=${deny_http_policyId3} policyName=SecurityPolicy-Deny-Http-00004_1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"block","code":404,"message":"yyyyy"} filterList=${deny_http_objectId37}|TSG_FIELD_HTTP_REQ_HDR,${deny_http_objectId38}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
2021-04-12 14:51:02 +08:00
sleep 5
2021-01-28 20:48:01 +08:00
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' \http://www.tsutmb.ru/sveden
${stringlist} run keyword if '${systemType}'=='Windows' Create List yyyyy
... ELSE Create List yyyyy
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-04-08 20:09:19 +08:00
2020-06-23 21:02:32 +08:00
SecurityPolicy-Deny-Http-00005
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00005.bat
2021-03-01 09:08:49 +08:00
... ELSE set variable curl -m 10 -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' \http://www.abchina.com/cn/
2020-06-23 21:02:32 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
2021-04-14 10:51:13 +08:00
... ELSE Create List timed out
2020-06-23 21:02:32 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Deny-Http-00006
2021-02-18 16:21:02 +08:00
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00006.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' http://egypt.travel/ru
${stringlist} run keyword if '${systemType}'=='Windows' Create List 网站被阻断
... ELSE Create List 网站被阻断
2020-06-23 21:02:32 +08:00
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00006.bat
2020-08-27 11:41:27 +08:00
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' http://egypt.travel/ru
2020-06-23 21:02:32 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List 网站被阻断
... ELSE Create List 网站被阻断
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Deny-Http-00007
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00007.bat
2020-08-27 11:41:27 +08:00
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' http://www.gw.com.cn/download.shtml
2020-06-23 21:02:32 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Deny-Http-00008
Comment 功能端验证HTTP验证
2020-06-28 19:19:04 +08:00
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00008.bat
2021-04-20 10:37:27 +08:00
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00008_L.bat
2021-02-22 10:43:44 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
2021-04-22 15:26:27 +08:00
... ELSE Create List timed out
2020-06-23 21:02:32 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-01-28 20:48:01 +08:00
Comment 改变阻断策略
${policyDict} Create Dictionary policyId=${deny_http_policyId7} policyName=SecurityPolicy-Deny-Http-00008_1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"rst"} filterList=${deny_http_objectId39}|TSG_FIELD_HTTP_RES_HDR,${deny_http_objectId11}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
2021-04-12 14:51:02 +08:00
sleep 5
2021-01-28 20:48:01 +08:00
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00008.bat
2021-04-20 10:37:27 +08:00
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00008_L.bat
2021-02-22 10:43:44 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
2021-04-22 15:26:27 +08:00
... ELSE Create List timed out
2021-01-28 20:48:01 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-04-08 20:09:19 +08:00
2020-06-23 21:02:32 +08:00
SecurityPolicy-Deny-Http-00009
Comment 功能端验证HTTP验证
2020-06-28 19:19:04 +08:00
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00009.bat
2021-03-01 09:08:49 +08:00
... ELSE set variable curl -m 10 -kv http://www.skycn.com/soft/bangongruanjian.html
2021-02-20 11:38:17 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
2021-03-01 09:08:49 +08:00
... ELSE Create List timed out
2020-06-23 21:02:32 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Deny-Http-00010
Comment 功能端验证HTTP验证
2020-06-28 19:19:04 +08:00
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00010.bat
2021-03-01 09:08:49 +08:00
... ELSE set variable curl -m 10 -kv http://www.avaxsearch.com/tangkas/
2021-02-20 11:38:17 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
2021-04-14 10:51:13 +08:00
... ELSE Create List timed out
2020-06-23 21:02:32 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-01-28 20:48:01 +08:00
Comment 改变阻断策略
2021-04-22 15:26:27 +08:00
${policyDict} Create Dictionary policyId=${deny_http_policyId9} policyName=SecurityPolicy-Deny-Http-00010_1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${deny_http_objectId16}|TSG_FIELD_HTTP_RES_HDR,${deny_http_objectId15}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
2021-01-28 20:48:01 +08:00
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
2021-04-22 15:26:27 +08:00
sleep 10
2021-01-28 20:48:01 +08:00
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00010.bat
2021-03-01 09:08:49 +08:00
... ELSE set variable curl -m 10 -kv http://www.avaxsearch.com/tangkas/
2021-02-20 11:38:17 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
2021-04-14 10:51:13 +08:00
... ELSE Create List timed out
2021-01-28 20:48:01 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-04-08 20:09:19 +08:00
2020-06-23 21:02:32 +08:00
SecurityPolicy-Deny-Http-00011
Comment 功能端验证HTTP验证
2020-06-28 19:19:04 +08:00
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00011.bat
2021-03-01 09:08:49 +08:00
... ELSE set variable curl -m 10 -kv http://www.finestquotes.com/quotesbyauthors.php
2021-02-20 11:38:17 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
2021-04-14 10:51:13 +08:00
... ELSE Create List timed out
2020-06-28 19:19:04 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Deny-Http-00012
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00012.bat
2021-02-24 12:45:03 +08:00
... ELSE set variable curl -kv --cookie "ipp_uid_tst=1614083626134/s-G5u-av-3V6UMopU8qN0w; rerf=AAAAAGA09iqKHHWcAwwEAg==; visid_incap_1850197=73iJXVstR5eD96boaecG5Sr2NGAAAAAAQUIPAAAAAADRrWjXkBE1xHfgl1g2q0+Z; incap_ses_431_1850197=yz/Zbyso2kIQ3JKieDj7BSr2NGAAAAAAxpbwZIp4Ku0GJhK9DvIxUw==; ___utmvmaluytEzB=zJTWRrkycAu; ___utmvbaluytEzB=oZQ XqnOgalR: qtO; ipp_uid2=SLwSBC2htc6RCxdR/gtvNhcOjz2aYXsuOQZ9IMw==; ipp_uid1=1614083626503; ipp_uid=1614083626503/SLwSBC2htc6RCxdR/gtvNhcOjz2aYXsuOQZ9IMw==; tildauid=1614083628065.339214; tildasid=1614083628065.951808; _fbp=fb.1.1614083628650.700159084; previousUrl=universalmusic.ru%2F" --referer 'http://www.baidu.com/' \ http://www.universalmusic.ru/#about
2020-06-28 19:19:04 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List 马上到周末
... ELSE Create List 马上到周末
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-03-01 09:08:49 +08:00
Comment 策略验证之后关闭Deny策略, 若开启可以与monitor_http_001验证条件优先级
${policyDict} Create Dictionary policyId=${deny_http_policyId11} policyName=SecurityPolicy-Deny-Http-00012 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"block","code":404,"message":"马上到周末"} filterList=${deny_http_objectId19}|TSG_FIELD_HTTP_REQ_HDR isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
2020-06-28 19:19:04 +08:00
SecurityPolicy-Deny-Http-00013
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00013_2.bat
2021-05-17 13:24:29 +06:00
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00013_2.bat
2021-02-18 16:21:02 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List 000
2021-04-20 10:37:27 +08:00
... ELSE Create List timed out
2020-06-28 19:19:04 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00013_3.bat
2021-05-17 13:24:29 +06:00
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00013_3.bat
2021-02-18 16:21:02 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List 000
2021-04-20 10:37:27 +08:00
... ELSE Create List timed out
2020-06-28 19:19:04 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-03-01 09:08:49 +08:00
Comment 策略验证之后关闭Deny策略, 若开启可以与monitor_http_001验证条件优先级
${policyDict} Create Dictionary policyId=${deny_http_policyId12} policyName=SecurityPolicy-Deny-Http-00013 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${deny_http_objectId20}|TSG_FIELD_HTTP_RES_HDR isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
2020-06-28 19:19:04 +08:00
SecurityPolicy-Deny-Http-00014
2021-02-24 12:45:03 +08:00
Comment 防止策略之间相互影响,策略验证时再打开策略
2021-04-20 10:37:27 +08:00
${policyDict} Create Dictionary policyId=${deny_http_policyId13} policyName=SecurityPolicy-Deny-Http-00014_1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"rst"} filterList=${deny_http_objectId431}|TSG_FIELD_HTTP_HOST,${deny_http_objectId21}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
2021-02-24 12:45:03 +08:00
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 8
2020-06-28 19:19:04 +08:00
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00014.bat
2021-03-29 11:06:55 +08:00
... ELSE set variable curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{"requestbody":"testDenyHttp0014","setcook":"12345678","contenttype": "content-type","responsebody": "testDenyHttp0014"}" http://open.node.com:180/go
2021-02-24 12:45:03 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
2021-01-28 20:48:01 +08:00
... ELSE Create List Connection reset by peer
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变阻断策略
2021-04-20 10:37:27 +08:00
${policyDict} Create Dictionary policyId=${deny_http_policyId13} policyName=SecurityPolicy-Deny-Http-00014_1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"rst"} filterList=${deny_http_objectId431}|TSG_FIELD_HTTP_HOST,${deny_http_objectId40}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
2021-01-28 20:48:01 +08:00
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
2021-02-22 10:43:44 +08:00
sleep 10
2021-01-28 20:48:01 +08:00
Comment 功能端验证HTTP验证
2021-02-22 10:43:44 +08:00
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00014_1.bat
2021-03-29 11:06:55 +08:00
... ELSE set variable curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{"requestbody":"biubiubiud","setcook":"12345678","contenttype": "content-type","responsebody": "biubiubiud"}" http://open.node.com:180/go
2021-02-18 16:21:02 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
2020-06-23 21:02:32 +08:00
... ELSE Create List Connection reset by peer
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-02-22 10:43:44 +08:00
sleep 5
Comment 用后失效
${policyDict} Create Dictionary policyId=${deny_http_policyId13} policyName=SecurityPolicy-Deny-Http-00014_1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"rst"} filterList=${deny_http_objectId40}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
2020-06-28 19:19:04 +08:00
SecurityPolicy-Deny-Http-00015
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00015.bat
2021-03-01 09:08:49 +08:00
... ELSE set variable curl -m 10 -kv http://www.huatonggs.com/about.html#gsjj
2021-02-22 10:43:44 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List timed out
2020-06-28 19:19:04 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-01-28 20:48:01 +08:00
Comment 改变阻断策略
${policyDict} Create Dictionary policyId=${deny_http_policyId14} policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${deny_http_objectId41}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00015.bat
2021-03-01 09:08:49 +08:00
... ELSE set variable curl -m 10 -kv http://www.huatonggs.com/about.html#gsjj
2021-02-22 10:43:44 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List timed out
2021-01-28 20:48:01 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-04-08 20:09:19 +08:00
2020-06-28 19:19:04 +08:00
SecurityPolicy-Deny-Http-00016
2021-02-24 12:45:03 +08:00
Comment 策略验证时再打开策略
${policyDict} Create Dictionary policyId=${deny_http_policyId15} policyName=SecurityPolicy-Deny-Http-00016 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${deny_http_objectId23}|TSG_FIELD_HTTP_HOST,${deny_http_objectId24}|TSG_FIELD_HTTP_URL,${deny_http_objectId25}|TSG_FIELD_HTTP_REQ_HDR,${deny_http_objectId26}|TSG_FIELD_HTTP_RES_HDR,${deny_http_objectId27}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 6
2020-06-28 19:19:04 +08:00
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00016.bat
2021-03-29 11:06:55 +08:00
... ELSE set variable curl -m 10 -kv -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{"requestbody":"DenyHttp0016","setcook":"asdf","contenttype": "charsetDeny0016","responsebody": "adzx"}" -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' http://open.node.com:180/go
2021-02-22 10:43:44 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
2021-02-18 16:21:02 +08:00
... ELSE Create List 000
2020-06-28 19:19:04 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-02-20 11:38:17 +08:00
Comment 失效阻断策略,高优先级策略存在相同网址使用情况时候应在使用之后将策略失效
${policyDict} Create Dictionary policyId=${deny_http_policyId15} policyName=SecurityPolicy-Deny-Http-00016 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${deny_http_objectId23}|TSG_FIELD_HTTP_HOST,${deny_http_objectId24}|TSG_FIELD_HTTP_URL,${deny_http_objectId25}|TSG_FIELD_HTTP_REQ_HDR,${deny_http_objectId26}|TSG_FIELD_HTTP_RES_HDR,${deny_http_objectId27}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
2021-02-22 10:43:44 +08:00
sleep 5
2020-06-28 19:19:04 +08:00
SecurityPolicy-Deny-Http-00017
Comment 功能端验证HTTP验证
2021-02-22 10:43:44 +08:00
# ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00017.bat
# ... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://smspunch.net/send-free-sms.aspx -w %{http_code}
# sleep 3
2020-06-28 19:19:04 +08:00
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00017.bat
2021-04-20 10:37:27 +08:00
... ELSE set variable curl -m 10 -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://smspunch.net/send-free-sms.aspx
2021-02-22 10:43:44 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List timed out
2020-06-28 19:19:04 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-02-22 10:43:44 +08:00
sleep 5
2020-07-10 19:15:49 +08:00
SecurityPolicy-Deny-Http-00018
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00018.bat
2021-04-20 10:37:27 +08:00
... ELSE set variable curl -m 10 http://www.hebbank.com/
2020-07-10 19:15:49 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
2021-04-20 10:37:27 +08:00
... ELSE Create List timed out
2020-07-10 19:15:49 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-03-01 09:08:49 +08:00
SecurityPolicy-Deny-Http-00019
Comment 开启阻断策略
${policyDict} Create Dictionary policyId=${deny_http_policyId18} policyName=SecurityPolicy-Deny-Http-00019-1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00018.bat
... ELSE set variable curl http://www.hebbank.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 失效阻断策略
${policyDict} Create Dictionary policyId=${deny_http_policyId18} policyName=SecurityPolicy-Deny-Http-00019-2 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
2021-03-05 11:37:54 +08:00
${rescode} UpdatePolicies 1 ${policyDict} v2 update
2021-04-20 10:37:27 +08:00
sleep ${policyModifySleepSeconds}
# curl -kv --cookie "wdcid=69d512097f7e021c; uid=6fe4a07479b44464b2fc6aaea84dcc85; wdlast=1618453760" --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36" --referer 'https://www.baidu.com/' \ http://www.xinhuanet.com/
# http://sports.xinhuanet.com/index.htm
SecurityPolicy-Deny-Http-00020
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00020.bat
... ELSE set variable curl -kv --cookie "wdcid=69d512097f7e021c; uid=6fe4a07479b44464b2fc6aaea84dcc85; wdlast=1618453760" --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36" --referer 'https://www.baidu.com/' \ http://www.xinhuanet.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${rescode} SystemCommands ${commandstr} ${stringlist}