This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dongxiaoyan-tsg-autotest/01-TestCase/tsg_adc/multi_step/a_Deny_Tests.robot

786 lines
60 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

*** Settings ***
Force Tags tsg_adc_wp adc_api proxy_policy
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
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
*** Variables ***
${url} /v1/policy/profile/responsepages
*** Test Cases ***
Proxy-Policy-deny-00001
[Tags] fqdn完整匹配 update policy:ip geo,fqdn
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$newsela.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建categories
${addItemList1} Create Dictionary fqdn=$newsela.com
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary categoryType=fqdn categoryName=newsela objectSubType=category isValid=${1} fqdnList=${addItemLists}
${rescode} ${categoryObjId} ${categoryId} AddCategories ${1} ${objectDict} add 200
Comment 创建ip geo
${addItemList1} Create Dictionary keywordArray=XXG地区.*
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=geo_location isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=*newsela.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI,${categoryObjId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00001 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"重新开始","code":403,"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST,${categoryObjId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_objectId ${objectId}
insert_policyId_to_file1 deny_objectId56 ${objectId1}
insert_policyId_to_file1 deny_objectId57 ${objectId2}
insert_policyId_to_file1 deny_categoryId ${categoryId}
insert_policyId_to_file1 intercept_deny_policyId ${policyId1}
insert_policyId_to_file1 deny_policyId ${policyId2}
Proxy-Policy-deny-00002
[Tags] deny
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*www.youku.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment #创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404english.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny-002 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00002 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","html_profile":${profiledId},"code":403,"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_profileId ${profiledId}
insert_policyId_to_file1 deny_objectId1 ${objectId}
insert_policyId_to_file1 intercept_deny_policyId1 ${policyId1}
insert_policyId_to_file1 deny_policyId1 ${policyId2}
Proxy-Policy-deny-00003
[Tags] url4种匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*wimdu.de isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*creativetravelgroup.com isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=*hinabian.com isHexbin=${0}
${addItemList4} Create Dictionary keywordArray=*smithsonianjourneys.org isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=www.wimdu.de* isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=$creativetravelgroup.com/ isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=*hinabian.com/ isHexbin=${0}
${addItemList4} Create Dictionary keywordArray=smithsonianjourneys isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny-003 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00003 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","html_profile":${profiledId},"code":404,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_profileId1 ${profiledId}
insert_policyId_to_file1 deny_objectId2 ${objectId}
insert_policyId_to_file1 deny_objectId3 ${objectId1}
insert_policyId_to_file1 intercept_deny_policyId2 ${policyId1}
insert_policyId_to_file1 deny_policyId2 ${policyId2}
Proxy-Policy-deny-00004
[Tags] 请求头左匹配 update policy:url,请求头
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*usdebtclock.org isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=state-of-california-debt-clock.html isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建url2
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=bbs.nga.cn/
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=bbs.nga.cn/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头2
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=*nga.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId5} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00004 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"qwertyuiop","code":404,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_objectId4 ${objectId}
insert_policyId_to_file1 deny_objectId5 ${objectId1}
insert_policyId_to_file1 deny_objectId6 ${objectId2}
insert_policyId_to_file1 deny_objectId48 ${objectId3}
insert_policyId_to_file1 deny_objectId49 ${objectId4}
insert_policyId_to_file1 deny_objectId50 ${objectId5}
insert_policyId_to_file1 intercept_deny_policyId3 ${policyId1}
insert_policyId_to_file1 deny_policyId3 ${policyId2}
Proxy-Policy-deny-00005
[Tags] 请求头完整匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$americantesol.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=tesol-register isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00005 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"онлайн фильмы","code":451,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_objectId7 ${objectId}
insert_policyId_to_file1 deny_objectId8 ${objectId1}
insert_policyId_to_file1 deny_objectId9 ${objectId2}
insert_policyId_to_file1 intercept_deny_policyId4 ${policyId1}
insert_policyId_to_file1 deny_policyId4 ${policyId2}
Proxy-Policy-deny-00006
[Tags] 请求头字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.playgroundsessions.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=software-features isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=AppleWebKit isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00006 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"明天大涨","code":404,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_objectId10 ${objectId}
insert_policyId_to_file1 deny_objectId11 ${objectId1}
insert_policyId_to_file1 deny_objectId12 ${objectId2}
insert_policyId_to_file1 intercept_deny_policyId5 ${policyId1}
insert_policyId_to_file1 deny_policyId5 ${policyId2}
Proxy-Policy-deny-00007
[Tags] 请求头右匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$peoplestalkradio.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=forums/register.php isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=*Safari/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00007 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"今天中奖","code":403,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_objectId13 ${objectId}
insert_policyId_to_file1 deny_objectId14 ${objectId1}
insert_policyId_to_file1 deny_objectId15 ${objectId2}
insert_policyId_to_file1 intercept_deny_policyId6 ${policyId1}
insert_policyId_to_file1 deny_policyId6 ${policyId2}
Proxy-Policy-deny-00008
[Tags] 应答头右匹配 update policy:fqdn,url,应答头
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*6renyou.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=user_comment isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=*utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=*tianya.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
Comment 创建url2
${addItemList1} Create Dictionary keywordArray=tianya.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
Comment 创建应答头2
${addItemList1} Create Dictionary keywordArray=text/html* isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId5} AddObjects ${1} ${objectDict}
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00008 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","html_profile":${profiledId},"code":451,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_profileId2 ${profiledId}
insert_policyId_to_file1 deny_objectId16 ${objectId}
insert_policyId_to_file1 deny_objectId17 ${objectId1}
insert_policyId_to_file1 deny_objectId18 ${objectId2}
insert_policyId_to_file1 deny_objectId51 ${objectId3}
insert_policyId_to_file1 deny_objectId52 ${objectId4}
insert_policyId_to_file1 deny_objectId53 ${objectId5}
insert_policyId_to_file1 intercept_deny_policyId7 ${policyId1}
insert_policyId_to_file1 deny_policyId7 ${policyId2}
Proxy-Policy-deny-00009
[Tags] 应答头完整匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*cuctv.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=cuctv isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头
${addItemList1} Create Dictionary keywordArray=$text/html; charset=utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00009 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","html_profile":${profiledId},"code":451,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_profileId3 ${profiledId}
insert_policyId_to_file1 deny_objectId19 ${objectId}
insert_policyId_to_file1 deny_objectId20 ${objectId1}
insert_policyId_to_file1 deny_objectId21 ${objectId2}
insert_policyId_to_file1 intercept_deny_policyId8 ${policyId1}
insert_policyId_to_file1 deny_policyId8 ${policyId2}
Proxy-Policy-deny-00010
[Tags] 应答头字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*duckduckmoose.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=duckduck isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头
${addItemList1} Create Dictionary keywordArray=text/html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404english.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00010 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","html_profile":${profiledId},"code":451,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_profileId4 ${profiledId}
insert_policyId_to_file1 deny_objectId22 ${objectId}
insert_policyId_to_file1 deny_objectId23 ${objectId1}
insert_policyId_to_file1 deny_objectId24 ${objectId2}
insert_policyId_to_file1 intercept_deny_policyId9 ${policyId1}
insert_policyId_to_file1 deny_policyId9 ${policyId2}
Proxy-Policy-deny-00011
[Tags] 应答头左匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*tutcandy.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=sketch-to isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头
${addItemList1} Create Dictionary keywordArray=text* isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment #创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404english.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00011 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","html_profile":${profiledId},"code":451,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_profileId5 ${profiledId}
insert_policyId_to_file1 deny_objectId25 ${objectId}
insert_policyId_to_file1 deny_objectId26 ${objectId1}
insert_policyId_to_file1 deny_objectId27 ${objectId2}
insert_policyId_to_file1 intercept_deny_policyId10 ${policyId1}
insert_policyId_to_file1 deny_policyId10 ${policyId2}
Proxy-Policy-deny-00012
[Tags] cookie字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.youqulu.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=zixun isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=saltkey|Cookie
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00012 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"123456789","code":403,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_objectId28 ${objectId}
insert_policyId_to_file1 deny_objectId29 ${objectId1}
insert_policyId_to_file1 deny_objectId30 ${objectId2}
insert_policyId_to_file1 intercept_deny_policyId11 ${policyId1}
insert_policyId_to_file1 deny_policyId11 ${policyId2}
Proxy-Policy-deny-00013
[Tags] set-cookie4种匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.nypl.org,*thailand.com.co,*ke.com,$nationalbank.kz
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=incap_ses*|Set-Cookie,*Max-Age=604800|Set-Cookie,domain=.ke.com|Set-Cookie,irkzadmin_session*|Set-Cookie
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=www.nypl.org,thailand.com.co,ke.com,nationalbank.kz
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00013 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"一直相信","code":403,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR,${objectId2}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_objectId31 ${objectId}
insert_policyId_to_file1 deny_objectId32 ${objectId1}
insert_policyId_to_file1 deny_objectId46 ${objectId2}
insert_policyId_to_file1 intercept_deny_policyId12 ${policyId1}
insert_policyId_to_file1 deny_policyId12 ${policyId2}
Proxy-Policy-deny-00014
[Tags] 请求体字串匹配 update policy:请求体
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=ProxydenyTest001401
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建请求体2
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=ProxydenyTest001402
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00014 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"涨涨涨涨","code":404,"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_objectId33 ${objectId}
insert_policyId_to_file1 deny_objectId34 ${objectId1}
insert_policyId_to_file1 deny_objectId54 ${objectId2}
insert_policyId_to_file1 intercept_deny_policyId13 ${policyId1}
insert_policyId_to_file1 deny_policyId13 ${policyId2}
Proxy-Policy-deny-00015
[Tags] 应答体字串匹配
Comment 创建应答体
${addItemList1} Create Dictionary keywordArray=Proxydeny001501 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建应答体2
${addItemList1} Create Dictionary keywordArray=Proxydeny001502 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00015 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"涨涨涨涨","code":404,"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_objectId35 ${objectId}
insert_policyId_to_file1 deny_objectId55 ${objectId1}
insert_policyId_to_file1 deny_policyId14 ${policyId2}
Proxy-Policy-deny-00016
[Tags] Sub Objects层级
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$mt.meipai.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*mt.meipai.com/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
# ${addItemList} Create List ${objectId1}
# ${objectDict1} Create Dictionary objectType=url isValid=${1} subObjectIds=${addItemList}
# ${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
Comment 创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny-0016 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-000016 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","html_profile":${profiledId},"code":404,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_profileId6 ${profiledId}
insert_policyId_to_file1 deny_objectId47 ${objectId}
insert_policyId_to_file1 deny_objectId58 ${objectId1}
# insert_policyId_to_file1 deny_objectId59 ${objectId2}
insert_policyId_to_file1 intercept_deny_policyId15 ${policyId1}
insert_policyId_to_file1 deny_policyId17 ${policyId2}
Proxy-Policy-deny-00017
[Tags] 最大组合1
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=open isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_qq_Id} AddObjects ${1} ${objectDict}
Comment 创建应答头
${addItemList1} Create Dictionary keywordArray=charset isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_yd_Id} AddObjects ${1} ${objectDict}
Comment 创建请求体
${addItemList1} Create Dictionary keywordArray=ProxyDenyTest0017 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_body_Id} AddObjects ${1} ${objectDict}
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00017 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"涨涨涨涨","code":404,"protocol":"HTTP"} filterList=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_qq_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_yd_Id}|TSG_FIELD_HTTP_RES_HDR,${object_body_Id}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_objectId36 ${object_fqdn_Id}
insert_policyId_to_file1 deny_objectId37 ${object_url_Id}
insert_policyId_to_file1 deny_objectId38 ${object_qq_Id}
insert_policyId_to_file1 deny_objectId39 ${object_yd_Id}
insert_policyId_to_file1 deny_objectId40 ${object_body_Id}
insert_policyId_to_file1 deny_policyId15 ${policyId2}
Proxy-Policy-deny-00018
[Tags] 最大组合2
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.umusicpub.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=sicpub.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建请求头cookie
${addItemList1} Create Dictionary keywordArray=timezoneoffset isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_qq_Id} AddObjects ${1} ${objectDict}
Comment 创建Set-Cookie
${addItemList1} Create Dictionary keywordArray=Domain=.umusicpub.com isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_yd_Id} AddObjects ${1} ${objectDict}
Comment 创建应答体
${addItemList1} Create Dictionary keywordArray=NOFOLLOW isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_body_Id} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny-0018 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00018 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"涨涨涨涨","code":404,"protocol":"HTTP"} filterList=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_qq_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_yd_Id}|TSG_FIELD_HTTP_RES_HDR,${object_body_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_objectId41 ${object_fqdn_Id}
insert_policyId_to_file1 deny_objectId42 ${object_url_Id}
insert_policyId_to_file1 deny_objectId43 ${object_qq_Id}
insert_policyId_to_file1 deny_objectId44 ${object_yd_Id}
insert_policyId_to_file1 deny_objectId45 ${object_body_Id}
insert_policyId_to_file1 intercept_deny_policyId14 ${policyId1}
insert_policyId_to_file1 deny_policyId16 ${policyId2}
Proxy-Policy-deny-00019
[Tags] substring
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.cndns.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=www.cndns.com/cn/sms/index.aspx isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment keyword8个子串,创建应答体
${addItemList1} Create Dictionary keywordArray=美橙短信,短信群发,到达率更强,企业营销类,短信验证,群发服务,正规106网关,联通全面 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_res_cont_Id} AddObjects ${1} ${objectDict}
Comment user-agent8个子串,创建请求头
${addItemList1} Create Dictionary keywordArray=4d6f7a696c6c612f352e30,57696e646f7773,57696e3634,783634,4170706c65,65624b6974,4b48544d4c,6c696b65 isHexbin=${1} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ua_Id} AddObjects ${1} ${objectDict}
Comment cont-Type8个子串,创建应答头
${addItemList1} Create Dictionary keywordArray=7465,78742f,6874,6d6c,68746d6c,63686172,736574,63686172736574 isHexbin=${1} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ct_Id} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny-0019 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00019 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"涨涨涨涨","code":404,"protocol":"HTTP"} filterList=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_ua_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_res_cont_Id}|TSG_FIELD_HTTP_RES_CONTENT,${object_ct_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 deny_objectId60 ${object_fqdn_Id}
insert_policyId_to_file1 deny_objectId61 ${object_url_Id}
insert_policyId_to_file1 deny_objectId62 ${object_res_cont_Id}
insert_policyId_to_file1 deny_objectId63 ${object_ua_Id}
insert_policyId_to_file1 deny_objectId64 ${object_ct_Id}
insert_policyId_to_file1 intercept_deny_policyId18 ${policyId1}
insert_policyId_to_file1 deny_policyId18 ${policyId2}
# Proxy-Policy-deny-00020
# [Tags] substring
# Comment 创建fqdn
# ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.cndns.com
# ${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
# Comment 创建url
# ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=www.cndns.com/cn/sms/index.aspx
# ${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
# Comment keyword8个子串,创建应答体
# ${addItemList1} Create Dictionary keywordArray=美橙短信,短信群发,到达率更强,企业营销类,短信验证,群发服务,正规106网关,联通全面 isHexbin=${0}
# ${addItemLists} Create list ${addItemList1}
# ${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
# ${rescode} ${object_res_cont_Id} AddObjects ${1} ${objectDict}
# Comment user-agent8个子串,创建请求头
# ${addItemList1} Create Dictionary keywordArray=4d6f7a696c6c612f352e30,57696e646f7773,57696e3634,783634,4170706c65,65624b6974,4b48544d4c,6c696b65 isHexbin=${1} district=User-Agent
# ${addItemLists} Create list ${addItemList1}
# ${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
# ${rescode} ${object_ua_Id} AddObjects ${1} ${objectDict}
# Comment cont-Type8个子串,创建应答头
# ${addItemList1} Create Dictionary keywordArray=7465,78742f,6874,6d6c,68746d6c,63686172,736574,63686172736574 isHexbin=${1} district=Content-Type
# ${addItemLists} Create list ${addItemList1}
# ${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
# ${rescode} ${object_ct_Id} AddObjects ${1} ${objectDict}
# Comment 创建拦截策略
# ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny-0019 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
# log ${policyDict}
# ${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
# ${policyId1} Get-Pids ${policyId1}
# ${policyId1} Set Variable ${policyId1}[0]
# Comment 创建deny策略
# ${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00019 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"涨涨涨涨","code":404,"protocol":"HTTP"} filterList=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_ua_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_res_cont_Id}|TSG_FIELD_HTTP_RES_CONTENT,${object_ct_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
# log ${policyDict}
# ${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
# ${policyId2} Get-Pids ${policyId2}
# ${policyId2} Set Variable ${policyId2}[0]
# insert_policyId_to_file1 deny_objectId60 ${object_fqdn_Id}
# insert_policyId_to_file1 deny_objectId61 ${object_url_Id}
# insert_policyId_to_file1 deny_objectId62 ${object_res_cont_Id}
# insert_policyId_to_file1 deny_objectId63 ${object_ua_Id}
# insert_policyId_to_file1 deny_objectId64 ${object_ct_Id}
# insert_policyId_to_file1 intercept_deny_policyId18 ${policyId1}
# insert_policyId_to_file1 deny_policyId18 ${policyId2}