修改PolicyOrganize关键字,适用wannat策略,修改管控策略allow动作、redirect动作、replace动作用例curl请求地址

This commit is contained in:
jwc
2020-08-05 18:51:02 +08:00
parent 5e16452209
commit 4abeb11d4f
27 changed files with 355 additions and 517 deletions

View File

@@ -1,196 +0,0 @@
*** Settings ***
Test Teardown DeleteAfterCase ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security selfserver
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../03-Variable/PolicyObjectDefault.txt
Resource ../../../02-Keyword/tsg_common/StmpHandle.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../03-Variable/BifangApiVariable.txt
Library Custometest
Library json
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /policy/profile/responsepages
${profiledId} ${EMPTY}
${dict} ${None}
${caseName} SecurityPolicy-Deny-AllProtol-00001
*** Keywords ***
create-object-policy
[Arguments] @{flag}
Comment 创建目标IP
${objectDict} Create Dictionary
... objectType=IP
... isValid=1
... objectSubType=${Default_ObjectSubType}
... isInitialize=${Default_IsInitialize}
... isExclusion=${Default_IsExclusion}
... objectName=${caseName}_IPobject
... objectDesc=${Default_ObjectDesc}
... subObjectIds=${Default_SubObjectIds}
... addItemList=CIDR|192.168.100.5|32|0/0&${Default_AddItem_ServerIpFormat}|${Default_AddItem_ServerIp1}|${Default_AddItem_ServerIp2}|${Default_AddItem_ServerPort}|${Default_AddItem_IsInitialize}|${Default_AddItem_ItemName}|${Default_AddItem_ItemDesc}
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Run Keyword If '${testPart}'=='all' set Variable ${objectId}
Comment 创建安全策略针对所有协议相当于BlackIP
${policyDict} Create Dictionary
... policyName=${caseName}
... policyType=tsg_security
... policyDesc=${Default_PolicyDesc}
... action=deny
... effectiveRange=${Default_EffectiveRange}
... userRegion=${Default_UserRegion}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR
... isValid=${Default_IsValid}
... appObjectIdArray=2,3,4,5,6
... userTags=${Default_UserTags}
... doLog=2
... scheduleId=${Default_ScheduleId}
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
${policyIds} Run Keyword If '${testPart}'=='all' Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
# 区分执行方式
${value} Run Keyword If ${flag}==[] insert_policyId_to_file ${caseName} ${policyId} ${objectids}
... ELSE Create Dictionary policyId=${policyId} objectId=${objectids}
Set Test Variable ${dict} ${value}
function-test
Run Keyword If '${testPart}'=='all' Sleep ${policyVerificationSleepSeconds}s
${starttime} Get Time
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/${caseName}_HTTP.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime_http} Get Time
${rescode} SystemCommands ${commandstr} ${stringlist}
Run Keyword If '${testPart}'=='all' Sleep ${policyLogVerificationSleepSeconds}s
${endtime_http} Get Time
#日志验证
#GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 功能端验证SSL验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/${caseName}_SSL.bat
... ELSE set variable curl -kv https://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
#OpenSSL SSL_connect: Connection was reset in connection to
#Send failure: Connection was reset
... ELSE Create List OpenSSL SSL_connect: Connection reset by peer in connection to
${starttime_ssl} Get Time
${rescode} SystemCommands ${commandstr} ${stringlist}
Run Keyword If '${testPart}'=='all' Sleep ${policyLogVerificationSleepSeconds}s
${endtime_ssl} Get Time
#日志验证
#GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni open.node.com
Comment 功能端验证DNS验证
Comment 功能端验证MAIL验证
#${mail} EmailLogin mail.tsgmail.com 25 dongxiaoyan@mail.tsgmail.com dxy123
${starttime_mail} Get Time
${Smtp服务器} Set Variable 192.168.100.5
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable dongxiaoyan@mail.tsgmail.com
${邮箱密码} Set Variable dxy123
${邮件主题} Set Variable что- иностранныеsuject
${发送者} Set Variable dongxiaoyan@mail.tsgmail.com
${附件} Set Variable ["${mailpath}/朱明明测试文件.txt"]
${接收者} Set Variable ["jwctest@mail.tsgmail.com"]
${抄送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${密送者} Set Variable ["lyftest@mail.tsgmail.com"]
${邮件正文} Set Variable 朱明明contentчто-иностранныеsuject
${mail} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
should contain ${mail} mail_fail
Run Keyword If '${testPart}'=='all' Sleep ${policyLogVerificationSleepSeconds}s
${endtime_mail} Get Time
#日志验证
#GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_protocol_type SMTP
Comment 功能端验证FTP验证
${starttime_ftp} Get Time
${ftpLogin} FTP_login ftp://192.168.100.5:21 -u"ftp_user:qazXSW@edc" test.txt
should contain ${ftpLogin} ftp_fail
#日志验证
#GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ''
Run Keyword If '${testPart}'=='all' Sleep ${policyLogVerificationSleepSeconds}s
${endtime_ftp} Get Time
${endtime} Get Time
# 区分执行方式
Run Keyword If ${dict}==${None} insert_time_to_file ${caseName} ${starttime} ${endtime}
... ELSE Run Keyword Set To Dictionary ${dict} ${starttime} ${endtime}
log-test
# 日志验证
${obj} Run Keyword If ${dict}==${None} json.Loads ${caseName}
... ELSE Set Variable ${dict}
${policyId} Set Variable ${obj}[policyId]
${s} Convert to String ${policyId}
${objectids} Run Keyword If '${testPart}'!='all' set Variable ${obj}[objectids]
${policyIds} Run Keyword If '${testPart}'!='all' Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
#日志验证
GetLogList security_event_log ${starttime_http} ${endtime_http} ${testClentIP} ${s} http_host open.node.com
${obj}[starttime] ${obj}[endtime]
Comment 功能端验证SSL验证
#日志验证
GetLogList security_event_log ${starttime_ssl} ${endtime_ssl} ${testClentIP} ${s} ssl_sni open.node.com
Comment 功能端验证DNS验证
Comment 功能端验证MAIL验证
#日志验证
GetLogList security_event_log ${starttime_mail} ${endtime_mail} ${testClentIP} ${s} mail_protocol_type SMTP
Comment 功能端验证FTP验证
#日志验证
GetLogList security_event_log ${starttime_ftp} ${endtime_ftp} ${testClentIP} ${s} ftp_account ''
log-test_bak
# 日志验证
${obj} Run Keyword If ${dict}==${None} json.Loads ${caseName}
... ELSE Set Variable ${dict}
${policyId} Set Variable ${obj}[policyId]
${s} Convert to String ${policyId}
${objectids} Run Keyword If '${testPart}'!='all' set Variable ${obj}[objectids]
${policyIds} Run Keyword If '${testPart}'!='all' Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
#日志验证
#GetLogList security_event_log ${starttime_http} ${endtime_http} ${testClentIP} ${s} http_host open.node.com
GetLogList security_event_log ${obj}[starttime_http] ${obj}[endtime_http] ${testClentIP} ${s} http_host open.node.com
${obj}[starttime] ${obj}[endtime]
Comment 功能端验证SSL验证
#日志验证
#GetLogList security_event_log ${starttime_ssl} ${endtime_ssl} ${testClentIP} ${s} ssl_sni open.node.com
GetLogList security_event_log ${obj}[starttime_ssl} ${obj}[endtime_ssl} ${testClentIP} ${s} ssl_sni open.node.com
Comment 功能端验证DNS验证
Comment 功能端验证MAIL验证
#日志验证
#GetLogList security_event_log ${starttime_mail} ${endtime_mail} ${testClentIP} ${s} mail_protocol_type SMTP
GetLogList security_event_log ${obj}[starttime_mail} ${obj}[endtime_mail} ${testClentIP} ${s} mail_protocol_type SMTP
Comment 功能端验证FTP验证
#日志验证
#GetLogList security_event_log ${starttime_ftp} ${endtime_ftp} ${testClentIP} ${s} ftp_account ''
GetLogList security_event_log ${obj}[starttime_ftp} ${obj}[endtime_ftp} ${testClentIP} ${s} ftp_account ''
*** Test Cases ***
MultiSecurityPolicy-Deny-AllProtol-00001
[Tags] securitypolciy deny allprotol multistep
#${caseName} set variable SecurityPolicy-Deny-AllProtol-00001
Run Keyword If '${testPart}'=='all' Run Keywords create-object-policy True
... AND function-test
... AND log-test
... ELSE IF ${testPart}==1 Run Keyword create-object-policy
... ELSE IF ${testPart}==2 Run Keyword function-test
... ELSE IF ${testPart}==3 Run Keyword log-test
#{"opAction":"add","policyList":{"policyId":"","policyName":"dxytest","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"method":"rst"},"referenceObject":[{"objectId":6926,"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":6943,"protocolFields":["TSG_SECURITY_DESTINATION_ADDR"]}],"isValid":0,"scheduleId":[],"appObjectIdArray":[2,3,4,5,6]}}

View File

@@ -91,13 +91,13 @@ Proxy-Policy-allow-00004
Proxy-Policy-allow-00005
[Tags] 请求头
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.motel6.com
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$boutiquehotel.me
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=motel6.com/#/home
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=paris/
${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
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow 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=3
@@ -172,7 +172,7 @@ Proxy-Policy-allow-00008
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=market/overview/
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*utf-8|Content-Type
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=2
@@ -312,10 +312,10 @@ Proxy-Policy-allow-00013
Proxy-Policy-allow-00014
[Tags] 最大组合1
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*sutori.com
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.orbitz.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*teachers
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*Flights
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
@@ -324,10 +324,10 @@ Proxy-Policy-allow-00014
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=charset|Content-Type
${rescode} ${object_yd_Id} AddObject2 ${1} ${objectDict}
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=__stripe_sid|cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=__stripe_sid|Cookie
${rescode} ${object_ck_Id} AddObject2 ${1} ${objectDict}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=domain=.sutori.com|set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Domain=.orbitz.com|Set-Cookie
${rescode} ${object_sk_Id} AddObject2 ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow 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=3

View File

@@ -429,3 +429,29 @@ Proxy-Policy-deny-00017
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-00018
[Tags] Sub Objects
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$newsela.com
${rescode} ${objectId} AddObjects ${1} ${objectDict1}
${addItemList} Create List ${objectId}
${objectDict1} Create Dictionary objectType=url isValid=${1} subObjectIds=${addItemList}
${rescode} ${objectIds} AddObjects ${1} ${objectDict1}
${params} Create Dictionary objectId=${objectIds} itemType=url
${rescode} ${itemIds} ${itemList} GetObjectItems ${params}
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":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=3
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
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=2
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 deny_profileId1 ${profiledId}
insert_policyId_to_file1 deny_objectId2 ${objectId}
insert_policyId_to_file1 intercept_deny_policyId2 ${policyId1}
insert_policyId_to_file1 deny_policyId2 ${policyId2}

View File

@@ -353,7 +353,7 @@ Proxy-Policy-hijack-00013
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$nsscreencast.com,*edreams.net,*boutiquehotel.me,$www.everymantravel.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_nsscreencast_session_*|Set-Cookie,*Domain=.everymantravel.com;Path=/|Set-Cookie,Domain=.boutiquehotel.me|Set-Cookie,ADRUM_BTa*|Set-Cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_nsscreencast_session_*|Set-Cookie,*Domain=.everymantravel.com;Path=/|Set-Cookie,Domain=.boutiquehotel.me|Set-Cookie,HOME1JSESSIONID*|Set-Cookie
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=nsscreencast,edreams,boutiquehotel,everymantravel

View File

@@ -358,17 +358,21 @@ Proxy-Policy-insert-00013
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=www.shermanstravel.com,wyndhamhotels.com,travelnow.com,www.smithsonianjourneys.org
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-insert 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=3
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
Comment 创建insert策略
${policyDict} Create Dictionary policyName=Proxy-Policy-insert-00013 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=2
${policyDict} Create Dictionary policyName=Proxy-Policy-insert-00013 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR,${objectId2}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=2
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 insert_profileId12 ${profiledId}
insert_policyId_to_file1 insert_objectId31 ${objectId}
insert_policyId_to_file1 insert_objectId32 ${objectId1}
insert_policyId_to_file1 insert_objectId41 ${objectId2}
insert_policyId_to_file1 intercept_insert_policyId12 ${policyId1}
insert_policyId_to_file1 insert_policyId12 ${policyId2}
@@ -387,14 +391,18 @@ Proxy-Policy-insert-00014
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=charset|Content-Type
${rescode} ${object_yd_Id} AddObject2 ${1} ${objectDict}
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=__stripe_sid|cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=__stripe_sid|Cookie
${rescode} ${object_ck_Id} AddObject2 ${1} ${objectDict}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Domain=.intervalworld.com|set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Domain=.intervalworld.com|Set-Cookie
${rescode} ${object_sk_Id} AddObject2 ${1} ${objectDict}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-insert 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=3
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
Comment 创建insert策略
${policyDict} Create Dictionary policyName=Proxy-Policy-insert-00014 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${profiledId},"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_ck_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_sk_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=2
log ${policyDict}
@@ -406,4 +414,5 @@ Proxy-Policy-insert-00014
insert_policyId_to_file1 insert_objectId36 ${object_yd_Id}
insert_policyId_to_file1 insert_objectId37 ${object_ck_Id}
insert_policyId_to_file1 insert_objectId38 ${object_sk_Id}
insert_policyId_to_file1 intercept_insert_policyId13 ${policyId1}
insert_policyId_to_file1 insert_policyId13 ${policyId2}

View File

@@ -42,7 +42,7 @@ Proxy-Policy-redirect-00002
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00002 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"userRegion={"method":"redirect","to":"https://deseretbook.com/t/ebooks/biography-autobiography","code":302,"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=2
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00002 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://deseretbook.com/t/ebooks/biography-autobiography","code":302,"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=2
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 redirect_objectId1 ${objectId}
@@ -137,7 +137,7 @@ Proxy-Policy-redirect-00006
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00006 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://deseretbook.com/t/ebooks/biography-autobiography","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=2
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00006 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://yhd.com","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=2
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 redirect_objectId10 ${objectId}
@@ -162,7 +162,7 @@ Proxy-Policy-redirect-00007
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00007 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://deseretbook.com/t/ebooks/biography-autobiography","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=2
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00007 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://yhd.com","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=2
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 redirect_objectId13 ${objectId}
@@ -187,7 +187,7 @@ Proxy-Policy-redirect-00008
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00008 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://deseretbook.com/t/ebooks/biography-autobiography","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=2
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00008 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://yhd.com","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=2
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 redirect_objectId16 ${objectId}
@@ -212,7 +212,7 @@ Proxy-Policy-redirect-00009
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00009 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://deseretbook.com/t/ebooks/biography-autobiography","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=2
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00009 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://yhd.com","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=2
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 redirect_objectId19 ${objectId}
@@ -274,7 +274,7 @@ Proxy-Policy-redirect-00011
Proxy-Policy-redirect-00012
[Tags] cookie
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$polb.com
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.polb.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=environment/shore-power#shore-power-program-details
@@ -304,16 +304,20 @@ Proxy-Policy-redirect-00013
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=mobile=2*|Set-Cookie,*domain=.egencia.com; HttpOnly|Set-Cookie,domain=.expediapartnersolutions.com|Set-Cookie,AKA_A2=A*|Set-Cookie
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=www.travelmath.com,egencia.com,expediapartnersolutions.com,www.concur.com
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-redirect 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=3
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00013 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://deseretbook.com/t/ebooks/biography-autobiography","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=2
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00013 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://deseretbook.com/t/ebooks/biography-autobiography","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR,${objectId2}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=2
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 redirect_objectId31 ${objectId}
insert_policyId_to_file1 redirect_objectId32 ${objectId1}
insert_policyId_to_file1 redirect_objectId46 ${objectId2}
insert_policyId_to_file1 intercept_redirect_policyId12 ${policyId1}
insert_policyId_to_file1 redirect_policyId12 ${policyId2}
@@ -325,16 +329,20 @@ Proxy-Policy-redirect-00014
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=action
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-redirect policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=3
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00014 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://deseretbook.com/t/ebooks/biography-autobiography","code":302,"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=2
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00014 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://deseretbook.com/t/ebooks/biography-autobiography","code":302,"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT,${objectId2}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=2
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 redirect_objectId33 ${objectId}
insert_policyId_to_file1 redirect_objectId34 ${objectId1}
insert_policyId_to_file1 redirect_objectId47 ${objectId2}
insert_policyId_to_file1 intercept_redirect_policyId13 ${policyId1}
insert_policyId_to_file1 redirect_policyId13 ${policyId2}
@@ -385,7 +393,7 @@ Proxy-Policy-redirect-00016
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00016 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://deseretbook.com/t/ebooks/biography-autobiography","code":302,"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=2
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00016 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://deseretbook.com/t/ebooks/biography-autobiography","code":302,"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 isValid=${1} appIdObjects=2
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 redirect_objectId40 ${object_fqdn_Id}

View File

@@ -180,7 +180,7 @@ Proxy-Policy-replace-00008
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=ghzq/index.html
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*utf-8|Content-Type
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment Comment 创建拦截策略
${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=2
@@ -205,7 +205,7 @@ Proxy-Policy-replace-00009
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=consult/consult.aspx
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=utf-8|Content-Type
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment Comment 创建拦截策略
${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=2
@@ -222,27 +222,23 @@ Proxy-Policy-replace-00009
insert_policyId_to_file1 replace_policyId8 ${policyId2}
Proxy-Policy-replace-00010
[Tags] 应答头
[Tags] 替换请求体
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=action
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html|Content-Type
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment Comment 创建拦截策略
${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=2
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
Comment 创建replace策略
${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00010 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"hello","replace_with":"111111"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=2
${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00010 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"hello","replace_with":"111111"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=2
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 replace_objectId22 ${objectId}
insert_policyId_to_file1 replace_objectId23 ${objectId1}
insert_policyId_to_file1 replace_objectId24 ${objectId2}
insert_policyId_to_file1 intercept_replace_policyId9 ${policyId1}
insert_policyId_to_file1 replace_policyId9 ${policyId2}
@@ -304,16 +300,20 @@ Proxy-Policy-replace-00013
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}
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}
Comment 创建拦截策略
${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=3
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
Comment 创建replace策略
${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 isValid=${1} appIdObjects=2
${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=2
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 replace_objectId31 ${objectId}
insert_policyId_to_file1 replace_objectId32 ${objectId1}
insert_policyId_to_file1 replace_objectId41 ${objectId2}
insert_policyId_to_file1 intercept_replace_policyId12 ${policyId1}
insert_policyId_to_file1 replace_policyId12 ${policyId2}
@@ -332,17 +332,17 @@ Proxy-Policy-replace-00014
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=charset|Content-Type
${rescode} ${object_yd_Id} AddObject2 ${1} ${objectDict}
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=__stripe_sid|cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=__stripe_sid|Cookie
${rescode} ${object_ck_Id} AddObject2 ${1} ${objectDict}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=CURRENCY=USD|set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=CURRENCY=USD|Set-Cookie
${rescode} ${object_sk_Id} AddObject2 ${1} ${objectDict}
Comment 创建拦截策略
${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=3
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
Comment 创建replace策略
${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_ck_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_sk_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=2
${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=2
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 replace_objectId33 ${object_fqdn_Id}

View File

@@ -100,9 +100,9 @@ Proxy-Policy-allow-00005
[Tags] 请求头
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00005.bat
... ELSE set variable curl -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 'https://www.baidu.com/' https://www.motel6.com/#/home
${stringlist} run keyword if '${systemType}'=='Windows' Create List This site might not work properly in this browser Tango Secure Gateway CA
... ELSE Create List This site might not work properly in this browser Tango Secure Gateway CA
... 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 'https://www.baidu.com/' https://boutiquehotel.me/paris/
${stringlist} run keyword if '${systemType}'=='Windows' Create List helps you find the best boutique hotels around the Tango Secure Gateway CA
... ELSE Create List helps you find the best boutique hotels around the Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -258,10 +258,10 @@ Proxy-Policy-allow-00013
Proxy-Policy-allow-00014
[Tags] 最大组合
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00017.bat
... ELSE set variable curl -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" \ --cookie "__cfduid=d5c21129d57e7124b729fd86dc82abdcd1596020306; __stripe_sid=2940d4d5-6822-4daf-8b38-9cd18d745beb; __stripe_mid=dd118cd8-845c-4b6e-98ce-81e8d5bdd52c" --referer 'https://www.baidu.com/' \ https://www.sutori.com/teachers
${stringlist} run keyword if '${systemType}'=='Windows' Create List The best instructional and presentation tool Tango Secure Gateway CA
... ELSE Create List The best instructional and presentation tool Tango Secure Gateway CA
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00014.bat
... ELSE set variable curl -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" \ --cookie "__cfduid=d5c21129d57e7124b729fd86dc82abdcd1596020306; __stripe_sid=2940d4d5-6822-4daf-8b38-9cd18d745beb; __stripe_mid=dd118cd8-845c-4b6e-98ce-81e8d5bdd52c" --referer 'https://www.baidu.com/' \ https://www.orbitz.com/Flights
${stringlist} run keyword if '${systemType}'=='Windows' Create List plenty of cheap airfare and flights to choose from Tango Secure Gateway CA
... ELSE Create List plenty of cheap airfare and flights to choose from Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}

View File

@@ -258,7 +258,7 @@ Proxy-Policy-hijack-00013
Proxy-Policy-hijack-00014
[Tags] 最大组合
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00017.bat
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00014.bat
... ELSE set variable curl -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" \ --cookie "__cfduid=d5c21129d57e7124b729fd86dc82abdcd1596020306; __stripe_sid=2940d4d5-6822-4daf-8b38-9cd18d745beb; __stripe_mid=dd118cd8-845c-4b6e-98ce-81e8d5bdd52c" --referer 'https://www.baidu.com/' \ https://www.visitphilly.com/covid-19-resources-for-greater-philadelphia/
${stringlist} run keyword if '${systemType}'=='Windows' Create List test-2.gif Tango Secure Gateway CA
... ELSE Create List test-2.gif Tango Secure Gateway CA

View File

@@ -115,8 +115,8 @@ Proxy-Policy-redirect-00006
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_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 'https://www.baidu.com/' https://www.marriottvacationclub.com/timeshare-ownership/about/
${stringlist} run keyword if '${systemType}'=='Windows' Create List https://deseretbook.com/t/ebooks/biography-autobiography Tango Secure Gateway CA
... ELSE Create List https://deseretbook.com/t/ebooks/biography-autobiography Tango Secure Gateway CA
${stringlist} run keyword if '${systemType}'=='Windows' Create List https://yhd.com Tango Secure Gateway CA
... ELSE Create List https://yhd.com Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -129,8 +129,8 @@ Proxy-Policy-redirect-00007
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00007.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 'https://www.baidu.com/' https://www.bulgarihotels.com/zh_CN/
${stringlist} run keyword if '${systemType}'=='Windows' Create List https://deseretbook.com/t/ebooks/biography-autobiography Tango Secure Gateway CA
... ELSE Create List https://deseretbook.com/t/ebooks/biography-autobiography Tango Secure Gateway CA
${stringlist} run keyword if '${systemType}'=='Windows' Create List https://yhd.com Tango Secure Gateway CA
... ELSE Create List https://yhd.com Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -142,9 +142,9 @@ Proxy-Policy-redirect-00008
[Tags] 应答头
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00008.bat
... ELSE set variable curl http://www.essence.com.cn/business/fixed
${stringlist} run keyword if '${systemType}'=='Windows' Create List https://deseretbook.com/t/ebooks/biography-autobiography
... ELSE Create List https://deseretbook.com/t/ebooks/biography-autobiography
... ELSE set variable curl -kv http://www.essence.com.cn/business/fixed
${stringlist} run keyword if '${systemType}'=='Windows' Create List https://yhd.com
... ELSE Create List https://yhd.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -156,9 +156,9 @@ Proxy-Policy-redirect-00009
[Tags] 应答头
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00009.bat
... ELSE set variable curl http://www.west95582.com/jdw/index.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List https://deseretbook.com/t/ebooks/biography-autobiography
... ELSE Create List https://deseretbook.com/t/ebooks/biography-autobiography
... ELSE set variable curl -kv http://www.west95582.com/jdw/index.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List https://yhd.com
... ELSE Create List https://yhd.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -170,7 +170,7 @@ Proxy-Policy-redirect-00010
[Tags] 应答头
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00010.bat
... ELSE set variable curl http://www.hazq.com/main/aboutus/index.shtml
... ELSE set variable curl -kv http://www.hazq.com/main/aboutus/index.shtml
${stringlist} run keyword if '${systemType}'=='Windows' Create List https://deseretbook.com/t/ebooks/biography-autobiography
... ELSE Create List https://deseretbook.com/t/ebooks/biography-autobiography
${starttime} Get Time
@@ -184,7 +184,7 @@ Proxy-Policy-redirect-00011
[Tags] 应答头
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00011.bat
... ELSE set variable curl http://www.cs.ecitic.com/newsite/business/bank/tzyh_ywjs/
... ELSE set variable curl -kv http://www.cs.ecitic.com/newsite/business/bank/tzyh_ywjs/
${stringlist} run keyword if '${systemType}'=='Windows' Create List https://deseretbook.com/t/ebooks/biography-autobiography
... ELSE Create List https://deseretbook.com/t/ebooks/biography-autobiography
${starttime} Get Time
@@ -259,7 +259,7 @@ Proxy-Policy-redirect-00014
[Tags] 请求体
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00017.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=lksdf&setCookie=kjhsxbn&contentType=content-type&resBody=opijn" http://open.node.com/action
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=lksdf&setCookie=kjhsxbn&contentType=content-type&resBody=opijn" -kv \ http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List https://deseretbook.com/t/ebooks/biography-autobiography Tango Secure Gateway CA
... ELSE Create List https://deseretbook.com/t/ebooks/biography-autobiography Tango Secure Gateway CA
${starttime} Get Time

View File

@@ -142,7 +142,7 @@ Proxy-Policy-replace-00008
[Tags] 应答头
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00008.bat
... ELSE set variable curl http://www.ghzq.com.cn/ghzq/index.html
... ELSE set variable curl -kv http://www.ghzq.com.cn/ghzq/index.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List text/json
... ELSE Create List text/json
${starttime} Get Time
@@ -156,7 +156,7 @@ Proxy-Policy-replace-00009
[Tags] 应答头
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00009.bat
... ELSE set variable curl http://www.zts.com.cn/consult/consult.aspx
... ELSE set variable curl -kv http://www.zts.com.cn/consult/consult.aspx
${stringlist} run keyword if '${systemType}'=='Windows' Create List text/json
... ELSE Create List text/json
${starttime} Get Time
@@ -170,7 +170,7 @@ Proxy-Policy-replace-00010
[Tags] 应答头
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00010.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=hello&setCookie=hjbnm&contentType=content-type&resBody=05691" -kv \ http://open.node.com/action
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=hello&setCookie=hjbnm&contentType=text/html&resBody=05691" -kv \ http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List 111111
... ELSE Create List 111111
${starttime} Get Time
@@ -184,7 +184,7 @@ Proxy-Policy-replace-00011
[Tags] 应答头
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00011.bat
... ELSE set variable curl http://www.shfe.com.cn/products/au/
... ELSE set variable curl -kv http://www.shfe.com.cn/products/au/
${stringlist} run keyword if '${systemType}'=='Windows' Create List text/json
... ELSE Create List text/json
${starttime} Get Time
@@ -258,7 +258,7 @@ Proxy-Policy-replace-00013
Proxy-Policy-replace-00014
[Tags] 最大组合2
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00017.bat
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00014.bat
... ELSE set variable curl -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" \ --cookie "__cfduid=d5c21129d57e7124b729fd86dc82abdcd1596020306; __stripe_sid=2940d4d5-6822-4daf-8b38-9cd18d745beb; __stripe_mid=dd118cd8-845c-4b6e-98ce-81e8d5bdd52c" --referer 'https://www.baidu.com/' \ https://www.hotelplanner.com/Group-Rate/
${stringlist} run keyword if '${systemType}'=='Windows' Create List text/json Tango Secure Gateway CA
... ELSE Create List text/json Tango Secure Gateway CA

View File

@@ -75,7 +75,7 @@ Proxy-Policy-allow-00005
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${allow_policyId4}]}
${policyIds} Create List ${policyId1} ${policyId2}
${s} Convert to String ${allow_policyId4}
GetLogList proxy_event_log ${allow_starttime7} ${allow_endtime7} ${testClentIP} ${s} http_host www.motel6.com
GetLogList proxy_event_log ${allow_starttime7} ${allow_endtime7} ${testClentIP} ${s} http_host boutiquehotel.me
Proxy-Policy-allow-00006
[Tags] 请求头
@@ -197,4 +197,4 @@ Proxy-Policy-allow-00014
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${allow_policyId13}]}
${policyIds} Create List ${policyId1} ${policyId2}
${s} Convert to String ${allow_policyId13}
GetLogList proxy_event_log ${allow_starttime19} ${allow_endtime19} ${testClentIP} ${s} http_host www.sutori.com
GetLogList proxy_event_log ${allow_starttime19} ${allow_endtime19} ${testClentIP} ${s} http_host www.orbitz.com

View File

@@ -203,6 +203,7 @@ Proxy-Policy-insert-00013
#删除对象
${objectids} set Variable ${insert_objectId31}
${objectids} Catenate SEPARATOR=, ${objectids} ${insert_objectId32}
${objectids} Catenate SEPARATOR=, ${objectids} ${insert_objectId41}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${intercept_insert_policyId12}]}
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${insert_policyId12}]}

View File

@@ -175,6 +175,7 @@ Proxy-Policy-redirect-00013
#删除对象
${objectids} set Variable ${redirect_objectId31}
${objectids} Catenate SEPARATOR=, ${objectids} ${redirect_objectId32}
${objectids} Catenate SEPARATOR=, ${objectids} ${redirect_objectId46}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${intercept_redirect_policyId12}]}
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${redirect_policyId12}]}
@@ -190,6 +191,7 @@ Proxy-Policy-redirect-00014
#删除对象
${objectids} set Variable ${redirect_objectId33}
${objectids} Catenate SEPARATOR=, ${objectids} ${redirect_objectId34}
${objectids} Catenate SEPARATOR=, ${objectids} ${redirect_objectId47}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${intercept_redirect_policyId13}]}
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${redirect_policyId13}]}

View File

@@ -136,13 +136,12 @@ Proxy-Policy-replace-00010
#删除对象
${objectids} set Variable ${replace_objectId22}
${objectids} Catenate SEPARATOR=, ${objectids} ${replace_objectId23}
${objectids} Catenate SEPARATOR=, ${objectids} ${replace_objectId24}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${intercept_replace_policyId9}]}
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${replace_policyId9}]}
${policyIds} Create List ${policyId1} ${policyId2}
${s} Convert to String ${replace_policyId9}
GetLogList proxy_event_log ${replace_starttime12} ${replace_endtime12} ${testClentIP} ${s} http_host www.csrc.gov.cn
GetLogList proxy_event_log ${replace_starttime12} ${replace_endtime12} ${testClentIP} ${s} http_host open.node.com
Proxy-Policy-replace-00011
[Tags] 应答头
@@ -175,6 +174,7 @@ Proxy-Policy-replace-00013
#删除对象
${objectids} set Variable ${replace_objectId31}
${objectids} Catenate SEPARATOR=, ${objectids} ${replace_objectId32}
${objectids} Catenate SEPARATOR=, ${objectids} ${replace_objectId41}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${intercept_replace_policyId12}]}
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${replace_policyId12}]}

View File

@@ -4,6 +4,7 @@ Library Collections
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../03-Variable/PolicyObjectDefault.txt
Resource ../../tsg_common/ManagePolicyBody.robot
*** Variables ***
#arraySplitor:数组元素之间的分隔符
${arraySplitor} ,
@@ -13,7 +14,16 @@ ${protocolFiledSplitor} &
${objectIdSplitor} :
#idFiledSplitor: objectId和protocolFiled之间的分隔符
${idFiledSplitor} |
*** Keywords ***
PolicyListDataOperation
[Arguments] ${returnData} ${policyList} ${opAction} ${policyObjectVersion}
[Documentation] 描述入口opAction参数可为'add','update','disable','enable'
... 参数returnData: 必传,是否返回请求数据。可选${0}(不返回)/${1}(返回)。
... policyList: 必传,字典类型。字典内可选参数信息:
... policyObjectVersion: 必传v1,v2,涉及策略版本
... 其它参数默认值见../../03-Variable/PolicyObjectDefault.txt
... 多个策略处理
# ... 特殊参数说明:
# ... effectiveRange=Nursurtan|Transtelecom&Astel,Almaty&Nursurtan,|Astel&Transtelecom
# ... 为字符串类型,每条生效区域信息以','分隔
@@ -40,16 +50,6 @@ ${idFiledSplitor} |
# ... filterList= ${265}:${257}|TSG_FIELD_HTTP_HOST,${266}:${299}|TSG_FIELD_SSL_SNI
# ... filterList由多个数字用:’分隔,加上|对上对应的protocolFiled,
# ... 一个filter中的protocolFiled是确定的一个protocolFiled对应多个objectId
PolicyListDataOperation
[Documentation]
... 描述入口opAction参数可为'add','update','disable','enable'
... 参数returnData: 必传,是否返回请求数据。可选${0}(不返回)/${1}(返回)。
... policyList: 必传,字典类型。字典内可选参数信息:
... policyObjectVersion: 必传v1,v2,涉及策略版本
... 其它参数默认值见../../03-Variable/PolicyObjectDefault.txt
... 多个策略处理
[Arguments] ${returnData} ${policyList} ${opAction} ${policyObjectVersion}
Log To Console Call PolicyListDataOperation
${policyListJson} Set Variable [
FOR ${policy} IN @{policyList}
@@ -65,33 +65,29 @@ PolicyListDataOperation
[Return] ${json}
PolicyDataOperation
[Documentation]
... 描述入口opAction参数可为'add','update','disable','enable'
[Arguments] ${returnData} ${policy} ${opAction} ${policyObjectVersion}
[Documentation] 描述入口opAction参数可为'add','update','disable','enable'
... 参数returnData: 必传,是否返回请求数据。可选${0}(不返回)/${1}(返回)。
... policy: 必传,字典类型。字典内可选参数信息:
... policyObjectVersion: 必传v1,v2,涉及策略版本
... 其它参数默认值见../../03-Variable/PolicyObjectDefault.txt
... 单个策略处理
[Arguments] ${returnData} ${policy} ${opAction} ${policyObjectVersion}
Log To Console Call PolicyDataOperation
${json} PolicyOrganize ${policy} ${opAction} ${policyObjectVersion}
# 转为json结构并返回
${dict} Create Dictionary opAction=${opAction} returnData=${returnData} policyList=replace:policyList
${bodyJson} json.Dumps ${dict} ensure_ascii=False
${json} Replace String ${bodyJson} "replace:policyList" ${json}
Log Policy_Request_Body-${json}
[Return] ${json}
PolicyOrganize
[Documentation]
... 描述入口opAction参数可为'add','update','disable','enable'
[Arguments] ${policy} ${opAction} ${policyObjectVersion}
[Documentation] 描述入口opAction参数可为'add','update','disable','enable'
... policy: 必传,字典类型。字典内可选参数信息:
... 其它参数默认值见../../03-Variable/PolicyObjectDefault.txt
... policyObjectVersion: 必传v1,v2,涉及策略版本
... 单个策略转换为json
[Arguments] ${policy} ${opAction} ${policyObjectVersion}
Log To Console Call PolicyOrganize
${returnDict} Create Dictionary
${emptyList} Create List
@@ -100,7 +96,6 @@ PolicyOrganize
Run Keyword If "${policyObjectVersion}"=="v1" Dictionary Should Not Contain Key ${policy} destination
Run Keyword If "${policyObjectVersion}"=="v1" Dictionary Should Not Contain Key ${policy} filterList
Run Keyword If "${policyObjectVersion}"=="v1" Dictionary Should Not Contain Key ${policy} appIdObjects
Run Keyword If "${policyObjectVersion}"=="v2" Dictionary Should Not Contain Key ${policy} referenceObject
Run Keyword If "${policyObjectVersion}"=="v2" Dictionary Should Not Contain Key ${policy} appObjectIdArray
#更新时 policyId不允许为空
@@ -114,24 +109,19 @@ PolicyOrganize
${policyId} Run Keyword If "${opAction}"=="add" Set Variable ${EMPTY}
... ELSE Get From Dictionary ${policy} policyId
Set To Dictionary ${returnDict} policyId=${policyId}
${return} ${policyType} Run Keyword And Ignore Error Get From Dictionary ${policy} policyType
Run Keyword If "${return}"=="FAIL" or "${policyType}"=="${EMPTY}" Set To Dictionary ${returnDict} policyType=${Default_PolicyType}
... ELSE Set To Dictionary ${returnDict} policyType=${policyType}
#enable disable直接返回json
Run Keyword And Return If "${opAction}"=="enable" or "${opAction}"=="disable" ManagePolicyEnableAndDisable ${returnDict} ${opAction}
# 取可选参数,为传入设置默认值
${return} ${policyName} Run Keyword And Ignore Error Get From Dictionary ${policy} policyName
Run Keyword If "${return}"=="FAIL" or "${policyName}"=="${EMPTY}" Set To Dictionary ${returnDict} policyName=${Default_PolicyName}
... ELSE Set To Dictionary ${returnDict} policyName=${policyName}
#policyDesc 不是必填的选项
${return} ${policyDesc} Run Keyword And Ignore Error Get From Dictionary ${policy} policyDesc
Run Keyword If "${return}"=="FAIL" or "${policyDesc}"=="${EMPTY}" Set To Dictionary ${returnDict} policyDesc=${Default_PolicyDesc}
... ELSE Set To Dictionary ${returnDict} policyDesc=${policyDesc}
${return} ${action} Run Keyword And Ignore Error Get From Dictionary ${policy} action
Run Keyword If "${return}"=="FAIL" or "${action}"=="${EMPTY}" Set To Dictionary ${returnDict} action=${Default_Action}
... ELSE Set To Dictionary ${returnDict} action=${action}
@@ -139,15 +129,12 @@ PolicyOrganize
${return} ${userTags} Run Keyword And Ignore Error Get From Dictionary ${policy} userTags
Run Keyword If "${return}"=="FAIL" or "${userTags}"=="${EMPTY}" Set To Dictionary ${returnDict} userTags=${Default_UserTags}
... ELSE Set To Dictionary ${returnDict} userTags=${userTags}
${return} ${doLog} Run Keyword And Ignore Error Get From Dictionary ${policy} doLog
Run Keyword If "${return}"=="FAIL" or "${doLog}"=="${EMPTY}" Set To Dictionary ${returnDict} doLog=${Default_DoLog}
... ELSE Set To Dictionary ${returnDict} doLog=${doLog}
${return} ${isValid} Run Keyword And Ignore Error Get From Dictionary ${policy} isValid
Run Keyword If "${return}"=="FAIL" or "${isValid}"=="${EMPTY}" Set To Dictionary ${returnDict} isValid=${Default_IsValid}
... ELSE Set To Dictionary ${returnDict} isValid=${isValid}
${return} ${scheduleId} Run Keyword And Ignore Error Get From Dictionary ${policy} scheduleId
${scheduleIdV} Run Keyword If "${return}"!="FAIL" and "${scheduleId}"!="${EMPTY}" and "${scheduleId}"!="${None}" Evaluate list(map(int, re.split('[,]', '${scheduleId}'))) re
... ELSE Set Variable ${emptyList}
@@ -158,13 +145,13 @@ PolicyOrganize
... ELSE Evaluate list(map(int, re.split('[,]', '${appObjectIdArray}'))) re
Run Keyword If "${policyObjectVersion}"=="v1" Set To Dictionary ${returnDict} appObjectIdArray=${appObjectIdArrayV}
... ELSE IF "${policyObjectVersion}"=="v2" Set To Dictionary ${returnDict} appIdObjects=${appObjectIdArrayV}
# 固定值
Set To Dictionary ${returnDict} doBlacklist=${0}
# 分别处理EffectiveRange、UserRegion和ReferenceObject参数
ProcessEffectiveRange ${policy} ${returnDict}
#WxManageUserRegion ${policy}
Run Keyword If "${policyObjectVersion}"=="v1" ProcessReferenceObject ${policy} ${returnDict} ELSE IF "${policyObjectVersion}"=="v2" ManageObjectV2 ${policy} ${returnDict}
Run Keyword If "${policyObjectVersion}"=="v1" ProcessReferenceObject ${policy} ${returnDict}
... ELSE IF "${policyObjectVersion}"=="v2" ManageObjectV2 ${policy} ${returnDict}
#先取出useragion 再放回json
${return} ${userRegion} Run Keyword And Ignore Error Get From Dictionary ${policy} userRegion
Set To Dictionary ${returnDict} userRegion=${Default_UserRegion}
@@ -180,41 +167,46 @@ PolicyOrganize
Run Keyword If "${policyObjectVersion}"=="v2" and "${policyType}"=="active_defence" Set To Dictionary ${returnDict} destination=${active_defence_emptyList}
Run Keyword If "${policyObjectVersion}"=="v2" and "${policyType}"=="active_defence" Set To Dictionary ${returnDict} filterList=${active_defence_emptyList}
Run Keyword If "${policyObjectVersion}"=="v2" and "${policyType}"=="active_defence" Set To Dictionary ${returnDict} appIdObjects=${active_defence_emptyList}
#针对WAN NAT特殊处理主动防御不应用对象
${wannat_emptyList} Create List
${return} ${policyType} Run Keyword And Ignore Error Get From Dictionary ${policy} policyType
Run Keyword If "${policyObjectVersion}"=="v2" and "${policyType}"=="wannat" Set To Dictionary ${returnDict} appIdObjects=${wannat_emptyList}
Run Keyword If "${policyObjectVersion}"=="v2" and "${policyType}"=="wannat" Set To Dictionary ${returnDict} filterList=${wannat_emptyList}
# 转为json结构并返回
${json} json.Dumps ${returnDict} ensure_ascii=False
${json} Replace String ${json} "method:rst" ${userRegion}
#${json} Replace String ${json} "effectiveRange:Empty" {}
Log Policy-${json}
[Return] ${json}
ManagePolicyEnableAndDisable
[Documentation]
... 启用与禁用时调用
[Arguments] ${returnDict} ${opAction}
[Documentation] 启用与禁用时调用
Run Keyword If "${opAction}"=="enable" Set To Dictionary ${returnDict} isValid=1
Run Keyword If "${opAction}"=="disable" Set To Dictionary ${returnDict} isValid=0
${json} json.Dumps ${returnDict} ensure_ascii=False
Log Policy-${json}
[Return] ${json}
ProcessEffectiveRange
[Documentation]
... 处理EffectiveRange
... 加入effectiveRange={}的处理支持
[Arguments] ${policyList} ${returnDict}
[Documentation] 处理EffectiveRange
... 加入effectiveRange={}的处理支持
Log To Console Call ProcessEffectiveRange
${emptyList} Create List
${emptyListDouble} Create List ${emptyList}
${return} ${effectiveRange} Run Keyword And Ignore Error Get From Dictionary ${policyList} effectiveRange
${effectiveRange} Run Keyword If "${return}"=="FAIL" or "${effectiveRange}"=="${EMPTY}" Set Variable ${Default_EffectiveRange}
... ELSE Set Variable ${effectiveRange}
${value} Run Keyword If "${effectiveRange}"=="${EMPTY}" Create Dictionary tag_sets=${emptyListDouble}
... ELSE IF "${effectiveRange}"=="{}" Create Dictionary ELSE AnalysisEffectiveRange ${effectiveRange}
... ELSE IF "${effectiveRange}"=="{}" Create Dictionary
... ELSE AnalysisEffectiveRange ${effectiveRange}
Set To Dictionary ${returnDict} effectiveRange=${value}
ProcessReferenceObject
[Documentation]
... 处理引用对象字符串
... v1版本接口使用
[Arguments] ${policy} ${returnDict}
[Documentation] 处理引用对象字符串
... v1版本接口使用
Log To Console Call ProcessReferenceObject
${emptyList} Create List
#默认客户端条件类型clientip or clientsubid
@@ -225,7 +217,6 @@ ProcessReferenceObject
Run Keyword If '${addTestClentIPFlag}'=='1' and '${defaultClient}'=='clientsubid' ManageClientSubIDObject ${emptyList}
#Run Keyword If '${addTestClentIPFlag}'=='1' ManageClientObject ${emptyList}
# Run Keyword If "${clientHostObj}"!="${None}" Append To List ${emptyList} ${clientHostObj}
${defaultObj} Create Dictionary
${return} ${referenceObject} Run Keyword And Ignore Error Get From Dictionary ${policy} referenceObject
${referenceObject} Run Keyword If "${return}"=="FAIL" or "${referenceObject}"=="${EMPTY}" Set Variable ${Default_ReferenceObject}
@@ -237,7 +228,6 @@ ProcessReferenceObject
# Run Keyword If ${var}!={} Append To List ${referenceObject} ${var}
# END
ObjectLoop ${value} ${emptyList}
Set To Dictionary ${returnDict} referenceObject=${emptyList}
ObjectLoop
@@ -247,19 +237,18 @@ ObjectLoop
Run Keyword If ${var}!={} Append To List ${valueList} ${var}
END
[Return] ${valueList}
ManageObjectV2
[Documentation]
... 处理引用对象字符串
[Arguments] ${policy} ${returnDict}
[Documentation] 处理引用对象字符串
... v2版本接口使用
... source,destination,filterList
# 处理引用对象字符串
[Arguments] ${policy} ${returnDict}
Log To Console Call ManageObjectV2
#默认客户端条件类型clientip or clientsubid
${return} ${defaultClient} Run Keyword And Ignore Error Get From Dictionary ${policy} defalutClient
${defaultClient} Run Keyword If "${return}"=="FAIL" or "${defaultClient}"=="${EMPTY}" Set Variable ${Default_Client_Type}
... ELSE Set Variable ${defaultClient}
${sourceList} Create List
${destinationList} Create List
${filterList} Create List
@@ -268,45 +257,44 @@ ManageObjectV2
AnalysisObjectV2 ${policy} source ${sourceList}
AnalysisObjectV2 ${policy} destination ${destinationList}
AnalysisObjectV2 ${policy} filterList ${filterList}
Set To Dictionary ${returnDict} source=${sourceList} destination=${destinationList} filterList=${filterList}
Log ${policy}
ManageClientIPObjectV2
[Arguments] ${emptyList}
# 增加引用测试终端IP策略对象
${obj1} Create Dictionary objectId=${testClentID} protocolField=TSG_SECURITY_SOURCE_ADDR
Append To List ${emptyList} ${obj1}
ManageClientSubIDObjectV2
[Arguments] ${emptyList}
# 增加引用测试终端IP策略对象
${protocolField} Set Variable
${obj1} Create Dictionary objectId=${testClentSubID} protocolField=${protocolField}
Append To List ${emptyList} ${obj1}
AnalysisObjectV2
[Arguments] ${policy} ${objectType} ${objList}
Log To Console Call AnalysisObjectV2
${policyObjectDefault} Run Keyword If "${objectType}"=="source" Set Variable ${EMPTY}
... ELSE IF "${objectType}"=="destination" Set Variable ${EMPTY}
... ELSE IF "${objectType}"=="filterList" Set Variable ${EMPTY}
${return} ${objectList} Run Keyword And Ignore Error Get From Dictionary ${policy} ${objectType}
# source,destination,filterList
${objectList} Run Keyword If "${return}"=="FAIL" or "${objectList}"=="${EMPTY}" Set Variable ${policyObjectDefault}
... ELSE Set Variable ${objectList}
${list} Evaluate re.split('[${arraySplitor}]', '${objectList}') re
FOR ${var} IN @{list}
${tempObj} Run Keyword If "${objectType}"=="filterList" and "${var}" != "" ManageFilter ${var}
... ELSE IF "${var}" != "" ManageObject ${var} ELSE Set Variable ${EMPTY}
... ELSE IF "${var}" != "" ManageObject ${var}
... ELSE Set Variable ${EMPTY}
Run Keyword If "${tempObj}" != "${EMPTY}" Append To List ${objList} ${tempObj}
END
Log ${objList}
ManageObject
[Documentation]
... source,destination处理
[Arguments] ${object}
[Documentation] source,destination处理
Log To Console Call ManageObject
${objectList} Create List
#截取objectId
@@ -319,10 +307,10 @@ ManageObject
Set To Dictionary ${tempObj} objectId=${objectId}
Set To Dictionary ${tempObj} protocolField=${protocolField}
[Return] ${tempObj}
ManageFilter
[Documentation]
... filterList处理
[Arguments] ${filter}
[Documentation] filterList处理
Log Call ManageFilter
${filterObjectList} Create List
#截取objectId
@@ -344,11 +332,9 @@ ManageFilter
[Return] ${filterObject}
Get-PolicyIds
[Documentation]
... 获取结果中的策略ID
[Arguments] ${value}
[Documentation] 获取结果中的策略ID
${policyIds} Create List
FOR ${policy} IN @{value['data']['policyList']}
#${policyIdList} Create List ${policy['policyId']}
#${policyObj} Create Dictionary policyType=${policy['policyType']} policyIds=${policyIdList}
@@ -359,21 +345,21 @@ Get-PolicyIds
${policyIds} Run Keyword If ${len}==1 Set Variable ${policyIds[0]}
... ELSE Set Variable ${policyIds}
[Return] ${policyIds}
DeletePolicyWithParamDict
[Documentation]
... 删除策略
[Arguments] ${params}
[Documentation] 删除策略
... params传入的删除字典
... 结构为policyIds=${policyIds} (List) policyType=${policyType} (variable)
[Arguments] ${params}
${response} BaseDeleteRequest /${version}${policyUrl} ${params}
${rescode} Set Variable ${response['code']}
Should Be Equal As Strings ${rescode} 200
[Return] ${rescode}
VerifyPolicyList
[Documentation]
... 策略验证
... 多个策略验证
[Arguments] ${verifyList}
[Documentation] 策略验证
... 多个策略验证
Log To Console Call VerifyPolicyList
${verifyListJson} Set Variable [
FOR ${verifyObj} IN @{verifyList}
@@ -383,11 +369,11 @@ VerifyPolicyList
${verifyListJson}= Replace String Using Regexp ${verifyListJson} ,$ ]
Log Policy_Request_Body-${verifyListJson}
[Return] ${verifyListJson}
VerifyPolicyObj
[Documentation]
... 策略验证
... 单个策略验证
[Arguments] ${verifyObj}
[Documentation] 策略验证
... 单个策略验证
Log To Console Call VerifyPolicyObj
${emptyList} Create List
${return} ${policyType} Run Keyword And Ignore Error Set Variable ${verifyObj['policyType']}
@@ -423,6 +409,7 @@ VerifyPolicyObj
${json} json.Dumps ${verifyObj} ensure_ascii=False
Log VerifyPolicy-${json}
[Return] ${json}
ManageIpAttributeValue
[Arguments] ${attributeValue} ${attributeName} ${type}
Run Keyword And Return If "${type}"=="str" ExtractIpAttributeValue ${attributeValue}
@@ -448,6 +435,7 @@ ManageIpAttributeValue
Run Keyword If "${tableName}"=="${EMPTY}" and "${attributeName}"=="destination" Should Not Be Empty ${tableName}
Set To Dictionary ${dict} tableName=${tableName}
[Return] ${dict}
ExtractIpAttributeValue
[Arguments] ${attributeValue}
${list} Split String ${attributeValue} |
@@ -456,8 +444,7 @@ ExtractIpAttributeValue
${addrType} Evaluate int(${list}[2])
${protocol} Set Variable ${list}[3]
${tableName} Set Variable ${list}[4]
${dict} Create Dictionary ip=${list}[0] port=${list}[1] tableName=${tableName}
... addrType=${addrType} protocol=${protocol}
${dict} Create Dictionary ip=${list}[0] port=${list}[1] tableName=${tableName} addrType=${addrType} protocol=${protocol}
[Return] ${dict}
ExtractIpAttributeValue_bak
@@ -467,9 +454,9 @@ ExtractIpAttributeValue_bak
Should Be Equal As Integers ${len} 4
${addrType} Evaluate int(${list}[2])
${protocol} Evaluate int(${list}[3])
${dict} Create Dictionary ip=${list}[0] port=${list}[1]
... addrType=${addrType} protocol=${protocol}
${dict} Create Dictionary ip=${list}[0] port=${list}[1] addrType=${addrType} protocol=${protocol}
[Return] ${dict}
ManageSignatureAttributeValue
[Arguments] ${attributeValue} ${type}
Run Keyword And Return If "${type}"=="str" ExtractSignatureAttributeValue ${attributeValue}
@@ -481,6 +468,7 @@ ManageSignatureAttributeValue
Should Not Be Empty ${string}
Set To Dictionary ${dict} string=${string}
[Return] ${dict}
ExtractSignatureAttributeValue
[Arguments] ${attributeValue}
${list} Split String ${attributeValue} |
@@ -488,6 +476,7 @@ ExtractSignatureAttributeValue
Should Be Equal As Integers ${len} 2
${dict} Create Dictionary district=${list}[0] string=${list}[1]
[Return] ${dict}
ManageStringAttributeValue
[Arguments] ${attributeValue} ${type}
${dict} Create Dictionary
@@ -496,11 +485,11 @@ ManageStringAttributeValue
Should Not Be Empty ${string}
Set To Dictionary ${dict} string=${string}
[Return] ${dict}
SortPolicyList
[Documentation]
... 多策略排序
... policyList为数组结构
[Arguments] ${policyList}
[Documentation] 多策略排序
... policyList为数组结构
Log Call SortPolicyList
${policyListJson} Set Variable [
FOR ${policyObj} IN @{policyList}
@@ -510,12 +499,12 @@ SortPolicyList
${policyListJson}= Replace String Using Regexp ${policyListJson} ,$ ]
Log SortPolicyList-${policyListJson}
[Return] ${policyListJson}
SortPolicyObject
[Documentation]
... 策略排序
[Arguments] ${policyObject}
[Documentation] 策略排序
... policyObject为字典结构
... policyObject policyId=${policyId} policyType=${policyType} beforePolicyId=${beforePolicyId} afterPolicyId=${afterPolicyId}
[Arguments] ${policyObject}
Dictionary Should Contain Key ${policyObject} policyId
Dictionary Should Contain Key ${policyObject} policyType
${policyId} Get From Dictionary ${policyObject} policyId
@@ -525,7 +514,6 @@ SortPolicyObject
${return} ${beforePolicyId} Run Keyword And Ignore Error Get From Dictionary ${policyObject} beforePolicyId
${return1} ${afterPolicyId} Run Keyword And Ignore Error Get From Dictionary ${policyObject} afterPolicyId
Run Keyword If "${return}"=="FAIL" and "${return1}"=="FAIL" Fail beforePolicyId和 afterPolicyId必须设置一个
Run Keyword If "${return}"=="PASS" and "${return1}"=="PASS" and "${beforePolicyId}"=="${EMPTY}" and "${afterPolicyId}"=="${EMPTY}"
... Fail beforePolicyId和 afterPolicyId不能同时为空
Run Keyword If "${return}"=="PASS" and "${return1}"=="PASS" and "${beforePolicyId}"=="${EMPTY}" and "${afterPolicyId}"=="${EMPTY}" Fail beforePolicyId和 afterPolicyId不能同时为空
${json} json.Dumps ${policyObject} ensure_ascii=False
[Return] ${json}

View File

@@ -1 +1 @@
curl -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 'https://www.baidu.com/' https://www.motel6.com/#/home | iconv -f utf-8 -t gbk
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 'https://www.baidu.com/' https://boutiquehotel.me/paris/ | iconv -f utf-8 -t gbk

View File

@@ -1 +1 @@
curl -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" --cookie "__cfduid=d5c21129d57e7124b729fd86dc82abdcd1596020306; __stripe_sid=2940d4d5-6822-4daf-8b38-9cd18d745beb; __stripe_mid=dd118cd8-845c-4b6e-98ce-81e8d5bdd52c" --referer 'https://www.baidu.com/' \ https://www.sutori.com/teachers | iconv -f utf-8 -t gbk
curl -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" --cookie "__cfduid=d5c21129d57e7124b729fd86dc82abdcd1596020306; __stripe_sid=2940d4d5-6822-4daf-8b38-9cd18d745beb; __stripe_mid=dd118cd8-845c-4b6e-98ce-81e8d5bdd52c" --referer 'https://www.baidu.com/' \ https://www.orbitz.com/Flights | iconv -f utf-8 -t gbk

View File

@@ -1 +1 @@
curl http://www.essence.com.cn/business/fixed | iconv -f utf-8 -t gbk
curl -kv http://www.essence.com.cn/business/fixed | iconv -f utf-8 -t gbk

View File

@@ -1 +1 @@
curl http://www.west95582.com/jdw/index.html | iconv -f utf-8 -t gbk
curl -kv http://www.west95582.com/jdw/index.html | iconv -f utf-8 -t gbk

View File

@@ -1 +1 @@
curl http://www.hazq.com/main/aboutus/index.shtml | iconv -f utf-8 -t gbk
curl -kv http://www.hazq.com/main/aboutus/index.shtml | iconv -f utf-8 -t gbk

View File

@@ -1 +1 @@
curl http://www.cs.ecitic.com/newsite/business/bank/tzyh_ywjs/| iconv -f utf-8 -t gbk
curl -kv http://www.cs.ecitic.com/newsite/business/bank/tzyh_ywjs/| iconv -f utf-8 -t gbk

View File

@@ -1 +1 @@
curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=lksdf&setCookie=kjhsxbn&contentType=content-type&resBody=opijn" http://open.node.com/action | iconv -f utf-8 -t gbk
curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=lksdf&setCookie=kjhsxbn&contentType=content-type&resBody=opijn" -kv http://open.node.com/action | iconv -f utf-8 -t gbk

View File

@@ -1 +1 @@
curl http://www.ghzq.com.cn/ghzq/index.html | iconv -f utf-8 -t gbk
curl -kv http://www.ghzq.com.cn/ghzq/index.html | iconv -f utf-8 -t gbk

View File

@@ -1 +1 @@
curl http://www.zts.com.cn/consult/consult.aspx| iconv -f utf-8 -t gbk
curl -kv http://www.zts.com.cn/consult/consult.aspx| iconv -f utf-8 -t gbk

View File

@@ -1 +1 @@
curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=hello&setCookie=hjbnm&contentType=content-type&resBody=05691" -kv http://open.node.com/action | iconv -f utf-8 -t gbk
curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=hello&setCookie=hjbnm&contentType=text/html&resBody=05691" -kv http://open.node.com/action | iconv -f utf-8 -t gbk

View File

@@ -1 +1 @@
curl http://www.shfe.com.cn/products/au/ | iconv -f utf-8 -t gbk
curl -kv http://www.shfe.com.cn/products/au/ | iconv -f utf-8 -t gbk