2020-07-29 20:20:03 +08:00
|
|
|
|
*** 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
|
2020-09-07 19:23:55 +08:00
|
|
|
|
Resource ../../../03-Variable/ApplicationID.txt
|
2020-07-29 20:20:03 +08:00
|
|
|
|
|
|
|
|
|
|
*** Test Cases ***
|
|
|
|
|
|
Proxy-Policy-replace-00001
|
2021-02-08 10:35:09 +08:00
|
|
|
|
[Tags] fqdn完整匹配 update policy:ip source ,fqdn, replace content:resp_body
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建fqdn
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$destidotcom.wordpress.com
|
|
|
|
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建url
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=wordpress.com/contact/
|
|
|
|
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
2021-02-08 10:35:09 +08:00
|
|
|
|
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} ${objectId2} AddObjects ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建fqdn2
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*destidotcom.wordpress.com
|
|
|
|
|
|
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment Comment 创建拦截策略
|
2021-02-08 10:35:09 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace01 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}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId1} Get-Pids ${policyId1}
|
|
|
|
|
|
${policyId1} Set Variable ${policyId1}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建replace策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00001 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_body","find":"Artificial","replace_with":"明天你好"}],"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId2} Get-Pids ${policyId2}
|
|
|
|
|
|
${policyId2} Set Variable ${policyId2}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId ${objectId}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId39 ${objectId1}
|
2021-02-08 10:35:09 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId42 ${objectId2}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId43 ${objectId3}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 intercept_replace_policyId ${policyId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_policyId ${policyId2}
|
|
|
|
|
|
|
|
|
|
|
|
Proxy-Policy-replace-00002
|
2021-02-08 10:35:09 +08:00
|
|
|
|
[Tags] cat右匹配 update policy:url, replace content:http_req_uri
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建fqdn
|
2021-02-08 10:35:09 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*plishsplash.com
|
|
|
|
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建url
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=www.splishsplash.com
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
2021-02-08 10:35:09 +08:00
|
|
|
|
Comment 创建url2
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*shsplash.com
|
|
|
|
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment Comment 创建拦截策略
|
2021-02-08 10:35:09 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=109|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId1} Get-Pids ${policyId1}
|
|
|
|
|
|
${policyId1} Set Variable ${policyId1}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建replace策略
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00002 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_req_uri","find":"splishsplash","replace_with":"facebook"}],"protocol":"HTTP"} filterList=109|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId2} Get-Pids ${policyId2}
|
|
|
|
|
|
${policyId2} Set Variable ${policyId2}[0]
|
2021-02-08 10:35:09 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId1 ${objectId}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId40 ${objectId1}
|
2021-02-08 10:35:09 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId44 ${objectId2}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 intercept_replace_policyId1 ${policyId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_policyId1 ${policyId2}
|
|
|
|
|
|
|
|
|
|
|
|
Proxy-Policy-replace-00003
|
2020-08-10 19:07:01 +08:00
|
|
|
|
[Tags] url4种匹配
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建fqdn
|
2021-02-01 19:16:09 +08:00
|
|
|
|
# ${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*smartertravel.com,*chinese.hostelworld.com,*truelinkfinancial.com,*nycgo.com
|
|
|
|
|
|
# ${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建url
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=umcfa.webs.com*,$www.pjpugliese.com/,*co.za/,ornithomedia
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment Comment 创建拦截策略
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=109|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId1} Get-Pids ${policyId1}
|
|
|
|
|
|
${policyId1} Set Variable ${policyId1}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建replace策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00003 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"json"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId2} Get-Pids ${policyId2}
|
|
|
|
|
|
${policyId2} Set Variable ${policyId2}[0]
|
|
|
|
|
|
#insert_policyId_to_file1 replace_objectId2 ${objectId}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId3 ${objectId1}
|
|
|
|
|
|
insert_policyId_to_file1 intercept_replace_policyId2 ${policyId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_policyId2 ${policyId2}
|
|
|
|
|
|
|
|
|
|
|
|
Proxy-Policy-replace-00004
|
2021-02-08 10:35:09 +08:00
|
|
|
|
[Tags] 请求头左匹配 update policy:请求头,replace content:http_resp_header
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建fqdn
|
2020-08-06 18:39:36 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*ino.com
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建url
|
2020-08-06 18:39:36 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=headlines/
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建请求头
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
|
|
|
|
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
2021-02-08 10:35:09 +08:00
|
|
|
|
Comment 创建请求头2
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0|User-Agent
|
|
|
|
|
|
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建拦截策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace 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}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId1} Get-Pids ${policyId1}
|
|
|
|
|
|
${policyId1} Set Variable ${policyId1}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建replace策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00004 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"json"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId2} Get-Pids ${policyId2}
|
|
|
|
|
|
${policyId2} Set Variable ${policyId2}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId4 ${objectId}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId5 ${objectId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId6 ${objectId2}
|
2021-02-08 10:35:09 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId45 ${objectId3}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 intercept_replace_policyId3 ${policyId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_policyId3 ${policyId2}
|
|
|
|
|
|
|
|
|
|
|
|
Proxy-Policy-replace-00005
|
2020-08-10 19:07:01 +08:00
|
|
|
|
[Tags] 请求头完整匹配
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建fqdn
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.bestwestern.com
|
|
|
|
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建url
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=estern.com/en_US.html
|
|
|
|
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建请求头
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
|
|
|
|
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建拦截策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace 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}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId1} Get-Pids ${policyId1}
|
|
|
|
|
|
${policyId1} Set Variable ${policyId1}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建replace策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00005 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"json"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId2} Get-Pids ${policyId2}
|
|
|
|
|
|
${policyId2} Set Variable ${policyId2}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId7 ${objectId}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId8 ${objectId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId9 ${objectId2}
|
|
|
|
|
|
insert_policyId_to_file1 intercept_replace_policyId4 ${policyId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_policyId4 ${policyId2}
|
|
|
|
|
|
|
|
|
|
|
|
Proxy-Policy-replace-00006
|
2020-08-10 19:07:01 +08:00
|
|
|
|
[Tags] 请求头字串匹配
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建fqdn
|
2020-08-06 18:39:36 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.quickenloans.com
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建url
|
2020-08-06 18:39:36 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=mortgage-education/home-buyers-guide?qlsource=nav
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建请求头
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=AppleWebKit|User-Agent
|
|
|
|
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建拦截策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace 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}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId1} Get-Pids ${policyId1}
|
|
|
|
|
|
${policyId1} Set Variable ${policyId1}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建replace策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00006 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"json"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId2} Get-Pids ${policyId2}
|
|
|
|
|
|
${policyId2} Set Variable ${policyId2}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId10 ${objectId}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId11 ${objectId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId12 ${objectId2}
|
|
|
|
|
|
insert_policyId_to_file1 intercept_replace_policyId5 ${policyId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_policyId5 ${policyId2}
|
|
|
|
|
|
|
|
|
|
|
|
Proxy-Policy-replace-00007
|
2020-08-10 19:07:01 +08:00
|
|
|
|
[Tags] 请求头右匹配
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建fqdn
|
2020-08-06 18:39:36 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.gobank.com
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建url
|
2020-08-06 18:39:36 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=mobile-banking/mobile-app
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建请求头
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
|
|
|
|
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建拦截策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace 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}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId1} Get-Pids ${policyId1}
|
|
|
|
|
|
${policyId1} Set Variable ${policyId1}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建replace策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00007 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"json"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId2} Get-Pids ${policyId2}
|
|
|
|
|
|
${policyId2} Set Variable ${policyId2}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId13 ${objectId}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId14 ${objectId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId15 ${objectId2}
|
|
|
|
|
|
insert_policyId_to_file1 intercept_replace_policyId6 ${policyId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_policyId6 ${policyId2}
|
|
|
|
|
|
|
|
|
|
|
|
Proxy-Policy-replace-00008
|
2021-02-08 10:35:09 +08:00
|
|
|
|
[Tags] 应答头右匹配 update policy:应答头,replace content:http_resp_header
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建fqdn
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*www.ghzq.com.cn
|
|
|
|
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建url
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=ghzq/index.html
|
|
|
|
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建请求头
|
2020-08-05 18:51:02 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
2021-02-08 10:35:09 +08:00
|
|
|
|
Comment 创建请求头2
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
|
|
|
|
|
|
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment Comment 创建拦截策略
|
2021-02-08 10:35:09 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace08 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId1} Get-Pids ${policyId1}
|
|
|
|
|
|
${policyId1} Set Variable ${policyId1}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建replace策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00008 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"json"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId2} Get-Pids ${policyId2}
|
|
|
|
|
|
${policyId2} Set Variable ${policyId2}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId16 ${objectId}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId17 ${objectId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId18 ${objectId2}
|
2021-02-08 10:35:09 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId46 ${objectId3}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 intercept_replace_policyId7 ${policyId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_policyId7 ${policyId2}
|
|
|
|
|
|
|
|
|
|
|
|
Proxy-Policy-replace-00009
|
2020-08-10 19:07:01 +08:00
|
|
|
|
[Tags] 应答头完整匹配
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建fqdn
|
2021-02-08 10:35:09 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*zcool.com.cn
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建url
|
2021-02-08 10:35:09 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=www.zcool.com.cn
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
2021-02-08 10:35:09 +08:00
|
|
|
|
Comment 创建应答头
|
2020-08-05 18:51:02 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=utf-8|Content-Type
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment Comment 创建拦截策略
|
2021-02-08 10:35:09 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace-09 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}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId1} Get-Pids ${policyId1}
|
|
|
|
|
|
${policyId1} Set Variable ${policyId1}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建replace策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00009 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"json"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId2} Get-Pids ${policyId2}
|
|
|
|
|
|
${policyId2} Set Variable ${policyId2}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId19 ${objectId}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId20 ${objectId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId21 ${objectId2}
|
|
|
|
|
|
insert_policyId_to_file1 intercept_replace_policyId8 ${policyId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_policyId8 ${policyId2}
|
|
|
|
|
|
|
|
|
|
|
|
Proxy-Policy-replace-00010
|
2021-02-08 10:35:09 +08:00
|
|
|
|
[Tags] fqdn右匹配 update policy:replace content:http_resp_body
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建fqdn
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
|
|
|
|
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建url
|
2021-02-08 10:35:09 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
2021-02-08 10:35:09 +08:00
|
|
|
|
Comment 创建请求头
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=testpolicyreplace_0010|Content-Type
|
|
|
|
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment Comment 创建拦截策略
|
2021-02-22 10:43:44 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace-10 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${0} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId1} Get-Pids ${policyId1}
|
|
|
|
|
|
${policyId1} Set Variable ${policyId1}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建replace策略
|
2021-02-22 10:43:44 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00010 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_body","find":"hello","replace_with":"111111"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${0} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId2} Get-Pids ${policyId2}
|
|
|
|
|
|
${policyId2} Set Variable ${policyId2}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId22 ${objectId}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId23 ${objectId1}
|
2021-02-08 10:35:09 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId47 ${objectId2}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 intercept_replace_policyId9 ${policyId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_policyId9 ${policyId2}
|
|
|
|
|
|
|
|
|
|
|
|
Proxy-Policy-replace-00011
|
2020-08-10 19:07:01 +08:00
|
|
|
|
[Tags] 应答头左匹配
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建fqdn
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*shfe.com.cn
|
|
|
|
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建url
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=products/au/
|
|
|
|
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建请求头
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text*|Content-Type
|
|
|
|
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment Comment 创建拦截策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId1} Get-Pids ${policyId1}
|
|
|
|
|
|
${policyId1} Set Variable ${policyId1}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建replace策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00011 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"json"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId2} Get-Pids ${policyId2}
|
|
|
|
|
|
${policyId2} Set Variable ${policyId2}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId25 ${objectId}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId26 ${objectId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId27 ${objectId2}
|
|
|
|
|
|
insert_policyId_to_file1 intercept_replace_policyId10 ${policyId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_policyId10 ${policyId2}
|
|
|
|
|
|
|
|
|
|
|
|
Proxy-Policy-replace-00012
|
2020-08-10 19:07:01 +08:00
|
|
|
|
[Tags] cookie字串匹配
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建fqdn
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.national-park.com
|
|
|
|
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建url
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=welcome-to-canyonlands-national-park/
|
|
|
|
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建cookie
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=saltkey|Cookie
|
|
|
|
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建拦截策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace 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}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId1} Get-Pids ${policyId1}
|
|
|
|
|
|
${policyId1} Set Variable ${policyId1}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建replace策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00012 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"json"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId2} Get-Pids ${policyId2}
|
|
|
|
|
|
${policyId2} Set Variable ${policyId2}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId28 ${objectId}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId29 ${objectId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId30 ${objectId2}
|
|
|
|
|
|
insert_policyId_to_file1 intercept_replace_policyId11 ${policyId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_policyId11 ${policyId2}
|
|
|
|
|
|
|
|
|
|
|
|
Proxy-Policy-replace-00013
|
2020-08-10 19:07:01 +08:00
|
|
|
|
[Tags] set-cookie4种匹配
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建fqdn
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.classicvacations.com,*expediacruises.com,*expediagroup.com,$www.expedia.co.uk
|
|
|
|
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建set-cookie
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=AWSALB*|Set-Cookie,*Domain=.expedia.co.uk; Secure; SameSite=None|Set-Cookie,AWSALBCORS=|Set-Cookie,CurentCulture=en-US*|Set-Cookie
|
|
|
|
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
2020-08-05 18:51:02 +08:00
|
|
|
|
Comment 创建URL
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=www.classicvacations.com,expediacruises.com,expediagroup.com,www.expedia.co.uk
|
|
|
|
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建拦截策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace 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}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId1} Get-Pids ${policyId1}
|
|
|
|
|
|
${policyId1} Set Variable ${policyId1}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建replace策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00013 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"json"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR,${objectId2}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId2} Get-Pids ${policyId2}
|
|
|
|
|
|
${policyId2} Set Variable ${policyId2}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId31 ${objectId}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId32 ${objectId1}
|
2020-08-05 18:51:02 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId41 ${objectId2}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 intercept_replace_policyId12 ${policyId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_policyId12 ${policyId2}
|
|
|
|
|
|
|
|
|
|
|
|
Proxy-Policy-replace-00014
|
2020-08-10 19:07:01 +08:00
|
|
|
|
[Tags] 最大组合
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建fqdn
|
2020-08-27 11:41:27 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*engadget.com
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建url
|
2020-08-27 11:41:27 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*gaming/
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建请求头
|
|
|
|
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
|
|
|
|
|
|
${rescode} ${object_qq_Id} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建应答头
|
2020-08-27 11:41:27 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text|Content-Type
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${object_yd_Id} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建cookie
|
2020-08-05 18:51:02 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=__stripe_sid|Cookie
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${object_ck_Id} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建set-cookie
|
2020-08-27 11:41:27 +08:00
|
|
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Domain=.engadget.com|Set-Cookie
|
2020-07-29 20:20:03 +08:00
|
|
|
|
${rescode} ${object_sk_Id} AddObject2 ${1} ${objectDict}
|
|
|
|
|
|
Comment 创建拦截策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace 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}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId1} Get-Pids ${policyId1}
|
|
|
|
|
|
${policyId1} Set Variable ${policyId1}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
Comment 创建replace策略
|
2020-09-07 19:23:55 +08:00
|
|
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00014 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"json"}],"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_sk_Id}|TSG_FIELD_HTTP_RES_HDR,${object_ck_Id}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-29 20:20:03 +08:00
|
|
|
|
log ${policyDict}
|
|
|
|
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
|
${policyId2} Get-Pids ${policyId2}
|
|
|
|
|
|
${policyId2} Set Variable ${policyId2}[0]
|
2020-07-29 20:20:03 +08:00
|
|
|
|
insert_policyId_to_file1 replace_objectId33 ${object_fqdn_Id}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId34 ${object_url_Id}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId35 ${object_qq_Id}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId36 ${object_yd_Id}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId37 ${object_ck_Id}
|
|
|
|
|
|
insert_policyId_to_file1 replace_objectId38 ${object_sk_Id}
|
|
|
|
|
|
insert_policyId_to_file1 intercept_replace_policyId13 ${policyId1}
|
|
|
|
|
|
insert_policyId_to_file1 replace_policyId13 ${policyId2}
|