1 Commits

Author SHA1 Message Date
朱明明
7bdf2695e1 修改ftp返回 2020-04-16 17:41:31 +08:00
962 changed files with 29633 additions and 124556 deletions

View File

@@ -1,65 +0,0 @@
stages:
- develop #运行的类型,有
- developagain
wp: #随意填写起标示作用wp指全流程测试
stage: develop #和上述的类型对应
only:
- develop #指定触发分支
tags:
- "155auto"
script:
- pwd
- docker stop auto-custom-clibrary-wp || true && docker rm auto-custom-clibrary-wp || true
- cd docker/wp
- docker-compose build
- time=`date +%m%d` docker-compose up -d
com: #随意填写起标示作用com指cli测试
stage: develop #和上述的类型对应
only:
- develop #指定触发分支
tags:
- "155auto"
script:
- pwd
- docker stop auto-custom-clibrary-com || true && docker rm auto-custom-clibrary-com || true
- cd docker/com
- docker-compose build
- time=`date +%m%d` docker-compose up -d
156wp: #随意填写,起标示作用
stage: developagain #和上述的类型对应
only:
- wwww #指定触发分支
tags:
- "156auto"
script:
- pwd
- docker stop auto-custom-clibrary-wp || true && docker rm auto-custom-clibrary-wp || true
- cd docker/wp
- docker-compose build
- time=`date +%m%d` docker-compose up -d
156com: #随意填写,起标示作用
stage: developagain #和上述的类型对应
only:
- eeee #指定触发分支
tags:
- "156auto"
script:
- pwd
- docker stop auto-custom-clibrary-com || true && docker rm auto-custom-clibrary-com || true
- cd docker/com
- docker-compose build
- time=`date +%m%d` docker-compose up -d

View File

@@ -1,81 +0,0 @@
*** Settings ***
Documentation snat运行需要先运行a然后将连接vpn后运行b和c
Test Teardown DeletePolicyAndObjectAndIPpoor ${policyIds} ${wan_ippoor}
Force Tags wan_nat
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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../05-Other/AllFlowCaseVariable.txt
Resource ../../../02-Keyword/tsg_common/StmpHandle.robot
Library Custometest
Library SSHLibrary
*** Variables ***
${policyIds} ${EMPTY}
${wan_ippoor} ${EMPTY}
*** Test Cases ***
a_wan_nat-snat-00001
[Tags] Never+IP Pools内单个IP
${must_parameter} Create Dictionary profileName=jwctest profileId=
${iplist1} Create Dictionary ip=192.168.50.7 relative_location=internal link_info={"link_id":123,"src_mac":321}
${wan_nat_ip_iplist} Create List ${iplist1}
${WanNatIpPood} Add&EditWanIpPood ${must_parameter} ${wan_nat_ip_iplist}
log ${WanNatIpPood}
Comment 创建snat策略
${policyDict} Create Dictionary policyName=wan_nat_snat-00001 policyType=wannat policyDesc=autotest action=wannat userRegion={"method":"snat","snat_ip_pool_profile_id":[${WanNatIpPood}],"snat_vpn_user_account":"${vpn}","connection_timeout":"5","ip_select_option":{"snat_algorithm":"random","time":"","count":""}} isValid=${1}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 ip ${WanNatIpPood}
insert_policyId_to_file1 policyId2 ${policyId2}
b_wan_nat-snat-00001
[Documentation] b_wan_nat-snat-00001需和b_wan_nat-snat-00001_1同时执行
[Tags] Never+IP Pools内单个IP
Comment 功能端验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/wan_nat_sant_00001.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 一号店
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/wan_nat_sant_00002.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 北京租房网
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup vip.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 183.6.216.41
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证
${FTP} FTP_login ftp://192.168.100.5/stamp.txt -u"ftp_user:qazXSW@edc" Shandong Province
should contain ${FTP} ftp_success
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable 13103304145@163.com
${邮箱密码} Set Variable jwc0409.
${邮件主题} Set Variable 123123132
${发送者} Set Variable 13103304145@163.com
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["nqgjs6@163.com"]
${抄送者} Set Variable ["nqgjs6@163.com"]
${密送者} Set Variable ["nqgjs6@163.com"]
${邮件正文} Set Variable zzzzzzz
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
should contain ${发送邮件返回结果} mail_success
b_wan_nat-snat-00001_1
Open Connection 192.168.40.156
SSHLibrary.Login root Xxg-PUB<>90
Write tcpdump -n -nn -i ppp0 |grep 192.168.50.7
${output} read delay=1s
Should Contain ${output} 192.168.50.7.52640 > 10.10.120.250.80
Should Contain ${output} 10.10.120.250.80 > 192.168.50.7.52640
c_wan_nat-snat-00001
[Tags] Never+IP Pools内单个IP
${policyIds} Create List {"policyType":"wannat","policyIds":[${policyId2}]}
${wan_ippoor} Create List ${ip}

View File

@@ -1,92 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndIPpoor ${policyIds} ${wan_ippoor}
Force Tags wan_nat
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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../05-Other/AllFlowCaseVariable.txt
Resource ../../../02-Keyword/tsg_common/StmpHandle.robot
Library Custometest
Library SSHLibrary
*** Variables ***
${policyIds} ${EMPTY}
${wan_ippoor} ${EMPTY}
*** Test Cases ***
a_wan_nat-snat-00002
[Tags] Never+IP Pools内多个IP
Comment 创建ip1
${must_parameter} Create Dictionary profileName=jwctest profileId=
${iplist1} Create Dictionary ip=192.168.50.7 relative_location=internal link_info={"link_id":123,"src_mac":321}
${wan_nat_ip_iplist} Create List ${iplist1}
${ip1} Add&EditWanIpPood ${must_parameter} ${wan_nat_ip_iplist}
Comment 创建ip1
${must_parameter} Create Dictionary profileName=jwctest-1 profileId=
${iplist1} Create Dictionary ip=192.168.50.8 relative_location=internal link_info={"link_id":123,"src_mac":321}
${wan_nat_ip_iplist} Create List ${iplist1}
${ip2} Add&EditWanIpPood ${must_parameter} ${wan_nat_ip_iplist}
Comment 创建ip1
${must_parameter} Create Dictionary profileName=jwctest-2 profileId=
${iplist1} Create Dictionary ip=192.168.50.9 relative_location=internal link_info={"link_id":123,"src_mac":321}
${wan_nat_ip_iplist} Create List ${iplist1}
${ip3} Add&EditWanIpPood ${must_parameter} ${wan_nat_ip_iplist}
Comment 创建snat策略
${policyDict} Create Dictionary policyName=wan_nat_snat-00002 policyType=wannat policyDesc=autotest action=wannat userRegion={"method":"snat","snat_ip_pool_profile_id":[${ip1},${ip2},${ip3}],"snat_vpn_user_account":"user-1","connection_timeout":"5","ip_select_option":{"snat_algorithm":"random","time":"","count":""}} isValid=${1}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 ip1 ${ip1}
insert_policyId_to_file1 ip2 ${ip2}
insert_policyId_to_file1 ip3 ${ip3}
insert_policyId_to_file1 snat3 ${policyId2}
b_wan_nat-snat-00002
[Documentation] b_wan_nat-snat-00002需和b_wan_nat-snat-00002_1同时执行
[Tags] Never+IP Pools内单个IP
Comment 功能端验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/wan_nat_sant_00001.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 一号店
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/wan_nat_sant_00002.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 北京租房网
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup vip.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 183.6.216.41
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证
${FTP} FTP_login ftp://192.168.100.5/stamp.txt -u"ftp_user:qazXSW@edc" Shandong Province
should contain ${FTP} ftp_success
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable 13103304145@163.com
${邮箱密码} Set Variable jwc0409.
${邮件主题} Set Variable 123123132
${发送者} Set Variable 13103304145@163.com
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["nqgjs6@163.com"]
${抄送者} Set Variable ["nqgjs6@163.com"]
${密送者} Set Variable ["nqgjs6@163.com"]
${邮件正文} Set Variable zzzzzzz
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
should contain ${发送邮件返回结果} mail_success
b_wan_nat-snat-00002_1
Open Connection 192.168.40.156
SSHLibrary.Login root Xxg-PUB<>90
Write tcpdump -n -nn -i ppp0 |grep 192.168.50.7
${output} read delay=1s
Should Contain ${output} 192.168.50.7.52640 > 10.10.120.250.80
Should Contain ${output} 10.10.120.250.80 > 192.168.50.7.52640
c_wan_nat-snat-00002
[Tags] Never+IP Pools内单个IP
${policyIds} Create List {"policyType":"wannat","policyIds":[${snat3}]}
${wan_ippoor} Create List ${ip1} ${ip2} ${ip3}

View File

@@ -1,62 +0,0 @@
*** Settings ***
Force Tags wan_nat
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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
*** Test Cases ***
wan_nat-dnat-00001
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=219.157.114.43/24 port=0-0 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建dnat策略
${policyDict} Create Dictionary policyName=wan_nat_dnat-00001 policyType=wannat policyDesc=autotest action=wannat userRegion={"method":"dnat","dnat_vpn_user_account":"44.8","dnat_destination_port":80,"dnat_when_vpn_offline":"drop"} isValid=${1} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 dnat_objectId ${objectId}
insert_policyId_to_file1 dnat_policyId ${policyId2}
wan_nat-dnat-00002
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=220.194.214.86-220.194.214.86 port=0-0 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建dnat策略
${policyDict} Create Dictionary policyName=wan_nat_dnat-00002 policyType=wannat policyDesc=autotest action=wannat userRegion={"method":"dnat","dnat_vpn_user_account":"jwc-vpn","dnat_destination_port":8001,"dnat_when_vpn_offline":"forward"} isValid=${1} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 dnat_objectId1 ${objectId}
insert_policyId_to_file1 dnat_policyId1 ${policyId2}
wan_nat-dnat-00003
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=182.92.25.74-182.92.25.74 port=0-0 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建dnat策略
${policyDict} Create Dictionary policyName=wan_nat_dnat-00003 policyType=wannat policyDesc=autotest action=wannat userRegion={"method":"dnat","dnat_vpn_user_account":"jwc-vpn","dnat_destination_port":8001,"dnat_when_vpn_offline":"forward"} isValid=${1} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 dnat_objectId2 ${objectId}
insert_policyId_to_file1 dnat_policyId2 ${policyId2}
wan_nat-dnat-00004
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=112.81.159.16-112.81.159.16 port=0-0 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建dnat策略
${policyDict} Create Dictionary policyName=wan_nat_dnat-00004 policyType=wannat policyDesc=autotest action=wannat userRegion={"method":"dnat","dnat_vpn_user_account":"jwc-vpn","dnat_destination_port":8111,"dnat_when_vpn_offline":"forward"} isValid=${1} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 dnat_objectId3 ${objectId}
insert_policyId_to_file1 dnat_policyId3 ${policyId2}

View File

@@ -1,40 +0,0 @@
*** Settings ***
Documentation b_Dnat_Tests需和b_Dnat_Tests_1同时执行
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
Library Custometest
*** Test Cases ***
wan_nat-dnat-00001
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/wan_nat_dant_00001.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List Welcome to nginx HTTP!
... ELSE Create List Welcome to nginx HTTP!
${rescode} SystemCommands ${commandstr} ${stringlist}
wan_nat-dnat-00002
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/wan_nat_dant_00002.bat
... ELSE set variable curl 220.194.214.86
${stringlist} run keyword if '${systemType}'=='Windows' Create List Welcome to nginx HTTP!
... ELSE Create List Welcome to nginx HTTP!
${rescode} SystemCommands ${commandstr} ${stringlist}
wan_nat-dnat-00003
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/wan_nat_dant_00003.bat
... ELSE set variable curl 182.92.25.74
${stringlist} run keyword if '${systemType}'=='Windows' Create List Welcome to nginx HTTP!
... ELSE Create List Welcome to nginx HTTP!
${rescode} SystemCommands ${commandstr} ${stringlist}
wan_nat-dnat-00004
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/wan_nat_dant_00004.bat
... ELSE set variable curl 112.81.159.16
${stringlist} run keyword if '${systemType}'=='Windows' Create List Welcome to nginx HTTP!
... ELSE Create List Welcome to nginx HTTP!
${rescode} SystemCommands ${commandstr} ${stringlist}

View File

@@ -1,41 +0,0 @@
*** Settings ***
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
Library Custometest
Library SSHLibrary
*** Test Cases ***
wan_nat-dnat-00001
Open Connection 192.168.40.156
SSHLibrary.Login root Xxg-PUB<>90
Write tcpdump -n -nn -i ppp0 |grep 192.168.50.7
${output} read delay=1s
Should Contain ${output} 192.168.50.7.52640 > 10.10.120.250.80
Should Contain ${output} 10.10.120.250.80 > 192.168.50.7.52640
wan_nat-dnat-00002
Open Connection 192.168.40.156
SSHLibrary.Login root Xxg-PUB<>90
Write tcpdump -n -nn -i ppp0 |grep 192.168.50.7
${output} read delay=1s
Should Contain ${output} 192.168.50.7.52640 > 10.10.120.250.80
Should Contain ${output} 10.10.120.250.80 > 192.168.50.7.52640
wan_nat-dnat-00003
Open Connection 192.168.40.156
SSHLibrary.Login root Xxg-PUB<>90
Write tcpdump -n -nn -i ppp0 |grep 192.168.50.7
${output} read delay=1s
Should Contain ${output} 192.168.50.7.52640 > 10.10.120.250.80
Should Contain ${output} 10.10.120.250.80 > 192.168.50.7.52640
wan_nat-dnat-00004
Open Connection 192.168.40.156
SSHLibrary.Login root Xxg-PUB<>90
Write tcpdump -n -nn -i ppp0 |grep 192.168.50.7
${output} read delay=1s
Should Contain ${output} 192.168.50.7.52640 > 10.10.120.250.80
Should Contain ${output} 10.10.120.250.80 > 192.168.50.7.52640

View File

@@ -1,38 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../05-Other/AllFlowCaseVariable.txt
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../05-Other/AllFlowCaseVariable1.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
wan_nat-dnat-00001
#删除对象
${objectids} set Variable ${dnat_objectId}
#删除策略
${policyIds} Create List {"policyType":"wannat","policyIds":[${dnat_policyId}]}
wan_nat-dnat-00002
#删除对象
${objectids} set Variable ${dnat_objectId1}
#删除策略
${policyIds} Create List {"policyType":"wannat","policyIds":[${dnat_policyId1}]}
wan_nat-dnat-00003
#删除对象
${objectids} set Variable ${dnat_objectId2}
#删除策略
${policyIds} Create List {"policyType":"wannat","policyIds":[${dnat_policyId2}]}
wan_nat-dnat-00004
#删除对象
${objectids} set Variable ${dnat_objectId3}
#删除策略
${policyIds} Create List {"policyType":"wannat","policyIds":[${dnat_policyId3}]}

View File

@@ -1,608 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids} policyids1=${policyIds1}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Allow-00001
[Tags] Allow IP HTTP
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"allow","protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00001.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_allow_00001_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 皮皮虾下载 Tango Secure Gateway CA
... ELSE Create List 皮皮虾下载 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host http_url
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-allow-00002
[Tags] Allow IP HTTP HOST
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$mp.pipix.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "mp.pipix.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${fqdn}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00001.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_allow_00001_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 皮皮虾下载 Tango Secure Gateway CA
... ELSE Create List 皮皮虾下载 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host mp.pipix.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-allow-00003
[Tags] Allow IP HTTP URL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=$znakitaro.ru/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "znakitaro.ru/"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00003_1.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_allow_00003_1L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List Тайные Tango Secure Gateway CA
... ELSE Create List Новости Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host znakitaro.ru
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Allow-00004
[Tags] Allow IP HTTP User-Agent
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${req_hdr_ua}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.hao123.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 上网从这里开始 Tango Secure Gateway CA
... ELSE Create List 上网从这里开始 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host hao123
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Allow-00005
[Tags] Allow IP HTTP Content-Type
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=*html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${res_hdr_ct}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00008.bat
... ELSE set variable curl http://www.sse.com.cn/market/overview/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 上海证券交易所
... ELSE Create List 上海证券交易所
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host sse.com.cn
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Allow-00006
[Tags] Allow IP HTTP Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=lQfQ_2132 isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${req_hdr_ck1} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "lQfQ_2132","district": "Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${req_hdr_ck1}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00012.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_allow_00012_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List Object moved Tango Secure Gateway CA
... ELSE Create List Object moved Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.virtuoso.com
Should Be Equal As Strings ${returnvalue} true
roxyPolicy-Allow-00007
[Tags] Allow IP HTTP Set-Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=pll_language=ru* isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "pll_language=ru","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${res_hdr_sc}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00013.bat
... ELSE set variable curl -kv https://russia.payu.com/orange-data/
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00013.bat
... ELSE set variable curl -kv https://russia.payu.com/orange-data/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Интернет Tango Secure Gateway CA
... ELSE Create List Интернет Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host russia.payu.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Allow-00008
[Tags] Allow IP HTTP HOST+URL+User-Agent+Content-Type+Cookie+Set-Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.orbitz.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*Flights isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=charset isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=__stripe_sid isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId5} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId5}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=Domain=.orbitz.com isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId6} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId6}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR,${objectId5}|TSG_FIELD_HTTP_REQ_HDR,${objectId6}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "www.orbitz.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.orbitz.com/Flights"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "charset=text","district": "Content-Type"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0fsfwhh","district": "User-Agent"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "__stripe_sidafdsvxvx","district": "Cookie"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "afsf123Domain=.orbitz.com","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct} ${req_hdr_ua} ${req_hdr_ck} ${res_hdr_sc}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${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 www.orbitz.com Tango Secure Gateway CA
... ELSE Create List www.orbitz.com Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.orbitz.com
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,879 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids} policyids1=${policyIds1} url=${url} profiledId=${profiledId}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /v1/policy/profile/responsepages
${profiledId} ${EMPTY}
*** Test Cases ***
ProxyPolicy-deny-00001
[Tags] Deny IP HTTP
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"block","message":"重新开始","code":403,"protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00001.bat
... ELSE set variable curl -kv \ https://newsela.com/about/content/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 重新开始 Tango Secure Gateway CA
... ELSE Create List 重新开始 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host http_url
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-deny-http-00002
[Tags] Deny IP HTTP HOST
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*kingidentity.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment #创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404english.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"block","html_profile":${profiledId},"code":403,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "kingidentity.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${fqdn}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00002.bat
... ELSE set variable curl -kv \ \ https://kingidentity.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable Tango Secure Gateway CA
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host kingidentity.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-deny-00003
[Tags] Deny IP HTTP URL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=creativetravelgroup.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment #创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404english.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"block","html_profile":${profiledId},"code":403,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "creativetravelgroup.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00003_1.bat
... ELSE set variable curl -kv \ https://creativetravelgroup.com/
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00003_1.bat
... ELSE set variable curl -kv \ https://creativetravelgroup.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List head404 Tango Secure Gateway CA
... ELSE Create List head404 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host creativetravelgroup.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-deny-00004
[Tags] Deny IP HTTP User-Agent
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"block","message":"qwertyuiop","code":404,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${req_hdr_ua}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.usdebtclock.org/state-debt-clocks/state-of-california-debt-clock.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List qwertyuiop Tango Secure Gateway CA
... ELSE Create List qwertyuiop Tango Secure Gateway CA
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.usdebtclock.org/state-debt-clocks/state-of-california-debt-clock.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List qwertyuiop Tango Secure Gateway CA
... ELSE Create List qwertyuiop Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.usdebtclock.org
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-deny-0005
[Tags] Deny IP HTTP Content-Type
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=*utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"block","html_profile":${profiledId},"code":451,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "utf-8","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${res_hdr_ct}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00008.bat
... ELSE set variable curl http://www.6renyou.com/user_comment/index
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.6renyou.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-deny-00006
[Tags] Deny IP HTTP Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=saltkey isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"block","message":"123456789","code":404,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "saltkey","district": "Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${req_hdr_ck}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00012.bat
... ELSE set variable curl -kv --cookie "lQfQ_2132_saltkey=t8WY1oPe; lQfQ_2132_lastvisit=1595381790; lQfQ_2132_sid=vqXOg6; lQfQ_2132_lastact=1595385400%09forum.php%09image" --referer 'https://www.baidu.com/' \ https://www.youqulu.com/category/zixun
${stringlist} run keyword if '${systemType}'=='Windows' Create List 123456789 Tango Secure Gateway CA
... ELSE Create List 123456789 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.youqulu.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-deny-00007
[Tags] Deny IP HTTP Set-Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=irkzadmin_session* isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"block","message":"一直相信","code":403,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "irkzadmin_session","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${res_hdr_sc}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00013_3.bat
... ELSE set variable curl -kv \ https://nationalbank.kz/?switch=kazakh
${stringlist} run keyword if '${systemType}'=='Windows' Create List 一直相信 Tango Secure Gateway CA
... ELSE Create List 一直相信 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host nationalbank.kz
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-deny-00008
[Tags] Deny IP HTTP Request Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Request Content
${addItemList1} Create Dictionary keywordArray=ProxydenyTest001401 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"block","message":"涨涨涨涨","code":404,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${req_body} Create Dictionary attributeType=string attributeName=req_body appId=67 appName=http protocol=http attributeValue={"string": "ProxydenyTest001401"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${req_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00014.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=1234567&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection was reset
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host open.node.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-deny-00009
[Tags] Deny IP HTTP Response Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Response Content
${addItemList1} Create Dictionary keywordArray=NOFOLLOW isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"block","message":"涨涨涨涨","code":404,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${res_body} Create Dictionary attributeType=string attributeName=res_body appId=67 appName=http protocol=http attributeValue={"string": "NOFOLLOW"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${res_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00017.bat
... ELSE set variable curl -kv --cookie "test%20cookie=null; timezoneoffset=-480; ASP.NET_SessionId=sta2b3gxpxzqei3by1ka3qsa; visid_incap_1010467=Iu/pLzeoTnGn2VDjWdP9GpoBGF8AAAAAQUIPAAAAAADzSLZtZ1tZ/Rbjfct3Nq69" --referer 'https://www.baidu.com/' \ https://www.umusicpub.com/au/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.umusicpub.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-deny-00010
[Tags] Deny IP HTTP 最大组合1
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.umusicpub.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=sicpub.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=timezoneoffset isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=Domain=.umusicpub.com isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment Response Content
${addItemList1} Create Dictionary keywordArray=NOFOLLOW isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId5} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId5}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"block","message":"涨涨涨涨","code":404,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR,${objectId5}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "www.umusicpub.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.umusicpub.com/au/"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "timezoneoffset","district": "Cookie"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "Domain=.umusicpub.com","district": "Set-Cookie"}
${res_body} Create Dictionary attributeType=string attributeName=res_body appId=67 appName=http protocol=http attributeValue={"string": "NOFOLLOW"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${fqdn} ${url1} ${req_hdr_ck} ${res_hdr_sc} ${res_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00017.bat
... ELSE set variable curl -kv --cookie "test%20cookie=null; timezoneoffset=-480; ASP.NET_SessionId=sta2b3gxpxzqei3by1ka3qsa; visid_incap_1010467=Iu/pLzeoTnGn2VDjWdP9GpoBGF8AAAAAQUIPAAAAAADzSLZtZ1tZ/Rbjfct3Nq69" --referer 'https://www.baidu.com/' \ https://www.umusicpub.com/au/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.umusicpub.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-deny-00011
[Tags] Deny IP HTTP 最大组合2
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=open isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=charset isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment Request Content
${addItemList1} Create Dictionary keywordArray=ProxyDenyTest0017 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId5} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId5}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"block","message":"涨涨涨涨","code":404,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR,${objectId5}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "open.node.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "open.node.com"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0","district": "User-Agent"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "charset","district": "Content-Type"}
${req_body} Create Dictionary attributeType=string attributeName=req_body appId=67 appName=http protocol=http attributeValue={"string": "ProxyDenyTest0017"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${fqdn} ${url1} ${req_hdr_ua} ${res_hdr_ct} ${req_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00016.bat
... ELSE set variable curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{"requestbody":"ProxyDenyTest0017","setcook":"asdf","contenttype": "content-type","responsebody": "adzx"}" -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' http://open.node.com:180/go
${stringlist} run keyword if '${systemType}'=='Windows' Create List 涨涨涨涨
... ELSE Create List 涨涨涨涨
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host open.node.com
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,713 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids} policyids1=${policyIds1} url=${url} profiledId=${profiledId}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /v1/policy/profile/hijackfiles
${profiledId} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Hijack-00001
[Tags] Hijack IP HTTP URL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=or.tv/news isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test.apk hijack {"isValid":1,"contentType":"application/vnd.android.package-archive","opAction":"add","profileName":"test1","contentName":"Create-Hijack Files-test.apk","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Hijack策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "vator.tv/news"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00001.bat
... ELSE set variable curl -kv https://vator.tv/news
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00001.bat
... ELSE set variable curl -kv https://vator.tv/news
${stringlist} run keyword if '${systemType}'=='Windows' Create List 6b72:f91d:6f81:bfcd:5b0f:e81d:f827:e075 Tango Secure Gateway CA
... ELSE Create List 6b72:f91d:6f81:bfcd:5b0f:e81d:f827:e075 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host vator.tv
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Hijack-00002
[Tags] Hijack IP HTTP URL Host
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=www.lexus.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.lexus.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-1.exe hijack {"isValid":1,"contentType":"application/x-msdos-program","opAction":"add","profileName":"test2","contentName":"Create-Hijack Files-test-1.exe","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Hijack策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.lexus.ru/"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "www.lexus.ru"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${fqdn}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00003.bat
... ELSE set variable curl -kv https://www.lexus.ru/
${stringlist} run keyword if '${systemType}'=='Windows' Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
... ELSE Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.lexus.ru
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Hijack-00003
[Tags] Hijack IP HTTP URL User-Agent
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=channel/dianying/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-5.png hijack {"isValid":1,"contentType":"image/png","opAction":"add","profileName":"test4","contentName":"Create-Hijack Files-test-5.png","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Hijack策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.ixigua.com/channel/dianying/"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${req_hdr_ua}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00005.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_hijack_00005_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List Files-test-5.png Tango Secure Gateway CA
... ELSE Create List Files-test-5.png Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.ixigua.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Hijack-00004
[Tags] Hijack IP HTTP URL Content-Type
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=/eng/start/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=text* isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-1.exe hijack {"isValid":1,"contentType":"application/x-msdos-program","opAction":"add","profileName":"test2","contentName":"Create-Hijack Files-test-1.exe","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Hijack策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.airwargame.com/eng/start/"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "text","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${res_hdr_ct}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00011.bat
... ELSE set variable curl http://www.airwargame.com/eng/start/
${stringlist} run keyword if '${systemType}'=='Windows' Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac
... ELSE Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.airwargame.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Hijack-00005
[Tags] Hijack IP HTTP URL Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=corporates/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=saltkey isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-5.png hijack {"isValid":1,"contentType":"image/png","opAction":"add","profileName":"test4","contentName":"Create-Hijack Files-test-5.png","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Hijack策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.reval.com/corporates/"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "saltkey","district": "Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${req_hdr_ck}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00012.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_hijack_00012_L.bat
sleep 3
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00012.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_hijack_00012_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List bFiles-test-5.png Tango Secure Gateway CA
... ELSE Create List bFiles-test-5.png Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.reval.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Hijack-00006
[Tags] Hijack IP HTTP URL Set-Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=nsscreencast isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=_nsscreencast_session_ isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-4.jpeg hijack {"isValid":1,"contentType":"image/jpeg","opAction":"add","profileName":"test5","contentName":"Create-Hijack Files-test-4.jpeg","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Hijack策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "nsscreencast.com/episodes"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "_nsscreencast_session_","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${res_hdr_sc}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00013.bat
... ELSE set variable curl -kv https://nsscreencast.com/episodes
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00013.bat
... ELSE set variable curl -kv https://nsscreencast.com/episodes
${stringlist} run keyword if '${systemType}'=='Windows' Create List test-4.jpeg Tango Secure Gateway CA
... ELSE Create List test-4.jpeg Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host nsscreencast.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Hijack-00007
[Tags] Hijack IP HTTP 最大组合1
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*intervalworld.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=intervalworld.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=__stripe_sid isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=Domain=.intervalworld.com isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-4.jpeg hijack {"isValid":1,"contentType":"image/jpeg","opAction":"add","profileName":"test5","contentName":"Create-Hijack Files-test-4.jpeg","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Hijack策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "www.intervalworld.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.intervalworld.com/web/my/home"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "__stripe_sidafdsvxvx","district": "Cookie"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "Domain=.intervalworld.com","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${res_hdr_sc} ${fqdn} ${req_hdr_ck}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_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.intervalworld.com/web/my/home
${stringlist} run keyword if '${systemType}'=='Windows' Create List test-4.jpeg Tango Secure Gateway CA
... ELSE Create List test-4.jpeg Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.intervalworld.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Hijack-00008
[Tags] Hijack IP HTTP 最大组合2
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*intervalworld.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=intervalworld.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=charset isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-4.jpeg hijack {"isValid":1,"contentType":"image/jpeg","opAction":"add","profileName":"test5","contentName":"Create-Hijack Files-test-4.jpeg","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Hijack策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "www.intervalworld.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.intervalworld.com/web/my/home"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "charset=text","district": "Content-Type"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0fsfwhh","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${res_hdr_ct} ${fqdn} ${req_hdr_ua}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_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.intervalworld.com/web/my/home
${stringlist} run keyword if '${systemType}'=='Windows' Create List test-4.jpeg Tango Secure Gateway CA
... ELSE Create List test-4.jpeg Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.intervalworld.com
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,707 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids} policyids1=${policyIds1} url=${url} profiledId=${profiledId}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /v1/policy/profile/insertscripts
${profiledId} ${EMPTY}
*** Test Cases ***
ProxyPolicy-insert-00001
[Tags] insert IP HTTP URL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=www.costcotravel.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.costcotravel.com/"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00001.bat
... ELSE set variable curl -kv https://www.costcotravel.com/Vacation-Packages
${stringlist} run keyword if '${systemType}'=='Windows' Create List X-TG-Construct-By: tfe Tango Secure Gateway CA
... ELSE Create List X-TG-Construct-By: tfe Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.costcotravel.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-insert-00002
[Tags] insert IP HTTP URL Host
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=meilleurmobile isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.meilleurmobile.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.meilleurmobile.com/"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "www.meilleurmobile.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${fqdn}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00002.bat
... ELSE set variable curl -kv https://www.meilleurmobile.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List alert Tango Secure Gateway CA
... ELSE Create List alert Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.meilleurmobile.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-insert-00003
[Tags] insert IP HTTP URL User-Agent
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=login_redirect isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.viator.com/login?login_redirect=%2Faccount%2Fbookings"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${req_hdr_ua}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.viator.com/login?login_redirect=%2Faccount%2Fbookings
${stringlist} run keyword if '${systemType}'=='Windows' Create List select_language Tango Secure Gateway CA
... ELSE Create List select_language Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.viator.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-insert-00004
[Tags] insert IP HTTP URL Content-Type
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=Shops.htm isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.waikikibeachwalk.com/Shops.htm"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "utf-8","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${res_hdr_ct}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00008.bat
... ELSE set variable curl -kv http://www.waikikibeachwalk.com/Shops.htm
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00008.bat
... ELSE set variable curl -kv http://www.waikikibeachwalk.com/Shops.htm
${stringlist} run keyword if '${systemType}'=='Windows' Create List alert
... ELSE Create List alert
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.waikikibeachwalk.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-insert-00005
[Tags] insert IP HTTP URL Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=equipment isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=saltkey isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test.css insertcss
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "petapixel.com/topic/equipment/"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "saltkey","district": "Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${req_hdr_ck}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00012.bat
... ELSE set variable curl -kv --cookie "lQfQ_2132_saltkey=t8WY1oPe; lQfQ_2132_lastvisit=1595381790; lQfQ_2132_sid=vqXOg6; lQfQ_2132_lastact=1595385400%09forum.php%09image" --referer 'https://www.baidu.com/' \ https://petapixel.com/topic/equipment/
${stringlist} run keyword if '${systemType}'=='Windows' Create List petapixel Tango Secure Gateway CA
... ELSE Create List petapixel Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host petapixel.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-insert-00006
[Tags] insert IP HTTP URL Set-Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=intervalworld.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=Domain=.intervalworld.com isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test.css insertcss
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.intervalworld.com/web/my/home"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "Domain=.intervalworld.com","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${res_hdr_sc}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_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.intervalworld.com/web/my/home
${stringlist} run keyword if '${systemType}'=='Windows' Create List alert Tango Secure Gateway CA
... ELSE Create List alert Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.intervalworld.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-insert-00007
[Tags] insert IP HTTP 最大组合1
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*intervalworld.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=intervalworld.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=__stripe_sid isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=Domain=.intervalworld.com isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test.css insertcss
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "www.intervalworld.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.intervalworld.com/web/my/home"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "__stripe_sidafdsvxvx","district": "Cookie"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "Domain=.intervalworld.com","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${res_hdr_sc} ${fqdn} ${req_hdr_ck}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_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.intervalworld.com/web/my/home
${stringlist} run keyword if '${systemType}'=='Windows' Create List alert Tango Secure Gateway CA
... ELSE Create List alert Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.intervalworld.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-insert-00008
[Tags] insert IP HTTP 最大组合2
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*intervalworld.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=intervalworld.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=charset isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test.css insertcss
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "www.intervalworld.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.intervalworld.com/web/my/home"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "charset=text","district": "Content-Type"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0fsfwhh","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${res_hdr_ct} ${fqdn} ${req_hdr_ua}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_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.intervalworld.com/web/my/home
${stringlist} run keyword if '${systemType}'=='Windows' Create List alert Tango Secure Gateway CA
... ELSE Create List alert Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.intervalworld.com
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,870 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids} policyids1=${policyIds1}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Monitor-00001
[Tags] Monitor IP HTTP
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"monitor","protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00001.bat
... ELSE set variable curl -kv \ https://newsela.com/about/content/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host http_url
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Monitor-http-00002
[Tags] Monitor IP HTTP HOST
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*kingidentity.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "kingidentity.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${fqdn}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00002.bat
... ELSE set variable curl -kv \ \ https://kingidentity.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host kingidentity.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Monitor-00003
[Tags] Monitor IP HTTP URL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=creativetravelgroup.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "creativetravelgroup.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00003_1.bat
... ELSE set variable curl -kv \ https://creativetravelgroup.com/
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00003_1.bat
... ELSE set variable curl -kv \ https://creativetravelgroup.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host creativetravelgroup.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Monitor-00004
[Tags] Deny IP HTTP User-Agent
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${req_hdr_ua}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.usdebtclock.org/state-debt-clocks/state-of-california-debt-clock.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List qwertyuiop Tango Secure Gateway CA
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.usdebtclock.org/state-debt-clocks/state-of-california-debt-clock.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List qwertyuiop Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.usdebtclock.org
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Monitor-0005
[Tags] Monitor IP HTTP Content-Type
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=*utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "utf-8","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${res_hdr_ct}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00008.bat
... ELSE set variable curl http://www.6renyou.com/user_comment/index
${stringlist} run keyword if '${systemType}'=='Windows' Create List 6人游
... ELSE Create List 6人游
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.6renyou.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Monitor-00006
[Tags] Monitor IP HTTP Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=saltkey isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "saltkey","district": "Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${req_hdr_ck}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00012.bat
... ELSE set variable curl -kv --cookie "lQfQ_2132_saltkey=t8WY1oPe; lQfQ_2132_lastvisit=1595381790; lQfQ_2132_sid=vqXOg6; lQfQ_2132_lastact=1595385400%09forum.php%09image" --referer 'https://www.baidu.com/' \ https://www.youqulu.com/category/zixun
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.youqulu.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Monitor-00007
[Tags] Deny IP HTTP Set-Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=irkzadmin_session* isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "irkzadmin_session","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${res_hdr_sc}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00013_3.bat
... ELSE set variable curl -kv \ https://nationalbank.kz/?switch=kazakh
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host nationalbank.kz
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Monitor-00008
[Tags] Deny IP HTTP Request Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Request Content
${addItemList1} Create Dictionary keywordArray=ProxydenyTest001401 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${req_body} Create Dictionary attributeType=string attributeName=req_body appId=67 appName=http protocol=http attributeValue={"string": "ProxydenyTest001401"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${req_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00014.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=1234567&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Timed out
... ELSE Create List Connection was reset
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host open.node.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Monitor-00009
[Tags] Monitor IP HTTP Response Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Response Content
${addItemList1} Create Dictionary keywordArray=NOFOLLOW isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${res_body} Create Dictionary attributeType=string attributeName=res_body appId=67 appName=http protocol=http attributeValue={"string": "NOFOLLOW"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${res_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00017.bat
... ELSE set variable curl -kv --cookie "test%20cookie=null; timezoneoffset=-480; ASP.NET_SessionId=sta2b3gxpxzqei3by1ka3qsa; visid_incap_1010467=Iu/pLzeoTnGn2VDjWdP9GpoBGF8AAAAAQUIPAAAAAADzSLZtZ1tZ/Rbjfct3Nq69" --referer 'https://www.baidu.com/' \ https://www.umusicpub.com/au/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.umusicpub.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Monitor-00010
[Tags] Monitor IP HTTP 最大组合1
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.umusicpub.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=sicpub.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=timezoneoffset isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=Domain=.umusicpub.com isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment Response Content
${addItemList1} Create Dictionary keywordArray=NOFOLLOW isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId5} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId5}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR,${objectId5}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "www.umusicpub.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.umusicpub.com/au/"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "timezoneoffset","district": "Cookie"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "Domain=.umusicpub.com","district": "Set-Cookie"}
${res_body} Create Dictionary attributeType=string attributeName=res_body appId=67 appName=http protocol=http attributeValue={"string": "NOFOLLOW"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${fqdn} ${url1} ${req_hdr_ck} ${res_hdr_sc} ${res_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00017.bat
... ELSE set variable curl -kv --cookie "test%20cookie=null; timezoneoffset=-480; ASP.NET_SessionId=sta2b3gxpxzqei3by1ka3qsa; visid_incap_1010467=Iu/pLzeoTnGn2VDjWdP9GpoBGF8AAAAAQUIPAAAAAADzSLZtZ1tZ/Rbjfct3Nq69" --referer 'https://www.baidu.com/' \ https://www.umusicpub.com/au/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.umusicpub.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Monitor-00011
[Tags] Monitor IP HTTP 最大组合2
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=open isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=charset isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment Request Content
${addItemList1} Create Dictionary keywordArray=ProxyDenyTest0017 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId5} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId5}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR,${objectId5}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "open.node.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "open.node.com"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0","district": "User-Agent"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "charset","district": "Content-Type"}
${req_body} Create Dictionary attributeType=string attributeName=req_body appId=67 appName=http protocol=http attributeValue={"string": "ProxyDenyTest0017"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${fqdn} ${url1} ${req_hdr_ua} ${res_hdr_ct} ${req_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00016.bat
... ELSE set variable curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{"requestbody":"ProxyDenyTest0017","setcook":"asdf","contenttype": "content-type","responsebody": "adzx"}" -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' http://open.node.com:180/go
${stringlist} run keyword if '${systemType}'=='Windows' Create List Timed out
... ELSE Create List Timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host open.node.com
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,750 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids} policyids1=${policyIds1}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Redirect-00001
[Tags] Redirect IP HTTP URL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=tudou isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "tudou.com/"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00001.bat
... ELSE set variable curl -kv https://tudou.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA
... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host tudou.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Redirect-00002
[Tags] Redirect IP HTTP URL HOST
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=glazok.kz isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*glazok.kz isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "glazok.kz"}
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "glazok.kz/"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${fqdn}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00002.bat
... ELSE set variable curl -kv https://glazok.kz/
${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA
... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host glazok.kz
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Redirect-00003
[Tags] Redirect IP HTTP URL User-Agent
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=investing/online-trading isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.merrilledge.com/investing/online-trading"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${req_hdr_ua}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.merrilledge.com/investing/online-trading
${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA
... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.merrilledge.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Redirect-00004
[Tags] Redirect IP HTTP URL Content-Type
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=business/fixed isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=*utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR 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=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.essence.com.cn/business/fixed"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "utf-8","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${res_hdr_ct}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00008.bat
... 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
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.essence.com.cn
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Redirect-00005
[Tags] Redirect IP HTTP URL Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=products/product-type/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=saltkey isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.investors-trust.com/products/product-type/"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "saltkeyfafghlh","district": "Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${req_hdr_ck}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00012.bat
... ELSE set variable curl -kv --cookie "lQfQ_2132_saltkey=t8WY1oPe; lQfQ_2132_lastvisit=1595381790; lQfQ_2132_sid=vqXOg6; lQfQ_2132_lastact=1595385400%09forum.php%09image" --referer 'https://www.baidu.com/' \ https://www.investors-trust.com/products/product-type/
${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA
... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.investors-trust.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Redirect-00006
[Tags] Redirect IP HTTP URL Set-Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=www.travelmath.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=mobile=2* isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":301,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.travelmath.com/drive-distance/"}
${res_hdr_sc1} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "mobile=2","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${res_hdr_sc1}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00013.bat
... ELSE set variable curl -kv https://www.travelmath.com/drive-distance/
${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA
... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.travelmath.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Redirect-00007
[Tags] Redirect IP HTTP URL Request Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=open.node isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment Request Content
${addItemList1} Create Dictionary keywordArray=testredirect0014001 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":301,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "open.node.com"}
${req_body} Create Dictionary attributeType=string attributeName=req_body appId=67 appName=http protocol=http attributeValue={"string": "testredirect0014001"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${req_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00014.bat
... ELSE set variable curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{"requestbody":"testredirect0014001","setcook":"monitortest142","contenttype": "content-type","responsebody": "testredirect0014001"}" -kv http://open.node.com:180/go
${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/
... ELSE Create List http://www.iceo.com.cn/renwu2013/
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host open.node.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Redirect-00008
[Tags] Redirect IP HTTP 最大组合1
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.equifax.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*personal/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=COOKIE_SUPPORT isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=GUEST_LANGUAGE_ID isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":301,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "www.equifax.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.equifax.com/personal/"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "COOKIE_SUPPORT","district": "Cookie"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "GUEST_LANGUAGE_ID","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${fqdn} ${req_hdr_ck} ${res_hdr_sc}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00016.bat
... ELSE set variable curl -kv --cookie "COOKIE_SUPPORT=true; GUEST_LANGUAGE_ID=en_US; check=true; optimizelyEndUserId=oeu1614475207300r0.5456467694720912; AMCVS_0D2431DD533AE3ED0A490D44%40AdobeOrg=1; s_ecid=MCMID%7C60761335805840825830014857054941623749; AMCV_0D2431DD533AE3ED0A490D44%40AdobeOrg=1585540135%7CMCIDTS%7C18687%7CMCMID%7C60761335805840825830014857054941623749%7CMCAAMLH-1615080007%7C11%7CMCAAMB-1615080007%7CRKhpRz8krg2tLO6pguXWp5olkAcUniQYPHaMWWgdJ3xzPWQmdj0y%7CMCOPTOUT-1614482408s%7CNONE%7CMCAID%7CNONE%7CvVersion%7C4.4.0; _gcl_au=1.1.1338628350.1614475209; _cs_c=1; mboxEdgeCluster=38; bounceClientVisit4326v=N4IgNgDiBcIBYBcEQM4FIDMBBNAmAYnvgO6kB0ApgI4CuAlgGYCGAHmQMYD2AtkRBQCcUnAHZMwREABoQAmCBABfIA; s_dfa=equifaxgcsusprod%2Cequifaxgcsglobalprod; _cs_mk=0.6956552086218912_1614475214635; s2_visit=1; s2_dslv_s=first%20visit; s2_gpv_as=no%20value; s2_gpv_pn=us%20%7C%20gcs%20%7C%20home; s2_gpv_pt=home; s_vnum=1614528000644%26vn%3D1; s_invisit=true; s2_ttce=1614475214645; s2_ptc=%5B%5BB%5D%5D; s_cc=true; aam_uuid=60782751376829515990016981052062115069; QSI_HistorySession=https%3A%2F%2Fwww.equifax.com%2Fpersonal%2F~1614475214944; ats-cid-AM-141627-sid=42959954; s_vi=[CS]v1|301D77E8A8742FEB-400013573E0D5817[CE]; mbox=session#be301dd442d743f0a9801609db54a320#1614477138|PC#be301dd442d743f0a9801609db54a320.38_0#1677720010; _cs_id=dec49cf1-0907-a158-aaf5-5b82707dd758.1614475208.1.1614475278.1614475208.1.1648639208984.Lax.0; _cs_s=2.0; LFR_SESSION_STATE_20105=1614475279282; _uetsid=1cc2e370796311ebabaf9b1249a9cba5; _uetvid=1cc2ecd0796311eb890f8f8f18f8e982; s2_getNewRepeat=1614475281456-Repeat; s2_dslv=1614475281456; JSESSIONID=DF505B4E7193A5871D79196DF19CD8C8; TS013d4770=0131c2fe50536b48a838ba47248a57b5c14a6e36de393cb14df413b1272d8566ff9d9af3b07411d579abea5a03f5fd4dda2e9117d9d1e9cb5676bace395d6fcede1c0a8f8061ef2b222db7cb7472622d48944b693c3cdc0b7603d5a91e9930c55752d58c11" --referer 'https://www.baidu.com/' \ https://www.equifax.com/personal/
${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA
... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.equifax.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Redirect-00009
[Tags] Redirect IP HTTP 最大组合2
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=charset isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment Request Content
${addItemList1} Create Dictionary keywordArray=testredirect0015 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId5} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId5}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":301,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR,${objectId5}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "open.node.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "open.node.com"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0","district": "User-Agent"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "charset","district": "Content-Type"}
${req_body} Create Dictionary attributeType=string attributeName=req_body appId=67 appName=http protocol=http attributeValue={"string": "testredirect0015"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${fqdn} ${req_hdr_ua} ${res_hdr_ct} ${req_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00015.bat
... ELSE set variable curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d "Content-Type:application/json;charset=UTF-8" -X POST -d "{\"requestbody\":\"testredirect0015\",\"setcook\":\"monitortest142\",\"contenttype\": \"content-type\",\"responsebody\": \"testredirect0014002\"}" -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' http://open.node.com:180/go
${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/
... ELSE Create List http://www.iceo.com.cn/renwu2013/
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host open.node.com
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,673 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids} policyids1=${policyIds1} url=${url} profiledId=${profiledId}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /policy/profile/responsepages
${profiledId} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Replace-00001
[Tags] Replace IP HTTP URL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=wordpress.com/contact/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Replace策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"replace","rules":[{"search_in":"http_resp_body","find":"Artificial","replace_with":"明天你好"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "destidotcom.wordpress.com/contact/"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00001.bat
... ELSE set variable curl -kv https://destidotcom.wordpress.com/contact/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 明天你好 Tango Secure Gateway CA
... ELSE Create List 明天你好 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host destidotcom.wordpress.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Replace-00002
[Tags] Replace IP HTTP URL HOST
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=airastana.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*stana.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Replace策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"replace","rules":[{"search_in":"http_req_uri","find":"Kop-baghytty-ushu","replace_with":"Arnaiy-usynystar"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "airastana.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "airastana.com/kaz/kk-kz/Josparlau/Kop-baghytty-ushu"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${fqdn}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00002.bat
... ELSE set variable curl -kv https://airastana.com/kaz/kk-kz/Josparlau/Kop-baghytty-ushu
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host airastana.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Replace-00003
[Tags] Replace IP HTTP URL User-Agent
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=headlines/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Replace策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR 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}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.ino.com/news/headlines/"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${req_hdr_ua}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.ino.com/news/headlines/
${stringlist} run keyword if '${systemType}'=='Windows' Create List text/json Tango Secure Gateway CA
... ELSE Create List text/json Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.ino.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Replace-00004
[Tags] Replace IP HTTP URL Content-Type
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=ghzq/index.html isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Replace策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR 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}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.ghzq.com.cn/ghzq/index.html"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${res_hdr_ct}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00008.bat
... 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
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.ghzq.com.cn
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Replace-00005
[Tags] Replace IP HTTP URL Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=welcome-to-canyonlands-national-park/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=saltkey isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Replace策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR 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}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.national-park.com/welcome-to-canyonlands-national-park/"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "saltkey","district": "Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${req_hdr_ck}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00012.bat
... ELSE set variable curl -kv --cookie "lQfQ_2132_saltkey=t8WY1oPe; lQfQ_2132_lastvisit=1595381790; lQfQ_2132_sid=vqXOg6; lQfQ_2132_lastact=1595385400%09forum.php%09image" --referer 'https://www.baidu.com/' \ https://www.national-park.com/welcome-to-canyonlands-national-park/
${stringlist} run keyword if '${systemType}'=='Windows' Create List text/json Tango Secure Gateway CA
... ELSE Create List text/json Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.national-park.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Replace-http-00006
[Tags] Replace IP HTTP URL Set-Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=www.classicvacations.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=AWSALB* isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Replace策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR 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}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.classicvacations.com/collections/all-inclusive"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "AWSALBCORS=","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${res_hdr_sc}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00013_3.bat
... ELSE set variable curl -kv https://www.classicvacations.com/collections/all-inclusive
${stringlist} run keyword if '${systemType}'=='Windows' Create List classicvacations Tango Secure Gateway CA
... ELSE Create List classicvacations Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.classicvacations.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Replace-http-00006
[Tags] Replace IP HTTP 最大组合1
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*engadget.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*gaming/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=__stripe_sid isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=Domain=.engadget.com isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Replace策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"json"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "www.engadget.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.engadget.com/gaming/"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "__stripe_sidafdsvxvx","district": "Cookie"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "Domain=.engadget.com","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${fqdn} ${req_hdr_ck} ${res_hdr_sc}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00014.bat
... ELSE set variable curl -kv -L --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.engadget.com/gaming/
${stringlist} run keyword if '${systemType}'=='Windows' Create List text/json Tango Secure Gateway CA
... ELSE Create List text/json Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.engadget.com
Should Be Equal As Strings ${returnvalue} true
ProxyPolicy-Replace-http-00007
[Tags] Replace IP HTTP 最大组合2
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*engadget.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*gaming/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=text isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
Comment 创建Replace策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=pxy_manipulation policyDesc=autotest action=manipulation source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"json"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyIds1} set Variable ${policyId1}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "www.engadget.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.engadget.com/gaming/"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "charset=text","district": "Content-Type"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0fsfwhh","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url1} ${fqdn} ${req_hdr_ua} ${res_hdr_ct}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds1} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00014.bat
... ELSE set variable curl -kv -L --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.engadget.com/gaming/
${stringlist} run keyword if '${systemType}'=='Windows' Create List text/json Tango Secure Gateway CA
... ELSE Create List text/json Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds1}
${returnvalue} GetLogList_new proxy_event_log ${starttime} ${testClentIP} ${s} http_host www.engadget.com
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,77 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
Library OperatingSystem
Library Selenium2Library
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-DNS-00001
[Tags] Allow IP DNS
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"DNS"} isValid=${1} appIdObjects=${DNS_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "32"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.facebook.com
... ELSE set variable nslookup www.facebook.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List www.facebook.com
... ELSE Create List www.facebook.com
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} dns_qname DNS
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,76 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
Library OperatingSystem
Library Selenium2Library
Library Custometest
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-FTP-00001
[Tags] Allow IP FTP
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"FTP"} isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "45"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/wlcsy.txt -u ftpuser:111111 中文文件内容
run keyword if '${systemType}'=='Windows' should contain ${FTP} ftp_success
... ELSE should contain ${FTP} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ftp_account FTP
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,276 +1,119 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-Http-00001
[Tags] Allow IP HTTP
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
[Tags] Allow IP FQDN DENY HTTP
#创建对象IP
#${rescode} ${object_IP_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"ip","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmmtest_IP","objectDesc":"","subObjectIds":[],"addItemList":[{"addrType":4,"protocol":0,"direction":0,"clientIp1":"192.168.50.31","clientIp2":"192.168.50.31","clientIpFormat":"range","clientPortFormat":"","clientPort1":"","clientPort2":"","serverIpFormat":"","serverIp1":"","serverIp2":"","serverPortFormat":"","serverPort1":"","serverPort2":""}],"updateItemList":[],"deleteItemIds":[]}}
#log ${object_IP_Id}
#创建对象FQDN
${rescodeip} ${object_FQDN_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"fqdn","objectSubType":"","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"SecurityPolicy-Allow-Http-00001_FQDN_icbc","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["$www.icbc.com.cn"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_FQDN_Id}
${objectids} set Variable ${object_FQDN_Id}
#创建 Deny 搭配Allow
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Allow-Http-00001_Deny","policyType":"tsg_security","action":"deny","userTags":"${userTagIds}","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","method":"drop"},"referenceObject":[{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[2]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Allow-Http-00001_Deny","policyType":"tsg_security","action":"deny","userTags":"${userTagIds}","doBlacklist":0,"doLog":1,"policyDesc":"autotest","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","method":"drop"},"referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[2]}}
log ${addPolicyStr}
${rescode} ${policyId1} AddPolicy ${addPolicyStr}
log ${policyId1}
${policyIds} set Variable {"policyType":"tsg_security","policyIds":[${policyId1}]}
#创建allow策略
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Allow-Http-00001","policyType":"tsg_security","action":"allow","userTags":"${userTagIds}","doBlacklist":0,"doLog":1,"policyDesc":"autotest","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP"},"referenceObject":[],"isValid":1,"scheduleId":[],"appObjectIdArray":[2]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Allow-Http-00001","policyType":"tsg_security","action":"allow","userTags":"${userTagIds}","doBlacklist":0,"doLog":1,"policyDesc":"autotest","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP"},"referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[2]}}
${rescode} ${policyId2} AddPolicy ${addPolicyStr}
log ${policyId2}
${policyIds2} set Variable {"policyType":"tsg_security","policyIds":[${policyId2}]}
${policyIds1} set Variable {"policyType":"tsg_security","policyIds":[${policyId1}]}
${policyIds} Create List ${policyIds1} ${policyIds2}
#${rescode} ${policyId} AddPolicy {"opAction":"add","returnData":1,"policyList":{"policyName":"SecurityPolicy-Allow-Http-00001","policyType":"tsg_security","action":"allow","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","keyring":1},"referenceObject":[{"objectId":${object_IP_Id},"protocolFields":[]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00001_1.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00001_1_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 首页 - 橙光
... ELSE Create List 首页 - 橙光
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
${commandreturn} OperatingSystem.Run curl -I \ -m \ 10 \ -o \ /dev/null \ -s \ -w \ \ \%{http_code} \ \ http://www.icbc.com.cn
should contain ${commandreturn} 200
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host www.66rpg.com
Should Be Equal As Strings ${returnvalue} true
${s} Convert to String ${policyId2}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host icbc
SecurityPolicy-Allow-Http-00002
[Tags] Allow IP HTTP FQDN
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
[Tags] Allow SubID Category DENY HTTP
#创建对象Subid
${rescode} ${object_Subid_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"subscriberid","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"SecurityPolicy-Allow-Http-00002_subid","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["$zmmtest"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_Subid_Id}
${objectids} set Variable ${object_Subid_Id}
#创建对象Categry
${rescodeip} ${object_Category_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"fqdn_category","objectSubType":"","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"SecurityPolicy-Allow-Http-00002-Categry","objectDesc":"autotest","subObjectIds":[],"addItemList":[{"keywordArray":["*www.ccb.com"],"itemId":"","isValid":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[],"objectId":""}}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.66rpg.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
log ${object_Category_Id}
${objectids} set Variable ${object_Subid_Id},${object_Category_Id}
#创建 Deny 搭配Allow
#${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyName":"SecurityPolicy-Allow-Http-00002_deny","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_Subid_Id} ,"protocolFields":[]},{"objectId":${object_Category_Id} ,"protocolFields":["TSG_FIELD_HTTP_HOST"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Allow-Http-00002_deny","policyType":"tsg_security","action":"deny","userTags":"${userTagIds}","doBlacklist":0,"doLog":1,"policyDesc":"autotest","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","method":"drop"},"referenceObject":[{"objectId":${object_Subid_Id},"protocolFields":[null]},{"objectId":${object_Category_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[2]}}
log ${addPolicyStr}
${rescode} ${policyId1} AddPolicy ${addPolicyStr}
log ${policyId1}
${policyIds} set Variable {"policyType":"tsg_security","policyIds":[${policyId1}]}
#创建策略
#${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyName":"SecurityPolicy-Allow-Http-00002","policyType":"tsg_security","action":"allow","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","keyring":1},"referenceObject":[{"objectId":${object_Subid_Id},"protocolFields":[]},{"objectId":${object_Category_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Allow-Http-00002","policyType":"tsg_security","action":"allow","userTags":"${userTagIds}","doBlacklist":0,"doLog":1,"policyDesc":"autotest","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP"},"referenceObject":[{"objectId":${object_Subid_Id},"protocolFields":[null]},{"objectId":${object_Category_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[2]}}
${rescode} ${policyId2} AddPolicy ${addPolicyStr}
log ${policyId2}
${policyIds1} set Variable {"policyType":"tsg_security","policyIds":[${policyId1}]}
${policyIds2} set Variable {"policyType":"tsg_security","policyIds":[${policyId2}]}
${policyIds} Create List ${policyIds1} ${policyIds2}
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${qname_fqdn_id} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "www.66rpg.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${qname_fqdn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00001_1.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00001_1_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 首页 - 橙光
... ELSE Create List 首页 - 橙光
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
${starttime} Get Time
${commandreturn} OperatingSystem.Run curl -I \ -m \ 10 \ -o \ /dev/null \ -s \ -w \ \ \%{http_code} \ \ http://www.ccb.com
should contain ${commandreturn} 200
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host www.66rpg.com
Should Be Equal As Strings ${returnvalue} true
${s} Convert to String ${policyId2}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host ccb
SecurityPolicy-Allow-Http-00003
[Tags] Allow IP HTTP URL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=clintonairport.com/airlines-flights/covid/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
[Tags] Allow IP FQDN DENY HTTP
#创建对象IP
#${rescode} ${object_IP_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"ip","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmmtest_IP","objectDesc":"","subObjectIds":[],"addItemList":[{"addrType":4,"protocol":0,"direction":0,"clientIp1":"192.168.50.31","clientIp2":"192.168.50.31","clientIpFormat":"range","clientPortFormat":"","clientPort1":"","clientPort2":"","serverIpFormat":"","serverIp1":"","serverIp2":"","serverPortFormat":"","serverPort1":"","serverPort2":""}],"updateItemList":[],"deleteItemIds":[]}}
#log ${object_IP_Id}
#创建对象FQDN
${rescodeip} ${object_FQDN_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"fqdn","objectSubType":"","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"SecurityPolicy-Allow-Http-00001_FQDN_xiaozhu","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["*.xiaozhu.com"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_FQDN_Id}
${objectids} set Variable ${object_FQDN_Id}
#创建 Deny 搭配Allow
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Allow-Http-00003_Deny","policyType":"tsg_security","action":"deny","userTags":"${userTagIds}","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","method":"drop"},"referenceObject":[{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[2]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Allow-Http-00001_Deny","policyType":"tsg_security","action":"deny","userTags":"${userTagIds}","doBlacklist":0,"doLog":1,"policyDesc":"autotest","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","method":"drop"},"referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[2]}}
log ${addPolicyStr}
${rescode} ${policyId1} AddPolicy ${addPolicyStr}
log ${policyId1}
${policyIds} set Variable {"policyType":"tsg_security","policyIds":[${policyId1}]}
#创建allow策略
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Allow-Http-00003","policyType":"tsg_security","action":"allow","userTags":"${userTagIds}","doBlacklist":0,"doLog":1,"policyDesc":"autotest","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP"},"referenceObject":[],"isValid":1,"scheduleId":[],"appObjectIdArray":[2]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Allow-Http-00001","policyType":"tsg_security","action":"allow","userTags":"${userTagIds}","doBlacklist":0,"doLog":1,"policyDesc":"autotest","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP"},"referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[2]}}
${rescode} ${policyId2} AddPolicy ${addPolicyStr}
log ${policyId2}
${policyIds2} set Variable {"policyType":"tsg_security","policyIds":[${policyId2}]}
${policyIds1} set Variable {"policyType":"tsg_security","policyIds":[${policyId1}]}
${policyIds} Create List ${policyIds1} ${policyIds2}
#${rescode} ${policyId} AddPolicy {"opAction":"add","returnData":1,"policyList":{"policyName":"SecurityPolicy-Allow-Http-00001","policyType":"tsg_security","action":"allow","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","keyring":1},"referenceObject":[{"objectId":${object_IP_Id},"protocolFields":[]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "clintonairport.com/airlines-flights/covid/"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00001.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00001_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List clintonairport.com
... ELSE Create List clintonairport.com
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
${commandreturn} OperatingSystem.Run curl -I \ -m \ 10 \ -o \ /dev/null \ -s \ -w \ \ \%{http_code} \ \ http://www.xiaozhu.com/
should contain ${commandreturn} 200
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host clintonairport.com
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Allow-Http-00004
[Tags] Allow IP HTTP FQDN+URL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*clintonairport.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=clintonairport.com/airlines-flights/covid/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "clintonairport.com/airlines-flights/covid/"}
${qname_fqdn_id} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "clintonairport.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url} ${qname_fqdn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds} ${objectid_verify}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00001.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00001_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List COVID
... ELSE Create List COVID
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host clintonairport.com
Should Be Equal As Strings ${returnvalue} true
${s} Convert to String ${policyId2}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host .xiaozhu.com

View File

@@ -1,88 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
Library OperatingSystem
Library Selenium2Library
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../02-Keyword/tsg_common/StmpHandle.robot
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-MAIL-00001
[Tags] Allow IP MAIL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"MAIL"} isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "8004"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount163Dxy}
${邮箱密码} Set Variable ${mailPasswordDxy}
${邮件主题} Set Variable 123123132
${发送者} Set Variable ${mailAccount163Dxy}
${附件} Set Variable ["${mailpath}/朱明明测试文件.txt"]
${接收者} Set Variable ["${mailAccount163Lyf}"]
${抄送者} Set Variable ["${mailAccount163Lyf}"]
${密送者} Set Variable ["${mailAccount163Lyf}"]
${邮件正文} Set Variable Простопорно
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} success
... ELSE should contain ${发送邮件返回结果} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} mail_account mail_from_cmd
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,76 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
Library OperatingSystem
Library Selenium2Library
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-QUCI-00001
[Tags] Allow IP QUIC
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"QUCI"} isValid=${1} appIdObjects=${QUIC_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "2521"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
Open Browser https://www.facebook.com ${browserType}
sleep 2
${text} Get Text xpath=//*[@id="content"]/div/div/div/div[1]/h2
Should Be Equal As Strings ${text} 联系你我,分享生活,尽在 Facebook
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} common_schema_type QUIC
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,144 +1,87 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
Library OperatingSystem
Library Selenium2Library
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-SSL-00001
[Tags] Allow IP SNI SSL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.facebook.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL"} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
[Tags] Allow IP FQDN DENY HTTP
#创建对象IP
#${rescode} ${object_IP_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"ip","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmmtest_IP","objectDesc":"","subObjectIds":[],"addItemList":[{"addrType":4,"protocol":0,"direction":0,"clientIp1":"192.168.50.31","clientIp2":"192.168.50.31","clientIpFormat":"range","clientPortFormat":"","clientPort1":"","clientPort2":"","serverIpFormat":"","serverIp1":"","serverIp2":"","serverPortFormat":"","serverPort1":"","serverPort2":""}],"updateItemList":[],"deleteItemIds":[]}}
#log ${object_IP_Id}
#创建对象FQDN
${rescodeip} ${object_FQDN_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"fqdn","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmmtest_FQDN_icbc","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["*ww.sogou.com"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_FQDN_Id}
${objectids} set Variable ${object_FQDN_Id}
#创建 Deny 搭配Allow
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyName":"SecurityPolicy-Allow-SSL-00001_deny","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"SSL","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_SSL_SNI"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyName":"SecurityPolicy-Allow-SSL-00001_deny","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"SSL","method":"drop","keyring":1},"referenceObject":[{"objectId":${testClentID},"protocolFields":[]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_SSL_SNI"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
log ${addPolicyStr}
${rescode} ${policyId1} AddPolicy ${addPolicyStr}
log ${policyId1}
${policyIds} set Variable {"policyType":"tsg_security","policyIds":[${policyId1}]}
#创建策略
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyName":"SecurityPolicy-Allow-SSL-00001","policyType":"tsg_security","action":"allow","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"SSL","keyring":1},"referenceObject":[{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_SSL_SNI"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyName":"SecurityPolicy-Allow-SSL-00001","policyType":"tsg_security","action":"allow","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"SSL","keyring":1},"referenceObject":[{"objectId":${testClentID},"protocolFields":[]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_SSL_SNI"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}} \
${rescode} ${policyId2} AddPolicy ${addPolicyStr}
log ${policyId2}
${policyIds1} set Variable {"policyType":"tsg_security","policyIds":[${policyId1}]}
${policyIds2} set Variable {"policyType":"tsg_security","policyIds":[${policyId2}]}
${policyIds} Create List ${policyIds1} ${policyIds2}
#${rescode} ${policyId} AddPolicy {"opAction":"add","returnData":1,"policyList":{"policyName":"SecurityPolicy-Allow-Http-00001","policyType":"tsg_security","action":"allow","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","keyring":1},"referenceObject":[{"objectId":${object_IP_Id},"protocolFields":[]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${sni} Create Dictionary attributeType=string attributeName=sni appId=199 appName=ssl protocol=ssl attributeValue={"string": "www.facebook.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "199"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${sni}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
Open Browser https://www.facebook.com ${browserType}
sleep 2
${text} Get Text xpath=//*[@id="content"]/div/div/div/div[1]/h2
Should Be Equal As Strings ${text} 联系你我,分享生活,尽在 Facebook
Comment 日志验证
${starttime} Get Time
${commandreturn} OperatingSystem.Run curl -I \ -m \ 10 \ -o \ /dev/null \ -s \ -w \ \ \%{http_code} \ \ https://www.sogou.com
should contain ${commandreturn} 200
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni www.facebook.com
Should Be Equal As Strings ${returnvalue} true
${s} Convert to String ${policyId2}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni icbc
SecurityPolicy-Allow-SSL-00002
[Tags] Allow IP SSL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL"} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
[Tags] Allow SubID Category DENY HTTP
#创建对象Subid
${rescode} ${object_Subid_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"subscriberid","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmmtest_subid","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["$zmmtest"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_Subid_Id}
${objectids} set Variable ${object_Subid_Id}
#创建对象Categry
${rescodeip} ${object_Category_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"fqdn_category","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmmtest_category","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["*arch.jd.com"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_Category_Id}
${objectids} set Variable ${object_Subid_Id},${object_Category_Id}
#创建 Deny 搭配Allow
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyName":"SecurityPolicy-Allow-SSL-00001_deny","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"SSL","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_Subid_Id} ,"protocolFields":[]},{"objectId":${object_Category_Id} ,"protocolFields":["TSG_FIELD_SSL_SNI"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyName":"SecurityPolicy-Allow-SSL-00001_deny","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"SSL","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_Subid_Id} ,"protocolFields":[]},{"objectId":${object_Category_Id} ,"protocolFields":["TSG_FIELD_SSL_SNI"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
log ${addPolicyStr}
${rescode} ${policyId1} AddPolicy ${addPolicyStr}
log ${policyId1}
${policyIds} set Variable {"policyType":"tsg_security","policyIds":[${policyId1}]}
#创建策略
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyName":"SecurityPolicy-Allow-SSL-00002","policyType":"tsg_security","action":"allow","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"SSL","keyring":1},"referenceObject":[{"objectId":${object_Subid_Id},"protocolFields":[]},{"objectId":${object_Category_Id},"protocolFields":["TSG_FIELD_SSL_SNI"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyName":"SecurityPolicy-Allow-SSL-00002","policyType":"tsg_security","action":"allow","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"SSL","keyring":1},"referenceObject":[{"objectId":${object_Subid_Id},"protocolFields":[]},{"objectId":${object_Category_Id},"protocolFields":["TSG_FIELD_SSL_SNI"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${rescode} ${policyId2} AddPolicy ${addPolicyStr}
log ${policyId2}
${policyIds1} set Variable {"policyType":"tsg_security","policyIds":[${policyId1}]}
${policyIds2} set Variable {"policyType":"tsg_security","policyIds":[${policyId2}]}
${policyIds} Create List ${policyIds1} ${policyIds2}
#${rescode} ${policyId} AddPolicy {"opAction":"add","returnData":1,"policyList":{"policyName":"SecurityPolicy-Allow-Http-00002","policyType":"tsg_security","action":"allow","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","keyring":1},"referenceObject":[{"objectId":${object_Subid_Id},"protocolFields":[]},{"objectId":${object_Category_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
#log ${rescode}
#log ${policyId}
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "199"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
Open Browser https://www.facebook.com ${browserType}
sleep 2
${text} Get Text xpath=//*[@id="content"]/div/div/div/div[1]/h2
Should Be Equal As Strings ${text} 联系你我,分享生活,尽在 Facebook
Comment 日志验证
${starttime} Get Time
${commandreturn} OperatingSystem.Run curl -I \ -m \ 10 \ -o \ /dev/null \ -s \ -w \ \ \%{http_code} \ \ http://www.ccb.com
should contain ${commandreturn} 200
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni ssl_cn
Should Be Equal As Strings ${returnvalue} true
${s} Convert to String ${policyId2}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni icbc

View File

@@ -1,138 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-SIP-00001
[Tags] Allow IP SIP
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SIP"} isValid=${1} appIdObjects=${SIP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "182"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
# Comment 功能端验证
# Comment 日志验证
# #日志验证
# ${s} Convert to String ${policyIds}
# ${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ftp_account ftpuser
# Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Allow-SIP-00002
[Tags] Allow IP SIP Originator Description Responder Description
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Originator Description
${addItemList1} Create Dictionary keywordArray=test1 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Responder Description
${addItemList1} Create Dictionary keywordArray=test2 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Allow策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=allow source=${objectId}|TSG_SECURITY_SOURCE_ADDR filterList=${objectId1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${objectId2}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION userRegion={"protocol":"SIP"} isValid=${1} appIdObjects=${SIP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${originator} Create Dictionary attributeType=string attributeName=originator appId=182 appName=SIP attributeValue={"string": "test1"}
${responder} Create Dictionary attributeType=string attributeName=responder appId=182 appName=SIP attributeValue={"string": "test2"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "182"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${originator} ${responder}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
# Comment 功能端验证
# Comment 日志验证
# #日志验证
# ${s} Convert to String ${policyIds}
# ${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ftp_account ftpuser
# Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,208 +1,74 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
Library OperatingSystem
Library OperatingSystem #Test Setup Login #Test Teardown Logout
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
Library Custometest
Resource ../../../02-Keyword/tsg_common/StmpHandle.robot
*** Test Cases ***
SecurityPolicy-Deny-DNS-00001
[Tags] Deny IP DNS
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"DNS","method":"drop"} isValid=${1} appIdObjects=${DNS_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
[Tags] Deny Fqdn_IP
#创建对象 IP
#${rescode} ${object_IP_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"ip","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmmtest_IP","objectDesc":"","subObjectIds":[],"addItemList":[{"addrType":4,"protocol":0,"direction":0,"clientIp1":"192.168.50.31","clientIp2":"192.168.50.31","clientIpFormat":"range","clientPortFormat":"","clientPort1":"","clientPort2":"","serverIpFormat":"","serverIp1":"","serverIp2":"","serverPortFormat":"","serverPort1":"","serverPort2":""}],"updateItemList":[],"deleteItemIds":[]}}
#log ${object_IP_Id}
#创建对象 FQDN
${rescodeip} ${object_FQDN_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"fqdn","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_Deny_fqdn_ziroom","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["$www.ziroom.com"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_FQDN_Id}
${objectids} set Variable ${object_FQDN_Id}
#创建策略
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-DNS-00001","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"DNS","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_DNS_QNAME"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-DNS-00001","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"DNS","method":"drop","keyring":1},"referenceObject":[{"objectId":${testClentID},"protocolFields":[]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_DNS_QNAME"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${rescode} ${policyId2} AddPolicy ${addPolicyStr}
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId2}]}
${policyIds} Create List ${policyId1}
#${rescode} ${policyId} AddPolicy {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-DNS-00001","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"DNS","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_IP_Id},"protocolFields":[]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_DNS_QNAME"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
#log ${rescode}
#log ${policyId}
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string":"32" }
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "252.252.252.252","port": "443","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.facebook.com
... ELSE set variable nslookup www.facebook.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 超时
... ELSE Create List timed out
${starttime} Get Time
${commandstr} set variable nslookup -d www.ziroom.com
${stringlista} set variable 超时
${stringlist} Create List ${stringlista}
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} dns_qname DNS
${s} Convert to String ${policyId2}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni xiaozhu
SecurityPolicy-Deny-DNS-00002
[Tags] Deny IP DNS QNAME
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*www.arctictrucks.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"A","answer":[{"atype":"CNAME","value":"www.jd.com","ttl":{"min":500,"max":500}},{"atype":"A","value":"192.168.41.186","ttl":{"min":300,"max":300}}]}]} filterList=${objectId1}|TSG_FIELD_DNS_QNAME isValid=${1} appIdObjects=${DNS_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
[Tags] Deny Sub_Category
#创建对象 Sub
${rescode} ${object_Sub_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"subscriberid","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmmtest_subid","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["$zmmtest"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_Sub_Id}
${objectids} set Variable ${object_Sub_Id}
#创建对象 Cat
${rescodeip} ${object_Cat_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"fqdn_category","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_Cat_smsp","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["$smspunch.net"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_Cat_Id}
${objectids} set Variable ${object_Sub_Id},${object_Cat_Id}
#创建策略
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-DNS-00002","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"DNS","method":"redirect","resolution":[{"qtype":"AAAA","answer":[{"atype":"AAAA","value":"e061:82db:c37e:e8c5:c8ab:eab8:5a76:04a9","ttl":{"min":300,"max":300}},{"atype":"CNAME","value":"www.ly.com","ttl":{"min":300,"max":300}}]}],"keyring":1},"referenceObject":[{"objectId":${object_Sub_Id},"protocolFields":[]},{"objectId":${object_Cat_Id},"protocolFields":["TSG_FIELD_DNS_QNAME"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-DNS-00002","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"DNS","method":"redirect","resolution":[{"qtype":"AAAA","answer":[{"atype":"AAAA","value":"e061:82db:c37e:e8c5:c8ab:eab8:5a76:04a9","ttl":{"min":300,"max":300}},{"atype":"CNAME","value":"www.ly.com","ttl":{"min":300,"max":300}}]}],"keyring":1},"referenceObject":[{"objectId":${object_Sub_Id},"protocolFields":[]},{"objectId":${object_Cat_Id},"protocolFields":["TSG_FIELD_DNS_QNAME"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${rescode} ${policyId2} AddPolicy ${addPolicyStr}
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId2}]}
${policyIds} Create List ${policyId1}
#${rescode} ${policyId} AddPolicy {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-DNS-00002","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"DNS","method":"redirect","resolution":[{"qtype":"AAAA","answer":[{"atype":"AAAA","value":"e061:82db:c37e:e8c5:c8ab:eab8:5a76:04a9","ttl":{"min":300,"max":300}},{"atype":"CNAME","value":"www.ly.com","ttl":{"min":300,"max":300}}]}],"keyring":1},"referenceObject":[{"objectId":${object_Sub_Id},"protocolFields":[]},{"objectId":${object_Cat_Id},"protocolFields":["TSG_FIELD_DNS_QNAME"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
#log ${rescode}
#log ${policyId}
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${qname_fqdn_id} Create Dictionary attributeType=string attributeName=qname appId=32 appName=dns protocol=dns attributeValue={"string": "www.arctictrucks.ru"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string":"32" }
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "252.252.252.252","port": "443","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${qname_fqdn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.arctictrucks.ru 8.8.8.8
... ELSE set variable nslookup -debug -query=A \ www.arctictrucks.ru
${stringlist} run keyword if '${systemType}'=='Windows' Create List www.arctictrucks.ru
... ELSE Create List www.arctictrucks.ru
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} dns_qname www.arctictrucks.ru
SecurityPolicy-Deny-DNS-00003
[Tags] Deny IP DNS QNAME
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*aec188.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"AAAA","answer":[{"atype":"AAAA","value":"fc00::2:11","ttl":{"min":400,"max":400}},{"atype":"CNAME","value":"www.taobao.com","ttl":{"min":600,"max":600}}]}]} filterList=${objectId1}|TSG_FIELD_DNS_QNAME isValid=${1} appIdObjects=${DNS_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${qname_fqdn_id} Create Dictionary attributeType=string attributeName=qname appId=32 appName=dns protocol=dns attributeValue={"string": "aec188.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string":"32" }
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "252.252.252.252","port": "443","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${qname_fqdn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d aec188.com 8.8.8.8
... ELSE set variable nslookup -debug -query=AAAA \ aec188.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List aec188.com
... ELSE Create List aec188.com
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
${commandstr} set variable nslookup -d www.smspunch.net
@{stringlist} set variable www.ly.com
${rescode} SystemCommands ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} dns_qname aec188.com
${s} Convert to String ${policyId2}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni xiaozhu

View File

@@ -1,348 +1,101 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
Library OperatingSystem
Library Custometest
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library Custometest
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Deny-FTP-00001
[Tags] Deny IP FTP
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"FTP","method":"drop"} isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
[Tags] Deny Sub_Account
#创建对象 Sub
${rescode} ${object_Sub_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"subscriberid","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmmtest_subid","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["$zmmtest"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_Sub_Id}
${objectids} set Variable ${object_Sub_Id}
#创建对象 Account
${rescodeip} ${object_Account_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"account","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_Account","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["anony*"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[],"objectId":""}}
log ${object_Account_Id}
${objectids} set Variable ${object_Sub_Id},${object_Account_Id}
#创建策略
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-FTP-00001","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"FTP","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_Sub_Id} ,"protocolFields":[]},{"objectId":${object_Account_Id} ,"protocolFields":["TSG_FIELD_FTP_ACCOUNT"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-FTP-00001","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"FTP","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_Sub_Id} ,"protocolFields":[]},{"objectId":${object_Account_Id} ,"protocolFields":["TSG_FIELD_FTP_ACCOUNT"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${rescode} ${policyId2} AddPolicy ${addPolicyStr}
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId2}]}
${policyIds} Create List ${policyId1}
#${rescode} ${policyId} AddPolicy {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-DNS-00002","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"DNS","method":"redirect","resolution":[{"qtype":"AAAA","answer":[{"atype":"AAAA","value":"e061:82db:c37e:e8c5:c8ab:eab8:5a76:04a9","ttl":{"min":300,"max":300}},{"atype":"CNAME","value":"www.ly.com","ttl":{"min":300,"max":300}}]}],"keyring":1},"referenceObject":[{"objectId":${object_Sub_Id},"protocolFields":[]},{"objectId":${object_Cat_Id},"protocolFields":["TSG_FIELD_DNS_QNAME"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
#log ${rescode}
#log ${policyId}
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "45"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/123456.txt -u ftpuser:111111 123456789qwertyuiop
# should contain ${FTP} ftp_fail
run keyword if '${systemType}'=='Windows' should contain ${FTP} ftp_fail
... ELSE should contain ${FTP} Fail
Comment 日志验证
${starttime} Get Time
${FTP} FTP 登录
should contain ${FTP} Deny Success
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ftp_account FTP
Should Be Equal As Strings ${returnvalue} true
${s} Convert to String ${policyId2}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account anonymous
SecurityPolicy-Deny-FTP-00002
[Tags] Deny IP FTP Account URI Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=*user isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建URI
${addItemList1} Create Dictionary keywordArray=*123456.txt isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Content
${addItemList1} Create Dictionary keywordArray=*qwertyuiop isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"FTP","method":"drop"} filterList=${objectId1}|TSG_FIELD_FTP_ACCOUNT,${objectId3}|TSG_FIELD_FTP_CONTENT,${objectId2}|TSG_FIELD_FTP_URI isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
[Tags] Deny URI_Content
#创建对象IP
#${rescode} ${object_IP_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"ip","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmmtest_IP","objectDesc":"","subObjectIds":[],"addItemList":[{"addrType":4,"protocol":0,"direction":0,"clientIp1":"192.168.50.31","clientIp2":"192.168.50.31","clientIpFormat":"range","clientPortFormat":"","clientPort1":"","clientPort2":"","serverIpFormat":"","serverIp1":"","serverIp2":"","serverPortFormat":"","serverPort1":"","serverPort2":""}],"updateItemList":[],"deleteItemIds":[]}}
#log ${object_IP_Id}
#创建对象 URI
${rescodeip} ${object_URI_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"url","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"ZMM_FTP_URI","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["*771.txt"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[],"objectId":""}}
log ${object_URI_Id}
${objectids} set Variable ${object_URI_Id}
#创建对象 Content
${rescode_deny} ${object_Content_id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"keywords","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"ZMM_FTP_Content","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["accountsservice"],"isHexbin":0,"itemId":"","isValid":""}],"updateItemList":[],"deleteItemIds":[],"objectId":""}}
log ${object_Content_id}
${objectids} set Variable ${object_URI_Id},${object_Content_id}
#创建策略
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-FTP-00002","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"FTP","method":"drop"},"referenceObject":[{"objectId":${object_URI_Id} ,"protocolFields":["TSG_FIELD_FTP_URI"]},{"objectId":${object_Content_id} ,"protocolFields":["TSG_FIELD_FTP_CONTENT"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-FTP-00002","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"FTP","method":"drop"},"referenceObject":[{"objectId":${testClentID},"protocolFields":[]},{"objectId":${object_URI_Id} ,"protocolFields":["TSG_FIELD_FTP_URI"]},{"objectId":${object_Content_id} ,"protocolFields":["TSG_FIELD_FTP_CONTENT"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${rescode} ${policyId2} AddPolicy ${addPolicyStr}
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId2}]}
${policyIds} Create List ${policyId1}
#${rescode} ${policyId} AddPolicy {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-Http-00001","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_IP_Id},"protocolFields":[]},{"objectId":${object_Category_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":${object_URL_id},"protocolFields":["TSG_FIELD_HTTP_URL"]},{"objectId":${object_UA_id},"protocolFields":["TSG_FIELD_HTTP_REQ_HDR"]},{"objectId":${object_CT_id},"protocolFields":["TSG_FIELD_HTTP_RES_HDR"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
#${policyIds} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
#log ${rescode}
#log ${policyId}
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url} Create Dictionary attributeType=string attributeName=url appId=45 appName=ftp protocol=ftp attributeValue={"string": "192.168.40.158/123456.txt"}
${Content} Create Dictionary attributeType=string attributeName=content appId=45 appName=ftp protocol=http attributeValue={"string": "123456789qwertyuiop"}
${Account} Create Dictionary attributeType=string attributeName=account appId=45 appName=ftp protocol=http attributeValue={"string": "ftpuser"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "45"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url} ${Content} ${Account}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/123456.txt -u ftpuser:111111 123456789qwertyuiop
# should contain ${FTP} ftp_fail
run keyword if '${systemType}'=='Windows' should contain ${FTP} ftp_fail
... ELSE should contain ${FTP} Fail
Comment 日志验证
${starttime} Get Time
${FTP} FTP 下载
should contain ${FTP} Deny Success
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ftp_account ftpuser
Should Be Equal As Strings ${returnvalue} true
${s} Convert to String ${policyId2}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://202.38.97.230/pub/iso/linux/knoppix/KNOPPIX_V7.7.1DVD-2016-10-22-EN/dpkg-l-dvd-771.txt
SecurityPolicy-Deny-FTP-00003
[Tags] Deny IP FTP Account
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=*user isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"FTP","method":"drop"} filterList=${objectId1}|TSG_FIELD_FTP_ACCOUNT isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
[Tags] Deny Sub_Account
#创建对象 Account
${rescodeip} ${object_Account_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"account","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_Account","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["anony*"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[],"objectId":""}}
log ${object_Account_Id}
${objectids} set Variable ${object_Account_Id}
#创建策略
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-FTP-00001","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"FTP","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_Account_Id} ,"protocolFields":["TSG_FIELD_FTP_ACCOUNT"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-FTP-00001","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"FTP","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_Account_Id} ,"protocolFields":["TSG_FIELD_FTP_ACCOUNT"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${rescode} ${policyId2} AddPolicy ${addPolicyStr}
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId2}]}
${policyIds} Create List ${policyId1}
#${rescode} ${policyId} AddPolicy {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-DNS-00002","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"DNS","method":"redirect","resolution":[{"qtype":"AAAA","answer":[{"atype":"AAAA","value":"e061:82db:c37e:e8c5:c8ab:eab8:5a76:04a9","ttl":{"min":300,"max":300}},{"atype":"CNAME","value":"www.ly.com","ttl":{"min":300,"max":300}}]}],"keyring":1},"referenceObject":[{"objectId":${object_Sub_Id},"protocolFields":[]},{"objectId":${object_Cat_Id},"protocolFields":["TSG_FIELD_DNS_QNAME"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
#log ${rescode}
#log ${policyId}
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${Account} Create Dictionary attributeType=string attributeName=account appId=45 appName=ftp protocol=http attributeValue={"string": "ftpuser"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "45"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${Account}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/123456.txt -u ftpuser:111111 123456789qwertyuiop
# should contain ${FTP} ftp_fail
run keyword if '${systemType}'=='Windows' should contain ${FTP} ftp_fail
... ELSE should contain ${FTP} Fail
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ftp_account ftpuser
SecurityPolicy-Deny-FTP-00004
[Tags] Deny IP FTP URI
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建URI
${addItemList1} Create Dictionary keywordArray=*123456.txt isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"FTP","method":"drop"} filterList=${objectId2}|TSG_FIELD_FTP_URI isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url} Create Dictionary attributeType=string attributeName=url appId=45 appName=ftp protocol=ftp attributeValue={"string": "192.168.40.158/123456.txt"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "45"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/123456.txt -u ftpuser:111111 123456789qwertyuiop
# should contain ${FTP} ftp_fail
run keyword if '${systemType}'=='Windows' should contain ${FTP} ftp_fail
... ELSE should contain ${FTP} Fail
Comment 日志验证
${FTP} FTP 登录
should contain ${FTP} Deny Success
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ftp_account ftpuser
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Deny-FTP-00005
[Tags] Deny IP FTP Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
${s} Convert to String ${policyId2}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account anonymous
Comment 创建Content
${addItemList1} Create Dictionary keywordArray=*qwertyuiop isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"FTP","method":"drop"} filterList=${objectId1}|TSG_FIELD_FTP_CONTENT isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${Content} Create Dictionary attributeType=string attributeName=content appId=45 appName=ftp protocol=http attributeValue={"string": "123456789qwertyuiop"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "45"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${Content}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/123456.txt -u ftpuser:111111 123456789qwertyuiop
# should contain ${FTP} ftp_fail
run keyword if '${systemType}'=='Windows' should contain ${FTP} ftp_fail
... ELSE should contain ${FTP} Fail
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ftp_account ftpuser
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,817 +1,94 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Library Custometest
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url1} /v1/policy/profile/responsepages
*** Test Cases ***
SecurityPolicy-Deny-HTTP-00001
[Tags] Deny IP HTTP
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP","method":"drop"} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
[Tags] Deny Category_Url_UA_CT
#创建对象IP
#${rescode} ${object_IP_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"ip","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmmtest_IP","objectDesc":"","subObjectIds":[],"addItemList":[{"addrType":4,"protocol":0,"direction":0,"clientIp1":"192.168.50.31","clientIp2":"192.168.50.31","clientIpFormat":"range","clientPortFormat":"","clientPort1":"","clientPort2":"","serverIpFormat":"","serverIp1":"","serverIp2":"","serverPortFormat":"","serverPort1":"","serverPort2":""}],"updateItemList":[],"deleteItemIds":[]}}
#log ${object_IP_Id}
#创建对象Category
${rescodeip} ${object_Category_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"fqdn_category","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_cat_ziroom","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["*oom.com"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_Category_Id}
${objectids} set Variable ${object_Category_Id}
#创建对象URL
${rescode_deny} ${object_URL_id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"url","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmmtest_url-ziroom","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["www.ziroom.com/li*"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_URL_id}
${objectids} set Variable ${object_Category_Id},${object_URL_id}
#创建对象UA
${rescode_deny} ${object_UA_id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"http_signature","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_ua_ziroom","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["Mozilla/5.0*"],"isHexbin":0,"district":"User-Agent"}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_UA_id}
${objectids} set Variable ${object_Category_Id},${object_URL_id},${object_UA_id}
#创建对象CT
${rescode_deny} ${object_CT_id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"http_signature","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_ct_ziroom","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["text/html; charse*"],"isHexbin":0,"district":"Content-Type"}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_CT_id}
${objectids} set Variable ${object_Category_Id},${object_URL_id},${object_UA_id},${object_CT_id}
#创建策略
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-Http-00001","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_Category_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":${object_URL_id},"protocolFields":["TSG_FIELD_HTTP_URL"]},{"objectId":${object_UA_id},"protocolFields":["TSG_FIELD_HTTP_REQ_HDR"]},{"objectId":${object_CT_id},"protocolFields":["TSG_FIELD_HTTP_RES_HDR"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-Http-00001","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","method":"drop","keyring":1},"referenceObject":[{"objectId":${testClentID},"protocolFields":[]},{"objectId":${object_Category_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":${object_URL_id},"protocolFields":["TSG_FIELD_HTTP_URL"]},{"objectId":${object_UA_id},"protocolFields":["TSG_FIELD_HTTP_REQ_HDR"]},{"objectId":${object_CT_id},"protocolFields":["TSG_FIELD_HTTP_RES_HDR"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${rescode} ${policyId2} AddPolicy ${addPolicyStr}
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId2}]}
${policyIds} Create List ${policyId1}
#${rescode} ${policyId} AddPolicy {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-Http-00001","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_IP_Id},"protocolFields":[]},{"objectId":${object_Category_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":${object_URL_id},"protocolFields":["TSG_FIELD_HTTP_URL"]},{"objectId":${object_UA_id},"protocolFields":["TSG_FIELD_HTTP_REQ_HDR"]},{"objectId":${object_CT_id},"protocolFields":["TSG_FIELD_HTTP_RES_HDR"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
#${policyIds} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
#log ${rescode}
#log ${policyId}
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00001.bat
... ELSE set variable curl -m 10 -kv http://www.lkong.net/forum.php
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
${starttime} Get Time
${commandreturn} OperatingSystem.Run curl --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' \ http://www.ziroom.com/life/index \ \ | iconv -f utf-8 -t gbk
should not contain ${commandreturn} 营业执照
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host HTTP
Should Be Equal As Strings ${returnvalue} true
${s} Convert to String ${policyId2}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host ziroom
SecurityPolicy-Deny-HTTP-00002
[Tags] Deny IP HTTP FQDN
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*bellaircraftmuseum.org isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP","method":"rst"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
[Tags] Deny Fqdn_Url_CK_SC
#创建对象SubID
${rescode} ${object_Subid_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"subscriberid","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmmtest_subid","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["$zmmtest"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_Subid_Id}
${objectids} set Variable ${object_Subid_Id}
#创建对象FQDN
${rescodeip} ${object_FQDN_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"fqdn","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_xiaozhu_fqdn","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["*zhu.com"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_FQDN_Id}
${objectids} set Variable ${object_Subid_Id},${object_FQDN_Id}
#创建对象URL
${rescode_deny} ${object_URL_id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"url","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_xiaozhu_url","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["*ozhu.com/"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_URL_id}
${objectids} set Variable ${object_Subid_Id},${object_FQDN_Id},${object_URL_id}
#创建对象CK
${rescode_deny} ${object_CK_id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"http_signature","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_xiaozhu_cookie","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["*_math=czsuv8n9d4p; Hm_lvt_92e8bc890f374994dd570aa15afc99e1=1575187416; Hm_lpvt_92e8bc890f374994dd570aa15afc99e1=1575187416; _uab_collina=157518741578524001717192"],"isHexbin":0,"district":"Cookie"}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_CK_id}
${objectids} set Variable ${object_Subid_Id},${object_FQDN_Id},${object_URL_id},${object_CK_id}
#创建对象SC
${rescode_deny} ${object_SC_id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"http_signature","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_sc","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["*domain=.xiaozhu.com"],"isHexbin":0,"district":"Set-Cookie"}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_SC_id}
${objectids} set Variable ${object_Subid_Id},${object_FQDN_Id},${object_URL_id},${object_CK_id},${object_SC_id}
#创建策略
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-Http-00002","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","method":"rst","keyring":1},"referenceObject":[{"objectId":${object_Subid_Id},"protocolFields":[]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":${object_URL_id},"protocolFields":["TSG_FIELD_HTTP_URL"]},{"objectId":${object_CK_id},"protocolFields":["TSG_FIELD_HTTP_REQ_HDR"]},{"objectId":${object_SC_id},"protocolFields":["TSG_FIELD_HTTP_RES_HDR"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-Http-00002","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","method":"rst","keyring":1},"referenceObject":[{"objectId":${object_Subid_Id},"protocolFields":[]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":${object_URL_id},"protocolFields":["TSG_FIELD_HTTP_URL"]},{"objectId":${object_CK_id},"protocolFields":["TSG_FIELD_HTTP_REQ_HDR"]},{"objectId":${object_SC_id},"protocolFields":["TSG_FIELD_HTTP_RES_HDR"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${rescode} ${policyId2} AddPolicy ${addPolicyStr}
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId2}]}
${policyIds} Create List ${policyId1}
#${rescode} ${policyId} AddPolicy {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-Http-00002","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"HTTP","method":"rst","keyring":1},"referenceObject":[{"objectId":${object_Subid_Id},"protocolFields":[]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":${object_URL_id},"protocolFields":["TSG_FIELD_HTTP_URL"]},{"objectId":${object_CK_id},"protocolFields":["TSG_FIELD_HTTP_REQ_HDR"]},{"objectId":${object_SC_id},"protocolFields":["TSG_FIELD_HTTP_RES_HDR"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
#log ${rescode}
#log ${policyId}
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${qname_fqdn_id} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "bellaircraftmuseum.org"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${qname_fqdn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00002.bat
... ELSE set variable curl http://bellaircraftmuseum.org/
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00002.bat
... ELSE set variable curl http://bellaircraftmuseum.org/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host bellaircraftmuseum.org
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Deny-HTTP-00003
[Tags] Deny IP HTTP URL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=news isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=www.icbc.com.cn isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=www.gotohoroscope* isHexbin=${0}
${addItemList4} Create Dictionary keywordArray=indexv isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建引用文件
#创建引用文件
${response} CreatePolicyFile2 ${url1} ${responsePageFiles} 404english.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP","method":"block","code":403,"html_profile":${profiledId}} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.icbc.com.cn/"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00003.bat
... ELSE set variable curl http://www.icbc.com.cn/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00003_1.bat
... ELSE set variable curl http://www.ccb.com/cn/home/indexv3.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00003_2.bat
... ELSE set variable curl http://www.gotohoroscope.com/daily-horoscope.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00003_3.bat
... ELSE set variable curl http://government.ru/news/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
${commandreturn} OperatingSystem.Run curl --cookie "*_math=czsuv8n9d4p; Hm_lvt_92e8bc890f374994dd570aa15afc99e1=1575187416; Hm_lpvt_92e8bc890f374994dd570aa15afc99e1=1575187416; _uab_collina=157518741578524001717192" --referer 'http://www.baidu.com/' \ http://www.xiaozhu.com \ \ | iconv -f utf-8 -t gbk
should contain ${commandreturn} 403
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host www.icbc.com.cn
Should Be Equal As Strings ${returnvalue} true
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host www.ccb.com
Should Be Equal As Strings ${returnvalue} true
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host www.gotohoroscope.com
Should Be Equal As Strings ${returnvalue} true
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host government.ru
Should Be Equal As Strings ${returnvalue} true
${s} Convert to String ${policyId2}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host xiaozhu
SecurityPolicy-Deny-HTTP-00004
[Tags] Deny IP HTTP User-Agent
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP","method":"block","code":404,"message":"block"} filterList=${objectId1}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${req_hdr_ua}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' \http://www.tsutmb.ru/sveden
${stringlist} run keyword if '${systemType}'=='Windows' Create List block
... ELSE Create List block
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host tsutmb.ru
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Deny-HTTP-00005
[Tags] Deny IP HTTP Content-Type
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=*utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP","method":"rst"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "utf-8","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${res_hdr_ct}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00008.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00008_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host cmbchina.com
SecurityPolicy-Deny-HTTP-00006
[Tags] Deny IP HTTP Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=ipp_uid2 isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP","method":"block","code":404,"message":"马上到周末"} filterList=${objectId1}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "ipp_uid2","district": "Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${req_hdr_ck}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00012.bat
... ELSE set variable curl -kv --cookie "ipp_uid_tst=1614083626134/s-G5u-av-3V6UMopU8qN0w; rerf=AAAAAGA09iqKHHWcAwwEAg==; visid_incap_1850197=73iJXVstR5eD96boaecG5Sr2NGAAAAAAQUIPAAAAAADRrWjXkBE1xHfgl1g2q0+Z; incap_ses_431_1850197=yz/Zbyso2kIQ3JKieDj7BSr2NGAAAAAAxpbwZIp4Ku0GJhK9DvIxUw==; ___utmvmaluytEzB=zJTWRrkycAu; ___utmvbaluytEzB=oZQ XqnOgalR: qtO; ipp_uid2=SLwSBC2htc6RCxdR/gtvNhcOjz2aYXsuOQZ9IMw==; ipp_uid1=1614083626503; ipp_uid=1614083626503/SLwSBC2htc6RCxdR/gtvNhcOjz2aYXsuOQZ9IMw==; tildauid=1614083628065.339214; tildasid=1614083628065.951808; _fbp=fb.1.1614083628650.700159084; previousUrl=universalmusic.ru%2F" --referer 'http://www.baidu.com/' \ http://www.universalmusic.ru/#about
${stringlist} run keyword if '${systemType}'=='Windows' Create List 马上到周末
... ELSE Create List 马上到周末
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host www.universalmusic.ru
SecurityPolicy-Deny-HTTP-00007
[Tags] Deny IP HTTP Set-Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=ASP.NET isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP","method":"drop"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "ASP.NET","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${res_hdr_sc}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00013_1.bat
... ELSE set variable curl --connect-timeout 5 -m 10 blog.cnstock.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 000
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host blog.cnstock.com
SecurityPolicy-Deny-HTTP-00008
[Tags] Deny IP HTTP Request Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Request Content
${addItemList1} Create Dictionary keywordArray=testDenyHttp0014 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP","method":"drop"} filterList=${objectId1}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${req_body} Create Dictionary attributeType=string attributeName=req_body appId=67 appName=http protocol=http attributeValue={"string": "testDenyHttp0014"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${req_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00014.bat
... ELSE set variable curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{"requestbody":"testDenyHttp0014","setcook":"12345678","contenttype": "content-type","responsebody": "testDenyHttp0014"}" http://open.node.com:180/go
${stringlist} run keyword if '${systemType}'=='Windows' Create List after
... ELSE Create List after
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-HTTP-00009
[Tags] Deny IP HTTP Response Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Response Content
${addItemList1} Create Dictionary keywordArray=华彤公司 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP","method":"drop"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${res_body} Create Dictionary attributeType=string attributeName=res_body appId=67 appName=http protocol=http attributeValue={"string": "华彤公司"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${res_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00015.bat
... ELSE set variable curl -m 10 -kv http://www.huatonggs.com/about.html#gsjj
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host huatonggs.com
SecurityPolicy-Deny-HTTP-00010
[Tags] Deny IP HTTP FQDN URL User-Agent Content-Type Request Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=open.node isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=charset isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment Request Content
${addItemList1} Create Dictionary keywordArray=DenyHttp0016 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId5} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId5}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP","method":"drop"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR,${objectId5}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${qname_fqdn_id} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "open.node.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "open.node.com/"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0","district": "User-Agent"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "charset","district": "Content-Type"}
${req_body} Create Dictionary attributeType=string attributeName=req_body appId=67 appName=http protocol=http attributeValue={"string": "testDenyHttp0016"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${qname_fqdn_id} ${url} ${req_hdr_ua} ${res_hdr_ct} ${req_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00016.bat
... ELSE set variable curl -m 10 -kv -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{"requestbody":"DenyHttp0016","setcook":"asdf","contenttype": "charsetDeny0016","responsebody": "adzx"}" -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' http://open.node.com:180/go
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List 000
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-HTTP-00011
[Tags] Deny IP HTTP FQDN URL Cookie Set-Cookie Response Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*smspunch.net isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=send-free-sms.aspx isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=_ym_isad=2 isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=NET_SessionId isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment Response Content
${addItemList1} Create Dictionary keywordArray=Cell No isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId5} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId5}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP","method":"drop"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR,${objectId5}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "smspunch.net"}
${url} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "smspunch.net/send-free-sms.aspx"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "_ym_isad=2","district": "Cookie"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "NET_SessionId","district": "Set-Cookie"}
${res_body} Create Dictionary attributeType=string attributeName=res_body appId=67 appName=http protocol=http attributeValue={"string": "Cell No"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ck} ${res_hdr_sc} ${res_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00017.bat
... ELSE set variable curl -m 10 -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://smspunch.net/send-free-sms.aspx
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host smspunch.net

File diff suppressed because it is too large Load Diff

View File

@@ -1,77 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
Library OperatingSystem
Library Selenium2Library
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Deny-QUCI-00001
[Tags] Deny IP QUIC
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"QUCI","method":"drop"} isValid=${1} appIdObjects=${QUIC_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "2521"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
Open Browser https://www.facebook.com ${browserType}
sleep 2
${text} Get Text xpath=//*[@id="content"]/div/div/div/div[1]/h2
Should Be Equal As Strings ${text} 联系你我,分享生活,尽在 Facebook
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} common_schema_type QUIC
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,355 +1,89 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
Library OperatingSystem
Library Selenium2Library
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
Library OperatingSystem #Test Setup Login #Test Teardown Logout
Resource ../../02-Keyword/tsg-adc/systemcommand.txt
Resource ../../02-Keyword/tsg-bf-api/policyobject.txt
Resource ../../02-Keyword/tsg-bf-api/logvariable.txt
Resource ../../02-Keyword/tsg-bf-api/logschema.txt #Resource log-3.robot
Library custometest
Resource ../../02-Keyword/tsg-ui/StmpHandle2.robot
*** Test Cases ***
SecurityPolicy-Deny-SSL-00001
[Tags] Deny IP SSL SNI SAN CN
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建SNI
${addItemList1} Create Dictionary keywordArray=$www.prlib.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建CN
${addItemList1} Create Dictionary keywordArray=*prlib.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建SAN
${addItemList1} Create Dictionary keywordArray=*prlib.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","method":"drop"} filterList=${objectId3}|TSG_FIELD_SSL_SAN,${objectId1}|TSG_FIELD_SSL_SNI,${objectId2}|TSG_FIELD_SSL_CN isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
[Tags] Deny SSL SNI_SAN_CN_Category
#创建对象 IP
#${rescode} ${object_IP_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"ip","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmmtest_IP","objectDesc":"","subObjectIds":[],"addItemList":[{"addrType":4,"protocol":0,"direction":0,"clientIp1":"192.168.50.31","clientIp2":"192.168.50.31","clientIpFormat":"range","clientPortFormat":"","clientPort1":"","clientPort2":"","serverIpFormat":"","serverIp1":"","serverIp2":"","serverPortFormat":"","serverPort1":"","serverPort2":""}],"updateItemList":[],"deleteItemIds":[]}}
#log ${object_IP_Id}
#${objectids} set Variable ${object_Subid_Id}
#创建对象 SNI_CAT
${rescodeip} ${object_SNI_CAT_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"fqdn_category","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_SSL_jd_cat","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["*d.com"],"itemId":"","isValid":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_SNI_CAT_Id}
${objectids} set Variable ${object_SNI_CAT_Id}
#创建对象 SAN_CAT
${rescode_deny} ${object_SAN_CAT_id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"fqdn_category","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_SSL_jd_cat","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["*d.com"],"itemId":"","isValid":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_SAN_CAT_id}
${objectids} set Variable ${object_SNI_CAT_Id},${object_SAN_CAT_id}
#创建对象 CN_CAT
${rescode_deny} ${object_CN_CAT_id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"fqdn_category","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_SSL_jd_cat","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["*d.com"],"itemId":"","isValid":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_CN_CAT_id}
${objectids} set Variable ${object_SNI_CAT_Id},${object_SAN_CAT_id},${object_CN_CAT_id}
#创建策略
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-SSL-00001","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"SSL","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_SNI_CAT_Id},"protocolFields":["TSG_FIELD_SSL_SNI"]},{"objectId":${object_CN_CAT_id},"protocolFields":["TSG_FIELD_SSL_CN"]},{"objectId":${object_SAN_CAT_id},"protocolFields":["TSG_FIELD_SSL_SAN"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-SSL-00001","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"SSL","method":"drop","keyring":1},"referenceObject":[{"objectId":${testClentID},"protocolFields":[]},{"objectId":${object_SNI_CAT_Id},"protocolFields":["TSG_FIELD_SSL_SNI"]},{"objectId":${object_CN_CAT_id},"protocolFields":["TSG_FIELD_SSL_CN"]},{"objectId":${object_SAN_CAT_id},"protocolFields":["TSG_FIELD_SSL_SAN"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${rescode} ${policyId2} AddPolicy ${addPolicyStr}
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId2}]}
${policyIds} Create List ${policyId1}
#${rescode} ${policyId} AddPolicy {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-SSL-00001","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"SSL","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_IP_Id},"protocolFields":[]},{"objectId":${object_SNI_CAT_Id},"protocolFields":["TSG_FIELD_SSL_SNI"]},{"objectId":${object_CN_CAT_id},"protocolFields":["TSG_FIELD_SSL_CN"]},{"objectId":${object_SAN_CAT_id},"protocolFields":["TSG_FIELD_SSL_SAN"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
#log ${rescode}
#log ${policyId}
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${sni} Create Dictionary attributeType=string attributeName=sni appId=199 appName=ssl protocol=ssl attributeValue={"string": "www.prlib.ru"}
${cn} Create Dictionary attributeType=string attributeName=cn appId=199 appName=ssl protocol=ssl attributeValue={"string": "www.prlib.ru"}
${san} Create Dictionary attributeType=string attributeName=san appId=199 appName=ssl protocol=ssl attributeValue={"string": "www.prlib.ru"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "199"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${sni} ${cn} ${san}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00004.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00004_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
${starttime} Get Time
${commandreturn} OperatingSystem.Run curl -I \ -m \ 10 \ -o \ /dev/null \ -s \ -w \ \ \%{http_code} \ \ https://www.jd.com
should contain ${commandreturn} 000
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni www.prlib.ru
Should Be Equal As Strings ${returnvalue} true
${s} Convert to String ${policyId2}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni xiaozhu
SecurityPolicy-Deny-SSL-00002
[Tags] Deny IP SSL SNI
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建SNI
${addItemList1} Create Dictionary keywordArray=$www.prlib.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","method":"drop"} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
[Tags] Deny Fqdn_SNI_CN_SAN
#创建对象 Sub
${rescode} ${object_Sub_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"subscriberid","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmmtest_subid","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["$zmmtest"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_Sub_Id}
${objectids} set Variable ${object_Sub_Id}
#创建对象 SNI_FQDN
${rescodeip} ${object_SNI_FQDN_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"fqdn","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_SSL_sogou","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["*ogou.com"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_SNI_FQDN_Id}
${objectids} set Variable ${object_Sub_Id},${object_SNI_FQDN_Id}
#创建对象 SAN_FQDN
${rescode_deny} ${object_SAN_FQDN_id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"fqdn","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_SSL_sogou","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["*ogou.com"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_SAN_FQDN_id}
${objectids} set Variable ${object_Sub_Id},${object_SNI_FQDN_Id},${object_SAN_FQDN_id}
#创建对象 CN_FQDN
${rescode_deny} ${object_CN_FQDN_id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"fqdn","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"zmm_SSL_sogou","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["*ogou.com"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}}
log ${object_CN_FQDN_id}
${objectids} set Variable ${object_Sub_Id},${object_SNI_FQDN_Id},${object_SAN_FQDN_id},${object_CN_FQDN_id}
#创建策略
${addPolicyStr} set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-SSL-00002","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"SSL","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_Sub_Id},"protocolFields":[]},{"objectId":${object_SNI_FQDN_Id},"protocolFields":["TSG_FIELD_SSL_SNI"]},{"objectId":${object_CN_FQDN_id},"protocolFields":["TSG_FIELD_SSL_CN"]},{"objectId":${object_SAN_FQDN_id},"protocolFields":["TSG_FIELD_SSL_SAN"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-SSL-00002","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"SSL","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_Sub_Id},"protocolFields":[]},{"objectId":${object_SNI_FQDN_Id},"protocolFields":["TSG_FIELD_SSL_SNI"]},{"objectId":${object_CN_FQDN_id},"protocolFields":["TSG_FIELD_SSL_CN"]},{"objectId":${object_SAN_FQDN_id},"protocolFields":["TSG_FIELD_SSL_SAN"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
${rescode} ${policyId2} AddPolicy ${addPolicyStr}
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId2}]}
${policyIds} Create List ${policyId1}
#${rescode} ${policyId} AddPolicy {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Deny-SSL-00002","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"SSL","method":"drop","keyring":1},"referenceObject":[{"objectId":${object_Sub_Id},"protocolFields":[]},{"objectId":${object_SNI_FQDN_Id},"protocolFields":["TSG_FIELD_SSL_SNI"]},{"objectId":${object_CN_FQDN_id},"protocolFields":["TSG_FIELD_SSL_CN"]},{"objectId":${object_SAN_FQDN_id},"protocolFields":["TSG_FIELD_SSL_SAN"]}],"isValid":1,"scheduleId":[],"appObjectIdArray":[]}}
#log ${rescode}
#log ${policyId}
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${sni} Create Dictionary attributeType=string attributeName=sni appId=199 appName=ssl protocol=ssl attributeValue={"string": "www.prlib.ru"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "199"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${sni}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00004.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00004_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni www.prlib.ru
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Deny-SSL-00003
[Tags] Deny IP SSL CN
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建CN
${addItemList1} Create Dictionary keywordArray=*prlib.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","method":"drop"} filterList=${objectId2}|TSG_FIELD_SSL_CN isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${cn} Create Dictionary attributeType=string attributeName=cn appId=199 appName=ssl protocol=ssl attributeValue={"string": "www.prlib.ru"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "199"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${cn}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00004.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00004_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
${commandreturn} OperatingSystem.Run curl -I \ -m \ 10 \ -o \ /dev/null \ -s \ -w \ \ \%{http_code} \ \ https://www.sogou.com
should contain ${commandreturn} 200
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni www.prlib.ru
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Deny-SSL-00004
[Tags] Deny IP SSL SAN
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建SAN
${addItemList1} Create Dictionary keywordArray=*prlib.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","method":"drop"} filterList=${objectId3}|TSG_FIELD_SSL_SAN isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${san} Create Dictionary attributeType=string attributeName=san appId=199 appName=ssl protocol=ssl attributeValue={"string": "prlib.ru"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "199"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${san}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
${s} Convert to String ${policyId2}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni xiaozhu
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00004.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00004_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni www.prlib.ru
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Deny-SSL-00005
[Tags] Deny IP SSL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","method":"drop"} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "199"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00003.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00003_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni SSL
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,138 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Deny-SIP-00001
[Tags] Deny IP SIP
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SIP","method":"drop"} isValid=${1} appIdObjects=${SIP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "182"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
# Comment 功能端验证
# Comment 日志验证
# #日志验证
# ${s} Convert to String ${policyIds}
# ${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ftp_account ftpuser
# Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Deny-FTP-00002
[Tags] Deny IP FTP Account URI Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Originator Description
${addItemList1} Create Dictionary keywordArray=test1 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Responder Description
${addItemList1} Create Dictionary keywordArray=test2 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Deny策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=deny source=${objectId}|TSG_SECURITY_SOURCE_ADDR filterList=${objectId1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${objectId2}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION userRegion={"protocol":"SIP","method":"block","code":"480"} isValid=${1} appIdObjects=${SIP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${originator} Create Dictionary attributeType=string attributeName=originator appId=182 appName=SIP attributeValue={"string": "test1"}
${responder} Create Dictionary attributeType=string attributeName=responder appId=182 appName=SIP attributeValue={"string": "test2"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "182"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${originator} ${responder}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
# Comment 功能端验证
# Comment 日志验证
# #日志验证
# ${s} Convert to String ${policyIds}
# ${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ftp_account ftpuser
# Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,864 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids} url=${url} profiledId=${profiledId}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /v1/policy/profile/decryption
${profiledId} ${EMPTY}
*** Test Cases ***
Intercept_SSL_Decryption-00001
[Tags] intercpt-服务器证书校验开关关闭
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL005.bat
... ELSE set variable curl -kv https://wrong.host.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni wrong.host.badssl.com
Should Be Equal As Strings ${returnvalue} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006.bat
... ELSE set variable curl -kv https://untrusted-root.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni untrusted-root.badssl.com
Should Be Equal As Strings ${returnvalue} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL004.bat
... ELSE set variable curl -kv https://self-signed.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni self-signed.badssl.com
Should Be Equal As Strings ${returnvalue} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL003.bat
... ELSE set variable curl -kv https://expired.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni expired.badssl.com
Should Be Equal As Strings ${returnvalue} true
Intercept_SSL_Decryption-00002
[Tags] 拦截intercpt-服务器证书校验打开-failclose
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL005.bat
... ELSE set variable curl -kv https://wrong.host.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List SSL_ERROR_SYSCALL in connection to
... ELSE Create List SSL_ERROR_SYSCALL in connection to
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni wrong.host.badssl.com
Should Be Equal As Strings ${returnvalue} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006.bat
... ELSE set variable curl -kv https://untrusted-root.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List SSL_ERROR_SYSCALL in connection to
... ELSE Create List SSL_ERROR_SYSCALL in connection to
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni untrusted-root.badssl.com
Should Be Equal As Strings ${returnvalue} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL004.bat
... ELSE set variable curl -kv https://self-signed.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List SSL_ERROR_SYSCALL in connection to
... ELSE Create List SSL_ERROR_SYSCALL in connection to
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni self-signed.badssl.com
Should Be Equal As Strings ${returnvalue} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL003.bat
... ELSE set variable curl -kv https://expired.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List SSL_ERROR_SYSCALL in connection to
... ELSE Create List SSL_ERROR_SYSCALL in connection to
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni expired.badssl.com
Should Be Equal As Strings ${returnvalue} true
Intercept_SSL_Decryption-00003
[Tags] 拦截intercpt-服务器证书校验打开-pass-through
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"pass-through"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL005.bat
... ELSE set variable curl -kv https://wrong.host.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni wrong.host.badssl.com
Should Be Equal As Strings ${returnvalue} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006.bat
... ELSE set variable curl -kv https://untrusted-root.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni untrusted-root.badssl.com
Should Be Equal As Strings ${returnvalue} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL004.bat
... ELSE set variable curl -kv https://self-signed.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni self-signed.badssl.com
Should Be Equal As Strings ${returnvalue} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL003.bat
... ELSE set variable curl -kv https://expired.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni expired.badssl.com
Should Be Equal As Strings ${returnvalue} true
Intercept_SSL_Decryption-00004
[Tags] intercpt-EV关闭
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":1,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*myssl.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL005_007.bat
... ELSE set variable curl -kv https://www.myssl.cn
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni myssl.cn
Should Be Equal As Strings ${returnvalue} true
Intercept_SSL_Decryption-00005
[Tags] intercpt-EV开启
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":1,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*myssl.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL003_004.bat
... ELSE set variable curl -kv https://myssl.com
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL003_004.bat
... ELSE set variable curl -kv https://myssl.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List TrustAsia EV TLS Pro CA G3
... ELSE Create List TrustAsia EV TLS Pro CA G3
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni myssl.com
Should Be Equal As Strings ${returnvalue} true
Intercept_SSL_Decryption-00006
[Tags] 拦截intercpt-CT关闭
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*vip.com isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*jd.com isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=*mail.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_008.bat
... ELSE set variable curl -kv https://coll.jd.com/?e=illegalTopic/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni coll.jd.com
Should Be Equal As Strings ${returnvalue} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_010.bat
... ELSE set variable curl -kv https://www.vip.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni www.vip.com
Should Be Equal As Strings ${returnvalue} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_007.bat
... ELSE set variable curl -kv https://mail.ru/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni mail.ru
Should Be Equal As Strings ${returnvalue} true
Intercept_SSL_Decryption-00007
[Tags] 拦截intercpt-CT开启
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":1,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*vip.com isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*jd.com isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=*mail.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_008.bat
... ELSE set variable curl -kv https://coll.jd.com/?e=illegalTopic/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List GlobalSign RSA OV SSL CA 2018
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni coll.jd.com
Should Be Equal As Strings ${returnvalue} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_010.bat
... ELSE set variable curl -kv https://www.vip.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Secure Site Pro CA G2
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni www.vip.com
Should Be Equal As Strings ${returnvalue} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_007.bat
... ELSE set variable curl -kv https://mail.ru/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni mail.ru
Should Be Equal As Strings ${returnvalue} true
Intercept_SSL_Decryption-00008
[Tags] 拦截intercpt-MA关闭
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*badssl.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL008_9.bat
... ELSE set variable curl -kv https://client.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni client.badssl.com
Should Be Equal As Strings ${returnvalue} true
Intercept_SSL_Decryption-00009
[Tags] 拦截intercpt-MA开启
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":1,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*badssl.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL008_9.bat
... ELSE set variable curl -kv https://client.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List DigiCert SHA2 Secure Server CA
... ELSE Create List DigiCert SHA2 Secure Server CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni client.badssl.com
Should Be Equal As Strings ${returnvalue} true
Intercept_SSL_Decryption-00010
[Tags] 拦截intercpt-协议版本-SSL3
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"ssl3","mirror_client":0,"allow_http2":0}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*newdaynews.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL010_10.bat
... ELSE set variable curl -kv https://newdaynews.ru/moskow/665390.html/
${stringlist} run keyword if '${systemType}'=='Windows' Create List newdaynews.ru
... ELSE Create List newdaynews.ru
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni newdaynews.ru
Should Be Equal As Strings ${returnvalue} true
Intercept_SSL_Decryption-00011
[Tags] 拦截intercpt-协议版本-TLS1.0
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"tls10","max":"tls10","mirror_client":0,"allow_http2":0}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*github.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL011_12.bat
... ELSE set variable curl -kv https://github.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List github.com
... ELSE Create List github.com
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni github.com
Should Be Equal As Strings ${returnvalue} true
Intercept_SSL_Decryption-00012
[Tags] 拦截intercpt-协议版本-TLS1.1
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"tls11","max":"tls11","mirror_client":0,"allow_http2":0}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*jd.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_008.bat
... ELSE set variable curl -kv https://github.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni coll.jd.com
Should Be Equal As Strings ${returnvalue} true
Intercept_SSL_Decryption-00013
[Tags] 拦截intercpt-协议版本-TLS1.2
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"tls12","max":"tls12","mirror_client":0,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*taobao.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL011.bat
... ELSE set variable curl -kv https://www.taobao.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni taobao.com
Should Be Equal As Strings ${returnvalue} true
Intercept_SSL_Decryption-00014
[Tags] 拦截intercpt-协议版本-TLS1.3
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"tls13","max":"tls13","mirror_client":0,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*mi.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL009.bat
... ELSE set variable curl -kv https://www.taobao.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List mi.com
... ELSE Create List mi.com
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni mi.com
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,143 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Intesept-Http-00001
[Tags] Intercept http ip+fqdn
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.yumi.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${qname_fqdn_id} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "www.yumi.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${qname_fqdn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_HTTP_00001.bat
... ELSE set variable curl http://www.yumi.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 玉米
... ELSE Create List 玉米
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host www.yumi.com
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Intesept-Http-00002
[Tags] Intercept http
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_HTTP_00001.bat
... ELSE set variable curl http://www.yumi.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 玉米
... ELSE Create List 玉米
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host HTTP
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,144 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Intesept-Https-00001
[Tags] Intercept https ip+sni
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.reviewpro.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${sni} Create Dictionary attributeType=string attributeName=sni appId=199 appName=ssl protocol=ssl attributeValue={"string": "www.reviewpro.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "199"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${sni}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_SSL_00001.bat
... ELSE set variable curl -kv https://www.reviewpro.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List reviewpro Tango Secure Gateway CA
... ELSE Create List reviewpro Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni www.reviewpro.com
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Intesept-Https-00002
[Tags] Intercept https
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Intercept策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security policyDesc=autotest action=intercept source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "199"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_SSL_00002.bat
... ELSE set variable curl -kv https://fenopy.se/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Fenopy Tango Secure Gateway CA
... ELSE Create List Fenopy Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni SSL
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,143 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Monitor-DNS-00001
[Tags] Monitor IP DNS
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"DNS"} isValid=${1} appIdObjects=${DNS_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string":"32" }
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "252.252.252.252","port": "443","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d twitter.com
... ELSE set variable nslookup twitter.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List twitter.com
... ELSE Create List twitter.com
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} dns_qname DNS
SecurityPolicy-Monitor-DNS-00002
[Tags] Monitor IP DNS QNAME
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*www.youtube.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"DNS"} filterList=${objectId1}|TSG_FIELD_DNS_QNAME isValid=${1} appIdObjects=${DNS_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${qname_fqdn_id} Create Dictionary attributeType=string attributeName=qname appId=32 appName=dns protocol=dns attributeValue={"string": "www.youtube.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string":"32" }
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "252.252.252.252","port": "443","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${qname_fqdn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.youtube.com 8.8.8.8
... ELSE set variable nslookup -debug -query=A \ www.youtube.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List www.youtube.com
... ELSE Create List www.youtube.com
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} dns_qname www.youtube.com

View File

@@ -1,347 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
Library OperatingSystem
Library Custometest
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Monitor-FTP-00001
[Tags] Monitor IP FTP
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"FTP"} isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "45"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/123456.txt -u ftpuser:111111 123456789qwertyuiop
# should contain ${FTP} success
run keyword if '${systemType}'=='Windows' should contain ${FTP} success
... ELSE should contain ${FTP} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ftp_account FTP
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Monitor-FTP-00002
[Tags] Monitor IP FTP Account URI Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=*user isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建URI
${addItemList1} Create Dictionary keywordArray=*123456.txt isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Content
${addItemList1} Create Dictionary keywordArray=*qwertyuiop isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"FTP"} filterList=${objectId1}|TSG_FIELD_FTP_ACCOUNT,${objectId3}|TSG_FIELD_FTP_CONTENT,${objectId2}|TSG_FIELD_FTP_URI isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url} Create Dictionary attributeType=string attributeName=url appId=45 appName=ftp protocol=ftp attributeValue={"string": "192.168.40.158/123456.txt"}
${Content} Create Dictionary attributeType=string attributeName=content appId=45 appName=ftp protocol=http attributeValue={"string": "123456789qwertyuiop"}
${Account} Create Dictionary attributeType=string attributeName=account appId=45 appName=ftp protocol=http attributeValue={"string": "ftpuser"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "45"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url} ${Content} ${Account}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/123456.txt -u ftpuser:111111 123456789qwertyuiop
# should contain ${FTP} success
run keyword if '${systemType}'=='Windows' should contain ${FTP} success
... ELSE should contain ${FTP} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ftp_account ftpuser
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Monitor-FTP-00003
[Tags] Monitor IP FTP Account
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=*user isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"FTP"} filterList=${objectId1}|TSG_FIELD_FTP_ACCOUNT isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${Account} Create Dictionary attributeType=string attributeName=account appId=45 appName=ftp protocol=http attributeValue={"string": "ftpuser"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "45"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${Account}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/123456.txt -u ftpuser:111111 123456789qwertyuiop
# should contain ${FTP} success
run keyword if '${systemType}'=='Windows' should contain ${FTP} success
... ELSE should contain ${FTP} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ftp_account ftpuser
SecurityPolicy-Monitor-FTP-00004
[Tags] Monitor IP FTP URI
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建URI
${addItemList1} Create Dictionary keywordArray=*123456.txt isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"FTP"} filterList=${objectId2}|TSG_FIELD_FTP_URI isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url} Create Dictionary attributeType=string attributeName=url appId=45 appName=ftp protocol=ftp attributeValue={"string": "192.168.40.158/123456.txt"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "45"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/123456.txt -u ftpuser:111111 123456789qwertyuiop
# should contain ${FTP} success
run keyword if '${systemType}'=='Windows' should contain ${FTP} success
... ELSE should contain ${FTP} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ftp_account ftpuser
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Monitor-FTP-00005
[Tags] Monitor IP FTP Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Content
${addItemList1} Create Dictionary keywordArray=*qwertyuiop isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"FTP"} filterList=${objectId3}|TSG_FIELD_FTP_CONTENT isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${Content} Create Dictionary attributeType=string attributeName=content appId=45 appName=ftp protocol=http attributeValue={"string": "123456789qwertyuiop"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "45"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${Content}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/123456.txt -u ftpuser:111111 123456789qwertyuiop
# should contain ${FTP} success
run keyword if '${systemType}'=='Windows' should contain ${FTP} success
... ELSE should contain ${FTP} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ftp_account ftpuser
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,809 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url1} /v1/policy/profile/responsepages
*** Test Cases ***
SecurityPolicy-Monitor-HTTP-00001
[Tags] Monitor IP HTTP
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Monitor_HTTP_00002.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Monitor_HTTP_00002_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List Fitzhugh Media
... ELSE Create List Fitzhugh Media
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host HTTP
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Monitor-HTTP-00002
[Tags] Monitor IP HTTP FQDN
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*fitzhughmedia.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${qname_fqdn_id} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "fitzhughmedia.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${qname_fqdn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Monitor_HTTP_00002.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Monitor_HTTP_00002_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List Fitzhugh Media
... ELSE Create List Fitzhugh Media
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host fitzhughmedia.com
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Monitor-HTTP-00003
[Tags] Monitor IP HTTP URL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=portal/zh_CN/home/index.html isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=www.nuk-baby.ru* isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=davidsmithhunting.com isHexbin=${0}
${addItemList4} Create Dictionary keywordArray=crosswordheaven isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=Monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${url} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "www.hkbchina.com/portal/zh_CN/home/index.html"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${url}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Monitor_HTTP_00003.bat
... ELSE set variable curl http://www.hkbchina.com/portal/zh_CN/home/index.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 汉口银行
... ELSE Create List 汉口银行
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Monitor_HTTP_00003_1.bat
... ELSE set variable curl http://www.nuk-baby.ru/ru_ru/kollekcii/disney-mickey-mouse.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Поиск
... ELSE Create List Поиск
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Monitor_HTTP_00003_2.bat
... ELSE set variable curl http://davidsmithhunting.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List David Smith
... ELSE Create List David Smith
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Monitor_HTTP_00003_3.bat
... ELSE set variable curl http://crosswordheaven.com/search
${stringlist} run keyword if '${systemType}'=='Windows' Create List Search
... ELSE Create List Search
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host hkbchina.com
Should Be Equal As Strings ${returnvalue} true
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host baby.ru
Should Be Equal As Strings ${returnvalue} true
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host davidsmithhunting.com
Should Be Equal As Strings ${returnvalue} true
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host crosswordheaven.com
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Monitor-HTTP-00004
[Tags] Monitor IP HTTP User-Agent
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${req_hdr_ua}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Monitor_HTTP_00004.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Monitor_HTTP_00004_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List Motivational
... ELSE Create List Motivational
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host quotes.info
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Monitor-HTTP-00005
[Tags] Monitor IP HTTP Content-Type
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=*html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${res_hdr_ct}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Monitor_HTTP_yumi.bat
... ELSE set variable curl http://www.yumi.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 服务平台
... ELSE Create List 服务平台
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host www.yumi.com
SecurityPolicy-Monitor-HTTP-00006
[Tags] Monitor IP HTTP Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=wingsofprey isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "wingsofprey","district": "Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${req_hdr_ck}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Monitor_HTTP_00012.bat
... ELSE set variable curl -kv --cookie "*wingsofprey=jkmg7dm2dqjhf4514u0ehjde45; __utma=1.780132397.1593856991.1593856991.1593856991.1; __utmc=1; __utmz=1.1593856991.1.1.utmcsr=lvse.cn" --referer 'http://www.baidu.com/' \ http://www.titter.com/en/games/jack-stone.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Scooby Doo Adventure 3
... ELSE Create List Scooby Doo Adventure 3
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host www.titter.com
SecurityPolicy-Monitor-HTTP-00007
[Tags] Monitor IP HTTP Set-Cookie
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=domain=www.spore isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=Monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "domain=www.spore","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${res_hdr_sc}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Monitor_HTTP_00013.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Monitor_HTTP_00013_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List www.spore.com
... ELSE Create List www.spore.com
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host www.spore.com
SecurityPolicy-Monitor-HTTP-00008
[Tags] Monitor IP HTTP Request Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Request Content
${addItemList1} Create Dictionary keywordArray=monitortest141 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${req_body} Create Dictionary attributeType=string attributeName=req_body appId=67 appName=http protocol=http attributeValue={"string": "monitortest141"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${req_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Monitor_HTTP_00014.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Monitor_HTTP_00014_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List monitortest141
... ELSE Create List monitortest141
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Monitor-HTTP-00009
[Tags] Monitor IP HTTP Response Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment Response Content
${addItemList1} Create Dictionary keywordArray=华彤公司 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${res_body} Create Dictionary attributeType=string attributeName=res_body appId=67 appName=http protocol=http attributeValue={"string": "华彤公司"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${res_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00015.bat
... ELSE set variable curl -m 10 -kv http://www.huatonggs.com/about.html#gsjj
${stringlist} run keyword if '${systemType}'=='Windows' Create List 华彤公司
... ELSE Create List 华彤公司
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host huatonggs.com
SecurityPolicy-Monitor-HTTP-00010
[Tags] Monitor IP HTTP FQDN URL User-Agent Content-Type Request Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=open.node isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment User-Agent
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Content-Type
${addItemList1} Create Dictionary keywordArray=charset isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment Request Content
${addItemList1} Create Dictionary keywordArray=MonitorHttp0016 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId5} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId5}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR,${objectId5}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${qname_fqdn_id} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "open.node.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "open.node.com/"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "Mozilla/5.0","district": "User-Agent"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "charset","district": "Content-Type"}
${req_body} Create Dictionary attributeType=string attributeName=req_body appId=67 appName=http protocol=http attributeValue={"string": "testMonitorHttp0016"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${qname_fqdn_id} ${url} ${req_hdr_ua} ${res_hdr_ct} ${req_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00016.bat
... ELSE set variable curl -m 10 -kv -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{"requestbody":"MonitorHttp0016","setcook":"asdf","contenttype": "charsetMonitor0016","responsebody": "adzx"}" -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' http://open.node.com:180/go
${stringlist} run keyword if '${systemType}'=='Windows' Create List MonitorHttp0016
... ELSE Create List MonitorHttp0016
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Monitor-HTTP-00011
[Tags] Monitor IP HTTP FQDN URL Cookie Set-Cookie Response Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*smspunch.net isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*send-free-sms.aspx isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment Cookie
${addItemList1} Create Dictionary keywordArray=_ym_isad=2 isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment Set-Cookie
${addItemList1} Create Dictionary keywordArray=NET_SessionId isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment Response Content
${addItemList1} Create Dictionary keywordArray=Cell No isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId5} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId5}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${objectId2}|TSG_FIELD_HTTP_URL,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR,${objectId5}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${fqdn} Create Dictionary attributeType=string attributeName=host appId=67 appName=http protocol=http attributeValue={"string": "smspunch.net"}
${url} Create Dictionary attributeType=string attributeName=url appId=67 appName=http protocol=http attributeValue={"string": "smspunch.net/send-free-sms.aspx"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=67 appName=http protocol=http attributeValue={"string": "_ym_isad=2","district": "Cookie"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=67 appName=http protocol=http attributeValue={"string": "NET_SessionId","district": "Set-Cookie"}
${res_body} Create Dictionary attributeType=string attributeName=res_body appId=67 appName=http protocol=http attributeValue={"string": "Cell No"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "67"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ck} ${res_hdr_sc} ${res_body}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00017.bat
... ELSE set variable curl -m 10 -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://smspunch.net/send-free-sms.aspx
${stringlist} run keyword if '${systemType}'=='Windows' Create List smspunch.net
... ELSE Create List smspunch.net
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} http_host smspunch.net

View File

@@ -1,849 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../02-Keyword/tsg_common/StmpHandle.robot
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Monitor-Mail-00001
[Tags] Monitor IP MAIL Subject Account Content ATT_CONT From To
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=$人生路远及时行乐 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=dxy135222* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Content
${addItemList1} Create Dictionary keywordArray=good isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment 创建ATT_CONT
${addItemList1} Create Dictionary keywordArray=Простопорно isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment 创建创建From
${addItemList1} Create Dictionary keywordArray=dxy135222 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId5} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId5}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=115751 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId6} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId6}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"MAIL"} filterList=${objectId2}|TSG_FIELD_MAIL_ACCOUNT,${objectId1}|TSG_FIELD_MAIL_SUBJECT,${objectId3}|TSG_FIELD_MAIL_CONTENT,${objectId4}|TSG_FIELD_MAIL_ATT_CONTENT,${objectId5}|TSG_FIELD_MAIL_FROM,${objectId6}|TSG_FIELD_MAIL_TO isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=8004 appName=mail protocol=mail attributeValue={"string": "人生路远及时行乐"}
${content_id} Create Dictionary attributeType=string attributeName=content appId=8004 appName=mail protocol=mail attributeValue={"string": "good"}
${att_content_id} Create Dictionary attributeType=string attributeName=att_content appId=8004 appName=mail protocol=mail attributeValue={"string": "Простопорно"}
${account_id} Create Dictionary attributeType=string attributeName=account appId=8004 appName=mail protocol=mail attributeValue={"string": "dxy135222@163.com"}
${from_id} Create Dictionary attributeType=string attributeName=from appId=8004 appName=mail protocol=mail attributeValue={"string": "dxy135222@163.com"}
${to_id} Create Dictionary attributeType=string attributeName=to appId=8004 appName=mail protocol=mail attributeValue={"string": "l1157517579@163.com"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "8004"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${subject_id} ${content_id} ${att_content_id} ${from_id} ${to_id} ${account_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount163Dxy}
${邮箱密码} Set Variable ${mailPasswordDxy}
${邮件主题} Set Variable 人生路远及时行乐
${发送者} Set Variable ${mailAccount163Dxy}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccount163Lyf}"]
${抄送者} Set Variable ["${mailAccount163Lyf}"]
${密送者} Set Variable ["${mailAccount163Lyf}"]
${邮件正文} Set Variable good
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} success
... ELSE should contain ${发送邮件返回结果} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} mail_account ${mailAccount163Dxy}
SecurityPolicy-Monitor-Mail-00002
[Tags] Monitor IP MAIL Subject ATT_NAME Content ATT_CONT From To
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=$人生路远及时行乐 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建ATT_NAME
${addItemList1} Create Dictionary keywordArray=测试文件 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Content
${addItemList1} Create Dictionary keywordArray=good isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment 创建ATT_CONT
${addItemList1} Create Dictionary keywordArray=Простопорно isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId4}
Comment 创建创建From
${addItemList1} Create Dictionary keywordArray=dxy135222 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId5} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId5}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=115751 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId6} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId6}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"MAIL"} filterList=${objectId2}|TSG_FIELD_MAIL_ATT_NAME,${objectId1}|TSG_FIELD_MAIL_SUBJECT,${objectId3}|TSG_FIELD_MAIL_CONTENT,${objectId4}|TSG_FIELD_MAIL_ATT_CONTENT,${objectId5}|TSG_FIELD_MAIL_FROM,${objectId6}|TSG_FIELD_MAIL_TO isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=8004 appName=mail protocol=mail attributeValue={"string": "人生路远及时行乐"}
${content_id} Create Dictionary attributeType=string attributeName=content appId=8004 appName=mail protocol=mail attributeValue={"string": "good"}
${att_content_id} Create Dictionary attributeType=string attributeName=att_content appId=8004 appName=mail protocol=mail attributeValue={"string": "Простопорно"}
${att_name_id} Create Dictionary attributeType=string attributeName=att_name appId=8004 appName=mail protocol=mail attributeValue={"string": "测试文件"}
${from_id} Create Dictionary attributeType=string attributeName=from appId=8004 appName=mail protocol=mail attributeValue={"string": "dxy135222@163.com"}
${to_id} Create Dictionary attributeType=string attributeName=to appId=8004 appName=mail protocol=mail attributeValue={"string": "l1157517579@163.com"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "8004"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${subject_id} ${content_id} ${att_content_id} ${from_id} ${to_id} ${att_name_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount163Dxy}
${邮箱密码} Set Variable ${mailPasswordDxy}
${邮件主题} Set Variable 人生路远及时行乐
${发送者} Set Variable ${mailAccount163Dxy}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccount163Lyf}"]
${抄送者} Set Variable ["${mailAccount163Lyf}"]
${密送者} Set Variable ["${mailAccount163Lyf}"]
${邮件正文} Set Variable good
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} success
... ELSE should contain ${发送邮件返回结果} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} mail_account ${mailAccount163Dxy}
SecurityPolicy-Monitor-Mail-00003
[Tags] Monitor IP MAIL Subject
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=$人生路远及时行乐 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"MAIL"} filterList=${objectId1}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=8004 appName=mail protocol=mail attributeValue={"string": "人生路远及时行乐"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "8004"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${subject_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount163Dxy}
${邮箱密码} Set Variable ${mailPasswordDxy}
${邮件主题} Set Variable 人生路远及时行乐
${发送者} Set Variable ${mailAccount163Dxy}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccount163Lyf}"]
${抄送者} Set Variable ["${mailAccount163Lyf}"]
${密送者} Set Variable ["${mailAccount163Lyf}"]
${邮件正文} Set Variable good
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} success
... ELSE should contain ${发送邮件返回结果} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} mail_account ${mailAccount163Dxy}
SecurityPolicy-Monitor-Mail-00004
[Tags] Monitor IP MAIL Content
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Content
${addItemList1} Create Dictionary keywordArray=good isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"MAIL"} filterList=${objectId1}|TSG_FIELD_MAIL_CONTENT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${content_id} Create Dictionary attributeType=string attributeName=content appId=8004 appName=mail protocol=mail attributeValue={"string": "good"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "8004"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${content_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount163Dxy}
${邮箱密码} Set Variable ${mailPasswordDxy}
${邮件主题} Set Variable 人生路远及时行乐
${发送者} Set Variable ${mailAccount163Dxy}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccount163Lyf}"]
${抄送者} Set Variable ["${mailAccount163Lyf}"]
${密送者} Set Variable ["${mailAccount163Lyf}"]
${邮件正文} Set Variable good
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} success
... ELSE should contain ${发送邮件返回结果} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} mail_account ${mailAccount163Dxy}
SecurityPolicy-Monitor-Mail-00005
[Tags] Monitor IP MAIL ATT_NAME
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建ATT_NAME
${addItemList1} Create Dictionary keywordArray=测试文件 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"MAIL"} filterList=${objectId1}|TSG_FIELD_MAIL_ATT_NAME isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${att_name_id} Create Dictionary attributeType=string attributeName=att_name appId=8004 appName=mail protocol=mail attributeValue={"string": "测试文件"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "8004"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${att_name_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount163Dxy}
${邮箱密码} Set Variable ${mailPasswordDxy}
${邮件主题} Set Variable 人生路远及时行乐
${发送者} Set Variable ${mailAccount163Dxy}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccount163Lyf}"]
${抄送者} Set Variable ["${mailAccount163Lyf}"]
${密送者} Set Variable ["${mailAccount163Lyf}"]
${邮件正文} Set Variable good
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} success
... ELSE should contain ${发送邮件返回结果} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} mail_account ${mailAccount163Dxy}
SecurityPolicy-Monitor-Mail-00006
[Tags] Monitor IP MAIL ATT_CONT
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建ATT_CONT
${addItemList1} Create Dictionary keywordArray=Простопорно isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"MAIL"} filterList=${objectId1}|TSG_FIELD_MAIL_ATT_CONTENT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${att_content_id} Create Dictionary attributeType=string attributeName=att_content appId=8004 appName=mail protocol=mail attributeValue={"string": "Простопорно"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "8004"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${att_content_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount163Dxy}
${邮箱密码} Set Variable ${mailPasswordDxy}
${邮件主题} Set Variable 人生路远及时行乐
${发送者} Set Variable ${mailAccount163Dxy}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccount163Lyf}"]
${抄送者} Set Variable ["${mailAccount163Lyf}"]
${密送者} Set Variable ["${mailAccount163Lyf}"]
${邮件正文} Set Variable good
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} success
... ELSE should contain ${发送邮件返回结果} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} mail_account ${mailAccount163Dxy}
SecurityPolicy-Monitor-Mail-00007
[Tags] Monitor IP MAIL From
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建创建From
${addItemList1} Create Dictionary keywordArray=dxy135222 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"MAIL"} filterList=${objectId1}|TSG_FIELD_MAIL_FROM isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${from_id} Create Dictionary attributeType=string attributeName=from appId=8004 appName=mail protocol=mail attributeValue={"string": "dxy135222@163.com"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "8004"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${from_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount163Dxy}
${邮箱密码} Set Variable ${mailPasswordDxy}
${邮件主题} Set Variable 人生路远及时行乐
${发送者} Set Variable ${mailAccount163Dxy}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccount163Lyf}"]
${抄送者} Set Variable ["${mailAccount163Lyf}"]
${密送者} Set Variable ["${mailAccount163Lyf}"]
${邮件正文} Set Variable good
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} success
... ELSE should contain ${发送邮件返回结果} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} mail_account ${mailAccount163Dxy}
SecurityPolicy-Monitor-Mail-00008
[Tags] Monitor IP MAIL To
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=115751 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"MAIL"} filterList=${objectId1}|TSG_FIELD_MAIL_TO isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${to_id} Create Dictionary attributeType=string attributeName=to appId=8004 appName=mail protocol=mail attributeValue={"string": "l1157517579@163.com"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "8004"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${to_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount163Dxy}
${邮箱密码} Set Variable ${mailPasswordDxy}
${邮件主题} Set Variable 人生路远及时行乐
${发送者} Set Variable ${mailAccount163Dxy}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccount163Lyf}"]
${抄送者} Set Variable ["${mailAccount163Lyf}"]
${密送者} Set Variable ["${mailAccount163Lyf}"]
${邮件正文} Set Variable good
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} success
... ELSE should contain ${发送邮件返回结果} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} mail_account ${mailAccount163Dxy}
SecurityPolicy-Monitor-Mail-00009
[Tags] Monitor IP MAIL Account
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=dxy135222* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"MAIL"} filterList=${objectId1}|TSG_FIELD_MAIL_ACCOUNT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${account_id} Create Dictionary attributeType=string attributeName=account appId=8004 appName=mail protocol=mail attributeValue={"string": "dxy135222@163.com"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "8004"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${account_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount163Dxy}
${邮箱密码} Set Variable ${mailPasswordDxy}
${邮件主题} Set Variable 人生路远及时行乐
${发送者} Set Variable ${mailAccount163Dxy}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccount163Lyf}"]
${抄送者} Set Variable ["${mailAccount163Lyf}"]
${密送者} Set Variable ["${mailAccount163Lyf}"]
${邮件正文} Set Variable good
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} success
... ELSE should contain ${发送邮件返回结果} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} mail_account ${mailAccount163Dxy}
SecurityPolicy-Monitor-Mail-00010
[Tags] Monitor IP MAIL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"MAIL"} isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "8004"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount163Dxy}
${邮箱密码} Set Variable ${mailPasswordDxy}
${邮件主题} Set Variable 人生路远及时行乐
${发送者} Set Variable ${mailAccount163Dxy}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccount163Lyf}"]
${抄送者} Set Variable ["${mailAccount163Lyf}"]
${密送者} Set Variable ["${mailAccount163Lyf}"]
${邮件正文} Set Variable good
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} success
... ELSE should contain ${发送邮件返回结果} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} mail_account mail_from_cmd

View File

@@ -1,77 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
Library OperatingSystem
Library Selenium2Library
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Monitor-QUCI-00001
[Tags] Monitor IP QUIC
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"QUCI"} isValid=${1} appIdObjects=${QUIC_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "2521"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
Open Browser https://www.facebook.com ${browserType}
sleep 2
${text} Get Text xpath=//*[@id="content"]/div/div/div/div[1]/h2
Should Be Equal As Strings ${text} 联系你我,分享生活,尽在 Facebook
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} common_schema_type QUIC
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,356 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObjectAndApplicationAndSignature ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security
Library OperatingSystem
Library Selenium2Library
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
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Monitor-SSL-00001
[Tags] Monitor IP SSL SNI SAN CN
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建SNI
${addItemList1} Create Dictionary keywordArray=*academia.org isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建CN
${addItemList1} Create Dictionary keywordArray=*academia.org isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建SAN
${addItemList1} Create Dictionary keywordArray=*academia.org isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL"} filterList=${objectId3}|TSG_FIELD_SSL_SAN,${objectId1}|TSG_FIELD_SSL_SNI,${objectId2}|TSG_FIELD_SSL_CN isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${sni} Create Dictionary attributeType=string attributeName=sni appId=199 appName=ssl protocol=ssl attributeValue={"string": "academia.org"}
${cn} Create Dictionary attributeType=string attributeName=cn appId=199 appName=ssl protocol=ssl attributeValue={"string": "academia.org"}
${san} Create Dictionary attributeType=string attributeName=san appId=199 appName=ssl protocol=ssl attributeValue={"string": "academia.org"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "199"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${sni} ${cn} ${san}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Monitor_SSL_00003.bat
... ELSE set variable curl https://www.academia.org/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Accuracy In Academia
... ELSE Create List Accuracy In Academia
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni www.academia.org
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Monitor-SSL-00002
[Tags] Monitor IP SSL SNI
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建SNI
${addItemList1} Create Dictionary keywordArray=*freecountry.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId1}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL"} filterList=${objectId1}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${sni} Create Dictionary attributeType=string attributeName=sni appId=199 appName=ssl protocol=ssl attributeValue={"string": "freecountry.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "199"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${sni}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Monitor_SSL_00001_1.bat
... ELSE set variable curl \ https://freecountry.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Jackets
... ELSE Create List Jackets
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni freecountry.com
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Monitor-SSL-00003
[Tags] Monitor IP SSL CN
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建CN
${addItemList1} Create Dictionary keywordArray=*keysnews.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId2}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL"} filterList=${objectId2}|TSG_FIELD_SSL_CN isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${cn} Create Dictionary attributeType=string attributeName=cn appId=199 appName=ssl protocol=ssl attributeValue={"string": "keysnews.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "199"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${cn}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Monitor_SSL_00002.bat
... ELSE set variable curl https://www.keysnews.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List keysnews.com
... ELSE Create List keysnews.com
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni www.keysnews.com
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Monitor-SSL-00004
[Tags] Monitor IP SSL SAN
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建SAN
${addItemList1} Create Dictionary keywordArray=*academia.org isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict1} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict1}
${objectids} Catenate SEPARATOR=, ${objectids} ${objectId3}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL"} filterList=${objectId3}|TSG_FIELD_SSL_SAN isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${san} Create Dictionary attributeType=string attributeName=san appId=199 appName=ssl protocol=ssl attributeValue={"string": "academia.org"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "199"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination} ${san}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Monitor_SSL_00003.bat
... ELSE set variable curl https://www.academia.org/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Accuracy In Academia
... ELSE Create List Accuracy In Academia
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni www.academia.org
Should Be Equal As Strings ${returnvalue} true
SecurityPolicy-Monitor-SSL-00005
[Tags] Monitor IP SSL
Comment 创建IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Monitor策略
${policyDict} Create Dictionary policyName=${TEST NAME} policyType=tsg_security action=monitor source=${objectId}|TSG_SECURITY_SOURCE_ADDR userRegion={"protocol":"SSL"} isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyIds} set Variable ${policyId}[0][policyIds][0]
${starttime} Get Time
#功能端验证
Sleep ${policyVerificationSleepSeconds}s
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "199"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${objectids}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${policyIds}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Monitor_SSL_00003.bat
... ELSE set variable curl https://www.academia.org/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Accuracy In Academia
... ELSE Create List Accuracy In Academia
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} ssl_sni SSL
Should Be Equal As Strings ${returnvalue} true

View File

@@ -1,24 +0,0 @@
*** Settings ***
Force Tags basic_function_check adc_api security_policy check_intercept
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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
*** Variables ***
*** Test Cases ***
SecurityPolicy-Intercept-001
[Tags] update policy:source geo
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-001 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID},${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 intercept_ssl_policyId ${policyId}

View File

@@ -1,257 +0,0 @@
*** Settings ***
Force Tags basic_function_check adc_api security_policy check_allow
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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
*** Variables ***
*** Test Cases ***
ProxyPolicy-allow-Check-001
[Tags] fqdn完全匹配 URL子串匹配 请求头UA-子串匹配 请求头Cookie-子串匹配 应答头Content-Type-子串匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.52pojie.cn
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=misc.php
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建请求头UA
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0|User-Agent
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建请求头Cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=htVD_|Cookie
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
Comment 创建应答头Content-Type
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html|Content-Type
${rescode} ${objectId4} AddObject2 ${1} ${objectDict}
Comment 创建allow策略
${policyDict} Create Dictionary policyName=ProxyPolicy-allow-Check-001 policyType=pxy_manipulation policyDesc=autotest
... action=allow userRegion={"method":"allow","protocol":"HTTP"}
... filterList=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId ${objectId}
insert_policyId_to_file1 allow_objectId39 ${objectId1}
insert_policyId_to_file1 allow_objectId40 ${objectId2}
insert_policyId_to_file1 allow_objectId41 ${objectId3}
insert_policyId_to_file1 allow_objectId42 ${objectId4}
insert_policyId_to_file1 allow_policyId ${policyId2}
ProxyPolicy-allow-Check-002
[Tags] fqdn右匹配 URL左匹配 请求头UA-左匹配 应答头Set-Cookie-左匹配 应答头Content-Type-左匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*wancai.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=www.wancai*
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建请求头UA
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建应答头Set-Cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=SERVERID=1*|Set-Cookie
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
Comment 创建应答头Content-Type
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text*|Content-Type
${rescode} ${objectId4} AddObject2 ${1} ${objectDict}
Comment 创建allow策略
${policyDict} Create Dictionary policyName=ProxyPolicy-allow-Check-002 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"}
... filterList=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId ${objectId}
insert_policyId_to_file1 allow_objectId39 ${objectId1}
insert_policyId_to_file1 allow_objectId40 ${objectId2}
insert_policyId_to_file1 allow_objectId41 ${objectId3}
insert_policyId_to_file1 allow_objectId42 ${objectId4}
insert_policyId_to_file1 allow_policyId ${policyId2}
ProxyPolicy-allow-Check-003
[Tags] fqdn完全匹配 URL右匹配 请求头UA-右匹配 应答头Set-Cookie-右匹配 应答头Content-Type-右匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.stonexp.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=stonexp
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建请求头UA
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建应答头Set-Cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*path=/|Set-Cookie
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
Comment 创建应答头Content-Type
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*utf-8|Content-Type
${rescode} ${objectId4} AddObject2 ${1} ${objectDict}
Comment 创建allow策略
${policyDict} Create Dictionary policyName=ProxyPolicy-allow-Check-003 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"}
... filterList=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId ${objectId}
insert_policyId_to_file1 allow_objectId39 ${objectId1}
insert_policyId_to_file1 allow_objectId40 ${objectId2}
insert_policyId_to_file1 allow_objectId41 ${objectId3}
insert_policyId_to_file1 allow_objectId42 ${objectId4}
insert_policyId_to_file1 allow_policyId ${policyId2}
ProxyPolicy-allow-Check-004
[Tags] fqdn完全匹配 URL完全匹配 请求头UA-完全匹配 应答头Content-Type-完全匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.qnly.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$www.qnly.com/tours/
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建请求头UA
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36|User-Agent
log ${objectDict}
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
log ${rescode}
Comment 创建应答头Content-Type
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
Comment 创建allow策略
${policyDict} Create Dictionary policyName=ProxyPolicy-allow-Check-004 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"}
... filterList=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR,${objectId3}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId ${objectId}
insert_policyId_to_file1 allow_objectId39 ${objectId1}
insert_policyId_to_file1 allow_objectId40 ${objectId2}
insert_policyId_to_file1 allow_objectId42 ${objectId3}
insert_policyId_to_file1 allow_policyId ${policyId2}
ProxyPolicy-allow-Check-005
[Tags] fqdn完全匹配 URL子串匹配 请求头UA-16进制 应答头Set-Cookie-16进制 应答头Content-Type-16进制
#
#
#
#暂未找到16进制关键字
#
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.5ytb.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=5ytb
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建请求头UA
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=4d6f7a696c6c612f352e30|User-Agent
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建请求头Set-Cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=487474704f6e6c79|Set-Cookie
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
Comment 创建应答头Content-Type
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=74657874|Content-Type
${rescode} ${objectId4} AddObject2 ${1} ${objectDict}
Comment 创建allow策略
${policyDict} Create Dictionary policyName=ProxyPolicy-allow-Check-005 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"}
... filterList=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId ${objectId}
insert_policyId_to_file1 allow_objectId39 ${objectId1}
insert_policyId_to_file1 allow_objectId40 ${objectId2}
insert_policyId_to_file1 allow_objectId41 ${objectId3}
insert_policyId_to_file1 allow_objectId42 ${objectId4}
insert_policyId_to_file1 allow_policyId ${policyId2}
ProxyPolicy-allow-Check-006
[Tags] fqdn右匹配 URL子串匹配 请求头UA-16进制 应答头Set-Cookie-子串匹配 应答头Content-Type-16进制
#
#
#
#
#暂未找到16进制
#
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.52pojie.cn
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=misc.php
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建请求头UA
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0|User-Agent
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建请求头Cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=htVD_|Cookie
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
Comment 创建应答头Content-Type
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html|Content-Type
${rescode} ${objectId4} AddObject2 ${1} ${objectDict}
Comment 创建allow策略
${policyDict} Create Dictionary policyName=ProxyPolicy-allow-Check-006 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"}
... filterList=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR,${objectId3}|TSG_FIELD_HTTP_REQ_HDR,${objectId4}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId ${objectId}
insert_policyId_to_file1 allow_objectId39 ${objectId1}
insert_policyId_to_file1 allow_objectId40 ${objectId2}
insert_policyId_to_file1 allow_objectId41 ${objectId3}
insert_policyId_to_file1 allow_objectId42 ${objectId4}
insert_policyId_to_file1 allow_policyId ${policyId2}

View File

@@ -1,105 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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
*** Test Cases ***
SecurityPolicy-Allow-Http-00001
[Tags] fqdn right match,whole world match,ip geo,url
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*clintonairport.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=$clintonairport.com/airlines-flights/covid/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
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
${addItemList1} Create Dictionary keywordArray=$www.66rpg.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
Comment 创建url2
${addItemList1} Create Dictionary keywordArray=66rpg isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
Comment 创建categories
${addItemList1} Create Dictionary fqdn=*clintonairport.com
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary categoryType=fqdn categoryName=feiji objectSubType=category isValid=${1} fqdnList=${addItemLists}
${rescode} ${categoryObjId} ${categoryId} AddCategories ${1} ${objectDict} add 200
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Http-00001 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL,${categoryObjId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_http_objectId ${objectId}
insert_policyId_to_file1 allow_http_objectId2 ${objectId1}
insert_policyId_to_file1 allow_http_objectId3 ${objectId2}
insert_policyId_to_file1 allow_http_objectId4 ${objectId3}
insert_policyId_to_file1 allow_http_objectId5 ${objectId4}
insert_policyId_to_file1 allow_http_policyId ${policyId}
insert_policyId_to_file1 allow_http_categoryId ${categoryId}
SecurityPolicy-Allow-Http-00002
[Tags] cat,fqdn 完全匹配,url左匹配 update policy:url右匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$scoutbahamas.org isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=scoutbah* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=*ang5.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建url2
${addItemList1} Create Dictionary keywordArray=*w.xiang5.com/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Http-00002 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_http_objectId1 ${objectId}
insert_policyId_to_file1 allow_http_objectId6 ${objectId1}
insert_policyId_to_file1 allow_http_objectId7 ${objectId2}
insert_policyId_to_file1 allow_http_objectId8 ${objectId3}
insert_policyId_to_file1 allow_http_policyId1 ${policyId}
SecurityPolicy-Allow-Http-00003
[Tags] the minimum match
Comment 与allow00002组合验证筛选条件优先级
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Http-00003 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"HTTP"} isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_http_policyId2 ${policyId}

View File

@@ -1,175 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_policy Trusted_Certificate_Authorities
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
*** Test Cases ***
SecurityPolicy-Allow-Rtp-00001
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建目的IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipOutListenIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Rtp-00001 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"RTP"} source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_rtp_objectId8 ${object_Ip_Id}
insert_policyId_to_file1 allow_rtp_objectId9 ${object_Ip_Id1}
insert_policyId_to_file1 allow_rtp_policyId ${policyId}
SecurityPolicy-Allow-Rtp-00002
[Tags] calling ip port source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Rtp-00002 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"RTP"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${1} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_rtp_objectId ${objectId}
insert_policyId_to_file1 allow_rtp_policyId1 ${policyId}
SecurityPolicy-Allow-Rtp-00003
[Tags] calling subid source
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Rtp-00003 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"RTP"} defaultClient=clientsubid isValid=${1} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_rtp_policyId2 ${policyId}
SecurityPolicy-Allow-Rtp-00004
[Tags] calling ip geo source
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Rtp-00004 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"RTP"} source=${objectId}|TSG_SECURITY_SOURCE_LOCATION isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_rtp_objectId1 ${objectId}
insert_policyId_to_file1 allow_rtp_policyId3 ${policyId}
SecurityPolicy-Allow-Rtp-00005
[Tags] called domain ip source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Rtp-00005 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"RTP"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${1} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_rtp_objectId2 ${objectId}
insert_policyId_to_file1 allow_rtp_policyId4 ${policyId}
SecurityPolicy-Allow-Rtp-00006
[Tags] called domain ip port source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Rtp-00006 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"RTP"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${1} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_rtp_objectId3 ${objectId}
insert_policyId_to_file1 allow_rtp_policyId5 ${policyId}
SecurityPolicy-Allow-Rtp-00007
[Tags] called domain ip geo source
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Rtp-00007 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"RTP"} source=${objectId}|TSG_SECURITY_SOURCE_LOCATION isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_rtp_objectId4 ${objectId}
insert_policyId_to_file1 allow_rtp_policyId6 ${policyId}
SecurityPolicy-Allow-Rtp-00008
[Tags] called domain ip des
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Rtp-00008 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"RTP"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_rtp_objectId5 ${objectId}
insert_policyId_to_file1 allow_rtp_policyId7 ${policyId}
SecurityPolicy-Allow-Rtp-00009
[Tags] called domain ip port des
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Rtp-00009 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"RTP"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_rtp_objectId6 ${objectId}
insert_policyId_to_file1 allow_rtp_policyId8 ${policyId}
SecurityPolicy-Allow-Rtp-000010
[Tags] called domain ip geo des
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Rtp-000010 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"RTP"} destination=${objectId}|TSG_SECURITY_DESTINATION_LOCATION isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_rtp_objectId7 ${objectId}
insert_policyId_to_file1 allow_rtp_policyId9 ${policyId}

View File

@@ -1,457 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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
*** Test Cases ***
SecurityPolicy-Allow-SIP-00001
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建from
${addItemList1} Create Dictionary keywordArray=test1 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-00001 policyType=tsg_security policyDesc=autotest action=allow source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION userRegion={"protocol":"SIP"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_policyId ${policyId}
insert_policyId_to_file1 allow_sip_objectId ${object_Ip_Id}
insert_policyId_to_file1 allow_sip_objectId1 ${object_Account_Id1}
SecurityPolicy-Allow-SIP-00001-1
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建目的IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipListenIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
Comment 创建from
${addItemList1} Create Dictionary keywordArray=test102 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-00001 policyType=tsg_security policyDesc=autotest action=allow source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION userRegion={"protocol":"SIP"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_policyId16 ${policyId}
insert_policyId_to_file1 allow_sip_objectId30 ${object_Ip_Id}
insert_policyId_to_file1 allow_sip_objectId38 ${object_Ip_Id1}
insert_policyId_to_file1 allow_sip_objectId31 ${object_Account_Id1}
SecurityPolicy-Allow-SIP-00001-2
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建目的IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipListenIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
Comment 创建from
${addItemList1} Create Dictionary keywordArray=test6 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-00001 policyType=tsg_security policyDesc=autotest action=allow source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION userRegion={"protocol":"SIP"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_policyId17 ${policyId}
insert_policyId_to_file1 allow_sip_objectId32 ${object_Ip_Id}
insert_policyId_to_file1 allow_sip_objectId39 ${object_Ip_Id1}
insert_policyId_to_file1 allow_sip_objectId33 ${object_Account_Id1}
SecurityPolicy-Allow-SIP-00001-3
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建目的IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipOutListenIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
Comment 创建from
${addItemList1} Create Dictionary keywordArray=test104 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-00001 policyType=tsg_security policyDesc=autotest action=allow source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION userRegion={"protocol":"SIP"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_policyId18 ${policyId}
insert_policyId_to_file1 allow_sip_objectId34 ${object_Ip_Id}
insert_policyId_to_file1 allow_sip_objectId40 ${object_Ip_Id1}
insert_policyId_to_file1 allow_sip_objectId35 ${object_Account_Id1}
SecurityPolicy-Allow-SIP-00001-4
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建目的IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipOutListenIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
Comment 创建to
${addItemList1} Create Dictionary keywordArray=test8 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-00001 policyType=tsg_security policyDesc=autotest action=allow source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION userRegion={"protocol":"SIP"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_policyId19 ${policyId}
insert_policyId_to_file1 allow_sip_objectId36 ${object_Ip_Id}
insert_policyId_to_file1 allow_sip_objectId41 ${object_Ip_Id1}
insert_policyId_to_file1 allow_sip_objectId37 ${object_Account_Id1}
SecurityPolicy-Allow-SIP-000012
[Tags] calling ip port source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=192.168.50.60 port=6666 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建第3个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=6666 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
Comment 创建第4个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP3} port=6666 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id2} AddObjects ${1} ${objectDict}
Comment 创建第5个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP4} port=6666 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id3} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-00002 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SIP"} source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR,${object_Ip_Id1}|TSG_SECURITY_SOURCE_ADDR,${object_Ip_Id2}|TSG_SECURITY_SOURCE_ADDR,${object_Ip_Id3}|TSG_SECURITY_SOURCE_ADDR isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_objectId20 ${object_Ip_Id}
insert_policyId_to_file1 allow_sip_objectId21 ${object_Ip_Id1}
insert_policyId_to_file1 allow_sip_objectId22 ${object_Ip_Id2}
insert_policyId_to_file1 allow_sip_objectId23 ${object_Ip_Id3}
insert_policyId_to_file1 allow_sip_policyId1 ${policyId}
SecurityPolicy-Allow-SIP-00003
[Tags] calling subid source
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-00003 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SIP"} defaultClient=clientsubid isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_policyId2 ${policyId}
SecurityPolicy-Allow-SIP-00004
[Tags] calling ip geo source
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-00004 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SIP"} source=${objectId}|TSG_SECURITY_SOURCE_LOCATION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_objectId401 ${objectId}
insert_policyId_to_file1 allow_sip_policyId3 ${policyId}
SecurityPolicy-Allow-SIP-00005
[Tags] called domain ip source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-00005 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SIP"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_objectId2 ${objectId}
insert_policyId_to_file1 allow_sip_policyId4 ${policyId}
SecurityPolicy-Allow-SIP-00006
[Tags] called domain ip port source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-00006 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SIP"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_objectId3 ${objectId}
insert_policyId_to_file1 allow_sip_policyId5 ${policyId}
SecurityPolicy-Allow-SIP-00007
[Tags] called domain ip geo source
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-00007 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SIP"} source=${objectId}|TSG_SECURITY_SOURCE_LOCATION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_objectId4 ${objectId}
insert_policyId_to_file1 allow_sip_policyId6 ${policyId}
SecurityPolicy-Allow-SIP-00008
[Tags] called domain ip source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-00005 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SIP"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_objectId5 ${objectId}
insert_policyId_to_file1 allow_sip_policyId7 ${policyId}
SecurityPolicy-Allow-SIP-00009
[Tags] called domain ip port source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-00006 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SIP"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_objectId6 ${objectId}
insert_policyId_to_file1 allow_sip_policyId8 ${policyId}
SecurityPolicy-Allow-SIP-000010
[Tags] called domain ip geo dest
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-000010 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SIP"} destination=${objectId}|TSG_SECURITY_DESTINATION_LOCATION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_objectId7 ${objectId}
insert_policyId_to_file1 allow_sip_policyId9 ${policyId}
SecurityPolicy-Allow-SIP-000011
[Tags] calledip des,from account ,allow and monitor
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$zdjzyq12voip,zdjzy*,yq12v,*12voip
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-000011 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SIP"} filterList=${object_Account_Id}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_objectId8 ${object_Account_Id}
insert_policyId_to_file1 allow_sip_policyId10 ${policyId}
SecurityPolicy-Allow-SIP-00002
[Tags] calling ip source,to account ,allow and monitor
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建Account,若测试无源和目的的情况可以将/03-Variable/BifangApiVariable.txt中addTestClentIPFlag置为0
${addItemList1} Create Dictionary keywordArray=test4 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-00002 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SIP"} source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR filterList=${object_Account_Id}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_objectId0209 ${object_Account_Id}
insert_policyId_to_file1 allow_sip_objectId1201 ${object_Ip_Id}
insert_policyId_to_file1 allow_sip_policyId11 ${policyId}
SecurityPolicy-Allow-SIP-000013
[Tags] calling ip source,called domain ip dest,from account,to account ,allow , monitor and deny
Comment 创建被叫方域名IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建Account1
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$zdjzyq12voip,zdjzy*,yq12v,*12voip
${rescode} ${object_Account_Id1} AddObject2 ${1} ${objectDict}
Comment 创建Account2
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$wx7051406391,wx705*,51406,*51406391
${rescode} ${object_Account_Id2} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-000013 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SIP"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id2}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_objectId10 ${objectId}
insert_policyId_to_file1 allow_sip_objectId11 ${object_Account_Id1}
insert_policyId_to_file1 allow_sip_objectId12 ${object_Account_Id2}
insert_policyId_to_file1 allow_sip_policyId12 ${policyId}
SecurityPolicy-Allow-SIP-000014
[Tags] called ip dest,called domain ip source,from account,to account ,allow , monitor and deny
Comment 创建被叫方域名IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建被叫方IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP3} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建Account1
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$zdjzyq12voip,zdjzy*,yq12v,*12voip
${rescode} ${object_Account_Id1} AddObject2 ${1} ${objectDict}
Comment 创建Account2
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$wx7051406391,wx705*,51406,*51406391
${rescode} ${object_Account_Id2} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-000014 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SIP"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR destination=${objectId1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id2}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_objectId13 ${objectId}
insert_policyId_to_file1 allow_sip_objectId14 ${objectId1}
insert_policyId_to_file1 allow_sip_objectId15 ${object_Account_Id1}
insert_policyId_to_file1 allow_sip_objectId16 ${object_Account_Id2}
insert_policyId_to_file1 allow_sip_policyId13 ${policyId}
SecurityPolicy-Allow-SIP-000015
[Tags] allow,SIP and RTP
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SipAndRtp-000015 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SIP","protocol":"RTP"} isValid=${0} appIdObjects=${SIP_ID},${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_policyId14 ${policyId}
SecurityPolicy-Allow-SIP-000016
[Tags] The largest combination
Comment 创建Account1
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$zdjzyq12voip
${rescode} ${object_Account_Id1} AddObject2 ${1} ${objectDict}
Comment 创建Account2
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=zdjzy*
${rescode} ${object_Account_Id2} AddObject2 ${1} ${objectDict}
Comment 创建Account3
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=yq12v
${rescode} ${object_Account_Id3} AddObject2 ${1} ${objectDict}
Comment 创建Account4
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*12voip
${rescode} ${object_Account_Id4} AddObject2 ${1} ${objectDict}
Comment 创建Account5
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$zdjzyq12voi
${rescode} ${object_Account_Id5} AddObject2 ${1} ${objectDict}
Comment 创建Account6
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*12voi
${rescode} ${object_Account_Id6} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-000011 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SIP"} filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id2}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION,${object_Account_Id3}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id4}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION,${object_Account_Id5}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id6}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_objectId24 ${object_Account_Id1}
insert_policyId_to_file1 allow_sip_objectId25 ${object_Account_Id2}
insert_policyId_to_file1 allow_sip_objectId26 ${object_Account_Id3}
insert_policyId_to_file1 allow_sip_objectId27 ${object_Account_Id4}
insert_policyId_to_file1 allow_sip_objectId28 ${object_Account_Id5}
insert_policyId_to_file1 allow_sip_objectId29 ${object_Account_Id6}
insert_policyId_to_file1 allow_sip_policyId15 ${policyId}
SecurityPolicy-Allow-SIP-00003
[Tags] calling ip source,to account ,allow and monitor
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建Account,若测试无源和目的的情况可以将/03-Variable/BifangApiVariable.txt中addTestClentIPFlag置为0
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=test4
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SIP-00002 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SIP"} source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR filterList=${object_Account_Id}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_sip_objectId9 ${object_Account_Id}
insert_policyId_to_file1 allow_sip_objectId0301 ${object_Ip_Id}
insert_policyId_to_file1 allow_sip_policyId0301 ${policyId}

View File

@@ -1,73 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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
*** Test Cases ***
SecurityPolicy-Allow-Ssl-00001
[Tags] fqdn完整匹配 update policy:ip geo
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$homebank.kz isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建ip geo
${addItemList1} Create Dictionary keywordArray=XXG地区.*
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=geo_location isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Ssl-00001 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SSL"} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_ssl_objectId ${objectId}
insert_policyId_to_file1 allow_ssl_objectId2 ${objectId1}
insert_policyId_to_file1 allow_ssl_policyId ${policyId}
SecurityPolicy-Allow-Ssl-00002
[Tags] cat右匹配 update policy:fqdn
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*prontomail.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=$xinyue.qq.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建categories
${addItemList1} Create Dictionary fqdn=*protomail.com
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary categoryType=fqdn categoryName=youxiang objectSubType=category isValid=${1} fqdnList=${addItemLists}
${rescode} ${categoryObjId} ${categoryId} AddCategories ${1} ${objectDict} add 200
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Ssl-00002 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SSL"} filterList=${objectId}|TSG_FIELD_SSL_SNI,${categoryObjId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_ssl_objectId1 ${objectId}
insert_policyId_to_file1 allow_ssl_objectId3 ${objectId1}
insert_policyId_to_file1 allow_ssl_policyId1 ${policyId}
insert_policyId_to_file1 allow_ssl_categoryId ${categoryId}
SecurityPolicy-Allow-Ssl-00003
[Tags] the minimum match
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Ssl-00003 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SSL"} isValid=${0} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 allow_ssl_policyId2 ${policyId}

View File

@@ -1,516 +0,0 @@
*** 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
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
*** Test Cases ***
Proxy-Policy-allow-00001
[Tags] fqdn完整匹配 修改fqdn
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$mp.pipix.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=*mp.pipix.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建categories
${addItemList1} Create Dictionary fqdn=$mp.pipix.com
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary categoryType=fqdn categoryName=pipixia objectSubType=category isValid=${1} fqdnList=${addItemLists}
${rescode} ${categoryObjId} ${categoryId} AddCategories ${1} ${objectDict} add 200
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,${categoryObjId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00001 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST,${categoryObjId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId ${objectId}
insert_policyId_to_file1 allow_objectId39 ${objectId1}
insert_policyId_to_file1 intercept_allow_policyId ${policyId1}
insert_policyId_to_file1 allow_policyId ${policyId2}
insert_policyId_to_file1 allow_categoryId ${categoryId}
Proxy-Policy-allow-00002
[Tags] cat匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*feishu.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00002 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId1 ${objectId}
insert_policyId_to_file1 intercept_allow_policyId1 ${policyId1}
insert_policyId_to_file1 allow_policyId1 ${policyId2}
Proxy-Policy-allow-00003
[Tags] url,fqdn_category
${iniCatId} GetIniCategoryId astrology
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*csgo500.com isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*znakitaro.ru isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=*astrou.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=csgo500 isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=$znakitaro.ru/ isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=*trou.ru/ isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 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=${iniCatId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00003 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId2 ${objectId}
insert_policyId_to_file1 allow_objectId3 ${objectId1}
insert_policyId_to_file1 intercept_allow_policyId2 ${policyId1}
insert_policyId_to_file1 allow_policyId2 ${policyId2}
Proxy-Policy-allow-00004
[Tags] 请求头左匹配 修改policy中url,请求头
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*123.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=www.hao123.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建url2
${addItemList1} Create Dictionary keywordArray=*hao123.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头2
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00004 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId4 ${objectId}
insert_policyId_to_file1 allow_objectId5 ${objectId1}
insert_policyId_to_file1 allow_objectId6 ${objectId2}
insert_policyId_to_file1 allow_objectId40 ${objectId3}
insert_policyId_to_file1 allow_objectId41 ${objectId4}
insert_policyId_to_file1 intercept_allow_policyId3 ${policyId1}
insert_policyId_to_file1 allow_policyId3 ${policyId2}
Proxy-Policy-allow-00005
[Tags] 请求头左匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$boutiquehotel.me isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=paris/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00005 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId7 ${objectId}
insert_policyId_to_file1 allow_objectId8 ${objectId1}
insert_policyId_to_file1 allow_objectId9 ${objectId2}
insert_policyId_to_file1 intercept_allow_policyId4 ${policyId1}
insert_policyId_to_file1 allow_policyId4 ${policyId2}
Proxy-Policy-allow-00006
[Tags] 请求头字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.choicehotels.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=quality-inn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=AppleWebKit isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00006 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId10 ${objectId}
insert_policyId_to_file1 allow_objectId11 ${objectId1}
insert_policyId_to_file1 allow_objectId12 ${objectId2}
insert_policyId_to_file1 intercept_allow_policyId5 ${policyId1}
insert_policyId_to_file1 allow_policyId5 ${policyId2}
Proxy-Policy-allow-00007
[Tags] 请求头右匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.woodsnap.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=woodsnap isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=*Safari/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00007 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId13 ${objectId}
insert_policyId_to_file1 allow_objectId14 ${objectId1}
insert_policyId_to_file1 allow_objectId15 ${objectId2}
insert_policyId_to_file1 intercept_allow_policyId6 ${policyId1}
insert_policyId_to_file1 allow_policyId6 ${policyId2}
Proxy-Policy-allow-00008
[Tags] 应答头右匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*sse.com.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=market/overview/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
# Comment 创建应答头
# ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
# ${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=*html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${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=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00008 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId16 ${objectId}
insert_policyId_to_file1 allow_objectId17 ${objectId1}
insert_policyId_to_file1 allow_objectId18 ${objectId2}
insert_policyId_to_file1 intercept_allow_policyId7 ${policyId1}
insert_policyId_to_file1 allow_policyId7 ${policyId2}
Proxy-Policy-allow-00009
[Tags] 应答头完整匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*szse.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=lawrules isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=$text/html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 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=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00009 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId19 ${objectId}
insert_policyId_to_file1 allow_objectId20 ${objectId1}
insert_policyId_to_file1 allow_objectId21 ${objectId2}
insert_policyId_to_file1 intercept_allow_policyId8 ${policyId1}
insert_policyId_to_file1 allow_policyId8 ${policyId2}
Proxy-Policy-allow-00010
[Tags] 应答头子串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*gf.com.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=about/intro isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
# Comment 创建应答头
# ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html|Content-Type
# ${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=text/html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 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=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00010 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId22 ${objectId}
insert_policyId_to_file1 allow_objectId23 ${objectId1}
insert_policyId_to_file1 allow_objectId24 ${objectId2}
insert_policyId_to_file1 intercept_allow_policyId9 ${policyId1}
insert_policyId_to_file1 allow_policyId9 ${policyId2}
Proxy-Policy-allow-00011
[Tags] 应答头左匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*chinastock.com.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=cgs-services/investBank.html isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
# Comment 创建应答头
# ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text*|Content-Type
# ${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=text* isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
# Comment 创建应答头2
# ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text*|Content-Type
# ${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
Comment 创建应答头2Content-Type
${addItemList1} Create Dictionary keywordArray=text isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${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=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00011 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId25 ${objectId}
insert_policyId_to_file1 allow_objectId26 ${objectId1}
insert_policyId_to_file1 allow_objectId27 ${objectId2}
insert_policyId_to_file1 allow_objectId42 ${objectId3}
insert_policyId_to_file1 intercept_allow_policyId10 ${policyId1}
insert_policyId_to_file1 allow_policyId10 ${policyId2}
Proxy-Policy-allow-00012
[Tags] cookie四种匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.virtuoso.com,$b.faloo.com,*readnovel.com,*hongxiu.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=virtuoso.com,faloo,readnovel,hongxiu.com
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=lQfQ_2132|Cookie,_csrfToken|Cookie,curr_url*|Cookie,*1406562325|Cookie,UM_*|Cookie
${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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00012 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId28 ${objectId}
insert_policyId_to_file1 allow_objectId29 ${objectId1}
insert_policyId_to_file1 allow_objectId30 ${objectId2}
insert_policyId_to_file1 intercept_allow_policyId11 ${policyId1}
insert_policyId_to_file1 allow_policyId11 ${policyId2}
Proxy-Policy-allow-00013
[Tags] set-cookie4种匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$russia.payu.com,*925mm.com,*qunar.com,$www.vitalsource.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=AWSALB|Set-Cookie,*Domain=qunar.com; Path=/|Set-Cookie,frontLang=zh-cn|Set-Cookie,_stargate_session*|Set-Cookie
${rescode} ${objectId1} 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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00013 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId31 ${objectId}
insert_policyId_to_file1 allow_objectId32 ${objectId1}
insert_policyId_to_file1 intercept_allow_policyId12 ${policyId1}
insert_policyId_to_file1 allow_policyId12 ${policyId2}
Proxy-Policy-allow-00014
[Tags] 最大组合
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.orbitz.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*Flights isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${object_qq_Id} AddObject2 ${1} ${objectDict}
Comment 创建应答头
${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
${rescode} ${object_ck_Id} AddObject2 ${1} ${objectDict}
Comment 创建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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建allow策略
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00014 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","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=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 allow_objectId33 ${object_fqdn_Id}
insert_policyId_to_file1 allow_objectId34 ${object_url_Id}
insert_policyId_to_file1 allow_objectId35 ${object_qq_Id}
insert_policyId_to_file1 allow_objectId36 ${object_yd_Id}
insert_policyId_to_file1 allow_objectId37 ${object_ck_Id}
insert_policyId_to_file1 allow_objectId38 ${object_sk_Id}
insert_policyId_to_file1 intercept_allow_policyId13 ${policyId1}
insert_policyId_to_file1 allow_policyId13 ${policyId2}

View File

@@ -1,108 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
*** Test Cases ***
SecurityPolicy-Deny-Dns-00001
[Tags] fqdn完整和右匹配,update policy:source ip_geo
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.facebook.com isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*rutube.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建categories
${addItemList1} Create Dictionary fqdn=$www.facebook.com
${addItemList2} Create Dictionary fqdn=*rutube.ru
${addItemLists} Create list ${addItemList1} ${addItemList2}
${objectDict} Create Dictionary categoryType=fqdn categoryName=lianshu objectSubType=category isValid=${1} fqdnList=${addItemLists}
${rescode} ${categoryObjId} ${categoryId} AddCategories ${1} ${objectDict} add 200
Comment 创建ip geo
${addItemList1} Create Dictionary keywordArray=XXG地区.*
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=geo_location isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Dns-00001 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"DNS","method":"drop"} filterList=${objectId}|TSG_FIELD_DNS_QNAME,${categoryObjId}|TSG_FIELD_DNS_QNAME isValid=${1} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_dns_objectId ${objectId}
insert_policyId_to_file1 deny_dns_objectId4 ${objectId1}
insert_policyId_to_file1 deny_dns_policyId ${policyId}
insert_policyId_to_file1 deny_dns_categoryId ${categoryId}
SecurityPolicy-Deny-Dns-00002
[Tags] cat右和完整匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*arctictrucks.ru isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*wifika.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Dns-00002 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"A","answer":[{"atype":"CNAME","value":"www.jd.com","ttl":{"min":500,"max":500}},{"atype":"A","value":"192.168.41.186","ttl":{"min":300,"max":300}}]}]} filterList=${objectId}|TSG_FIELD_DNS_QNAME isValid=${1} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_dns_objectId1 ${objectId}
insert_policyId_to_file1 deny_dns_policyId1 ${policyId}
SecurityPolicy-Deny-Dns-00003
[Tags] cat
${iniCatId} GetIniCategoryId filehosting
Comment 创建fqdn1
${addItemList1} Create Dictionary keywordArray=*aec188.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Dns-00003 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"AAAA","answer":[{"atype":"AAAA","value":"fc00::2:11","ttl":{"min":400,"max":400}},{"atype":"CNAME","value":"www.taobao.com","ttl":{"min":600,"max":600}}]}]} filterList=${iniCatId}|TSG_FIELD_DNS_QNAME,${objectId}|TSG_FIELD_DNS_QNAME isValid=${1} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_dns_objectId2 ${objectId}
insert_policyId_to_file1 deny_dns_policyId2 ${policyId}
SecurityPolicy-Deny-Dns-00004
[Tags] fqdn右匹配 destination:iplearning update fqdn
Comment 创建fqdn1
${addItemList1} Create Dictionary keywordArray=*twitch.tv isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=$www.twitch.tv isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Dns-00004 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"DNS","method":"redirect","resolution":[{"answer":[{"atype":"AAAA","value":"fc00::2:22","ttl":{"min":400,"max":400}},{"atype":"CNAME","value":"www.facebook.com","ttl":{"min":400,"max":400}}],"qtype":"AAAA"},{"qtype":"A","answer":[{"atype":"CNAME","value":"www.ok.ru","ttl":{"min":400,"max":400}},{"atype":"A","value":"192.168.40.110","ttl":{"min":400,"max":400}}]}]} filterList=${objectId}|TSG_FIELD_DNS_QNAME isValid=${1} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_dns_objectId3 ${objectId}
insert_policyId_to_file1 deny_dns_objectId5 ${objectId1}
insert_policyId_to_file1 deny_dns_policyId3 ${policyId}
SecurityPolicy-Deny-Dns-00005
[Tags] the minimum match
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Dns-00005 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"DNS","method":"drop"} isValid=${0} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_dns_policyId4 ${policyId}

View File

@@ -1,157 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
*** Test Cases ***
SecurityPolicy-Deny-Ftp-00001
[Tags] 右匹配
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=*user isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*123456.txt isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建content
${addItemList1} Create Dictionary keywordArray=*qwertyuiop isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_content_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00001 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"FTP","method":"drop"} filterList=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT,${object_content_Id}|TSG_FIELD_FTP_CONTENT,${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
Comment 创建ip geo
${addItemList1} Create Dictionary keywordArray=XXG地区.*
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=geo_location isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建Account2
${addItemList1} Create Dictionary keywordArray=user isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建url2
${addItemList1} Create Dictionary keywordArray=123456.txt isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id1} AddObjects ${1} ${objectDict}
Comment 创建content2
${addItemList1} Create Dictionary keywordArray=qwertyuiop isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_content_Id1} AddObjects ${1} ${objectDict}
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_ftp_objectId ${object_Account_Id}
insert_policyId_to_file1 deny_ftp_objectId1 ${object_url_Id}
insert_policyId_to_file1 deny_ftp_objectId2 ${object_content_Id}
insert_policyId_to_file1 deny_ftp_objectId12 ${objectId1}
insert_policyId_to_file1 deny_ftp_objectId13 ${object_Account_Id1}
insert_policyId_to_file1 deny_ftp_objectId14 ${object_url_Id1}
insert_policyId_to_file1 deny_ftp_objectId15 ${object_content_Id}
insert_policyId_to_file1 deny_ftp_policyId ${policyId}
SecurityPolicy-Deny-Ftp-00002
[Tags] 字串匹配
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=user isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=est.txt isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建content
${addItemList1} Create Dictionary keywordArray=中文tes isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_content_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00002 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"FTP","method":"drop"} filterList=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT,${object_content_Id}|TSG_FIELD_FTP_CONTENT,${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_ftp_objectId3 ${object_Account_Id}
insert_policyId_to_file1 deny_ftp_objectId4 ${object_url_Id}
insert_policyId_to_file1 deny_ftp_objectId5 ${object_content_Id}
insert_policyId_to_file1 deny_ftp_policyId1 ${policyId}
SecurityPolicy-Deny-Ftp-00003
[Tags] 完整匹配
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=$ftpuser isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=$ftp://192.168.40.158/wlcsy.txt isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建content
${addItemList1} Create Dictionary keywordArray=$中文文件内容 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_content_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00003 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"FTP","method":"rst"} filterList=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT,${object_content_Id}|TSG_FIELD_FTP_CONTENT,${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_ftp_objectId6 ${object_Account_Id}
insert_policyId_to_file1 deny_ftp_objectId7 ${object_url_Id}
insert_policyId_to_file1 deny_ftp_objectId8 ${object_content_Id}
insert_policyId_to_file1 deny_ftp_policyId2 ${policyId}
SecurityPolicy-Deny-Ftp-00004
[Tags] 左匹配
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=ftpu* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=ftp://192.168.40* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建content
${addItemList1} Create Dictionary keywordArray=завезен* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_content_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00004 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"FTP","method":"rst"} filterList=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT,${object_content_Id}|TSG_FIELD_FTP_CONTENT,${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_ftp_objectId9 ${object_Account_Id}
insert_policyId_to_file1 deny_ftp_objectId10 ${object_url_Id}
insert_policyId_to_file1 deny_ftp_objectId11 ${object_content_Id}
insert_policyId_to_file1 deny_ftp_policyId3 ${policyId}
SecurityPolicy-Deny-Ftp-00005
[Tags] the minimum match
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00005 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"FTP","method":"rst"} isValid=${0} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_ftp_policyId4 ${policyId}

View File

@@ -1,524 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
*** Variables ***
${url} /v1/policy/profile/responsepages
*** Test Cases ***
SecurityPolicy-Deny-Http-00001
[Tags] fqdn完整匹配 update policy:source ip_geo,fqdn
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.lkong.net isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建categories
${addItemList1} Create Dictionary fqdn=$www.lkong.net
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary categoryType=fqdn categoryName=lkong objectSubType=category isValid=${1} fqdnList=${addItemLists}
${rescode} ${categoryObjId} ${categoryId} AddCategories ${1} ${objectDict} add 200
Comment 创建ip geo
${addItemList1} Create Dictionary keywordArray=XXG地区.*
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=geo_location isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=*lkong.net isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00001 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${objectId}|TSG_FIELD_HTTP_HOST,${categoryObjId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId ${objectId}
insert_policyId_to_file1 deny_http_objectId35 ${objectId1}
insert_policyId_to_file1 deny_http_objectId36 ${objectId2}
insert_policyId_to_file1 deny_http_policyId ${policyId}
insert_policyId_to_file1 deny_http_categoryId ${categoryId}
SecurityPolicy-Deny-Http-00002
[Tags] fqdn右匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*bellaircraftmuseum.org isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00002 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"rst"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId1 ${objectId}
insert_policyId_to_file1 deny_http_policyId1 ${policyId}
SecurityPolicy-Deny-Http-00003
[Tags] url4种匹配
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*/news/ isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=www.gotohoroscope* isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=$www.icbc.com.cn/ isHexbin=${0}
${addItemList4} Create Dictionary keywordArray=indexv isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
#创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404english.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00003 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"block","code":403,"html_profile":${profiledId}} filterList=${objectId}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId2 ${objectId}
insert_policyId_to_file1 deny_http_policyId2 ${policyId}
insert_policyId_to_file1 deny_http_profiledId ${profiledId}
SecurityPolicy-Deny-Http-00004
[Tags] 请求头左匹配 update policy:url 请求头
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*sveden isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头2
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId_req_Id} AddObjects ${1} ${objectDict}
Comment 创建url2
${addItemList1} Create Dictionary keywordArray=tsutmb isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id2} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00004 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"block","code":404,"message":"yyyyy"} filterList=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId3 ${object_url_Id}
insert_policyId_to_file1 deny_http_objectId4 ${objectId}
insert_policyId_to_file1 deny_http_objectId37 ${objectId_req_Id}
insert_policyId_to_file1 deny_http_objectId38 ${object_url_Id2}
insert_policyId_to_file1 deny_http_policyId3 ${policyId}
SecurityPolicy-Deny-Http-00005
[Tags] 请求头完整匹配
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*a.com/cn/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00005 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId5 ${object_url_Id}
insert_policyId_to_file1 deny_http_objectId6 ${objectId}
insert_policyId_to_file1 deny_http_policyId4 ${policyId}
SecurityPolicy-Deny-Http-00006
[Tags] 请求头字串匹配
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=AppleWebKit isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=egypt.travel isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00006 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"alert","code":200,"message":"网站被阻断"} filterList=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId7 ${object_url_Id}
insert_policyId_to_file1 deny_http_objectId8 ${objectId}
insert_policyId_to_file1 deny_http_policyId5 ${policyId}
SecurityPolicy-Deny-Http-00007
[Tags] 请求头右匹配
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=*Safari/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*download.shtml isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
#创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00007 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} filterList=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId9 ${object_url_Id}
insert_policyId_to_file1 deny_http_objectId10 ${objectId}
insert_policyId_to_file1 deny_http_policyId6 ${policyId}
insert_policyId_to_file1 deny_http_profiledId1 ${profiledId}
SecurityPolicy-Deny-Http-00008
[Tags] 应答头右匹配 update policy:应答头
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*index.aspx isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=*utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建应答头2Content-Type
${addItemList1} Create Dictionary keywordArray=utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00008 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"rst"} filterList=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId11 ${object_url_Id}
insert_policyId_to_file1 deny_http_objectId12 ${objectId}
insert_policyId_to_file1 deny_http_objectId39 ${objectId1}
insert_policyId_to_file1 deny_http_policyId7 ${policyId}
SecurityPolicy-Deny-Http-00009
[Tags] 应答头完整匹配
Comment 创建url
${addItemList1} Create Dictionary keywordArray=www.skycn.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=$text/html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00009 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId13 ${object_url_Id}
insert_policyId_to_file1 deny_http_objectId14 ${objectId}
insert_policyId_to_file1 deny_http_policyId8 ${policyId}
SecurityPolicy-Deny-Http-00010
[Tags] 应答头字串匹配 update policy
Comment 创建url
${addItemList1} Create Dictionary keywordArray=www.avaxsearch.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=text/html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00010 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId15 ${object_url_Id}
insert_policyId_to_file1 deny_http_objectId16 ${objectId}
insert_policyId_to_file1 deny_http_policyId9 ${policyId}
SecurityPolicy-Deny-Http-00011
[Tags] 应答头右匹配
Comment 创建url
${addItemList1} Create Dictionary keywordArray=finestquotes.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=text* isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00011 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId17 ${object_url_Id}
insert_policyId_to_file1 deny_http_objectId18 ${objectId}
insert_policyId_to_file1 deny_http_policyId10 ${policyId}
SecurityPolicy-Deny-Http-00012
[Tags] cookie字串匹配
Comment 创建请求头cookie
${addItemList1} Create Dictionary keywordArray=ipp_uid2 isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00012 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"block","code":404,"message":"马上到周末"} filterList=${objectId}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId19 ${objectId}
insert_policyId_to_file1 deny_http_policyId11 ${policyId}
SecurityPolicy-Deny-Http-00013
[Tags] set-cookie
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*nlr.ru isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=$www.sinovision.net isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建Set-Cookie
${addItemList1} Create Dictionary keywordArray=ASP.NET_SessionId=* isHexbin=${0} district=Set-Cookie
${addItemList2} Create Dictionary keywordArray=oKD0_802a* isHexbin=${0} district=Set-Cookie
${addItemList3} Create Dictionary keywordArray=PHPSESSID isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00013 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR,${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId46 ${objectId}
insert_policyId_to_file1 deny_http_objectId20 ${objectId1}
insert_policyId_to_file1 deny_http_policyId12 ${policyId}
SecurityPolicy-Deny-Http-00014
[Tags] 请求体字串匹配 update policy:请求体
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建请求体
${addItemList1} Create Dictionary keywordArray=testDenyHttp0014 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建请求体2
${addItemList1} Create Dictionary keywordArray=biubiubiud isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00014 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${objectId}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId431 ${object_fqdn_Id}
insert_policyId_to_file1 deny_http_objectId21 ${objectId}
insert_policyId_to_file1 deny_http_objectId40 ${objectId1}
insert_policyId_to_file1 deny_http_policyId13 ${policyId}
SecurityPolicy-Deny-Http-00015
[Tags] 应答体字串匹配 update policy:返回体
Comment 创建应答体
${addItemList1} Create Dictionary keywordArray=华彤公司 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建应答体2
${addItemList1} Create Dictionary keywordArray=华彤集团官网 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00015 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${objectId}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId22 ${objectId}
insert_policyId_to_file1 deny_http_objectId41 ${objectId1}
insert_policyId_to_file1 deny_http_policyId14 ${policyId}
SecurityPolicy-Deny-Http-00016
[Tags] 最大组合1
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=open.node isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_qq_Id} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=charset isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_yd_Id} AddObjects ${1} ${objectDict}
Comment 创建请求体
${addItemList1} Create Dictionary keywordArray=DenyHttp0016 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_body_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00016 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_qq_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_yd_Id}|TSG_FIELD_HTTP_RES_HDR,${object_body_Id}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId23 ${object_fqdn_Id}
insert_policyId_to_file1 deny_http_objectId24 ${object_url_Id}
insert_policyId_to_file1 deny_http_objectId25 ${object_qq_Id}
insert_policyId_to_file1 deny_http_objectId26 ${object_yd_Id}
insert_policyId_to_file1 deny_http_objectId27 ${object_body_Id}
insert_policyId_to_file1 deny_http_policyId15 ${policyId}
SecurityPolicy-Deny-Http-00017
[Tags] 最大组合2
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*smspunch.net isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*send-free-sms.aspx isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建cookie
${addItemList1} Create Dictionary keywordArray=_ym_isad=2 isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_qq_Id} AddObjects ${1} ${objectDict}
Comment 创建Set-Cookie
${addItemList1} Create Dictionary keywordArray=NET_SessionId isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_yd_Id} AddObjects ${1} ${objectDict}
Comment 创建应答体
${addItemList1} Create Dictionary keywordArray=Cell No isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_body_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00017 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_qq_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_yd_Id}|TSG_FIELD_HTTP_RES_HDR,${object_body_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId28 ${object_fqdn_Id}
insert_policyId_to_file1 deny_http_objectId29 ${object_url_Id}
insert_policyId_to_file1 deny_http_objectId30 ${object_qq_Id}
insert_policyId_to_file1 deny_http_objectId31 ${object_yd_Id}
insert_policyId_to_file1 deny_http_objectId32 ${object_body_Id}
insert_policyId_to_file1 deny_http_policyId16 ${policyId}
SecurityPolicy-Deny-Http-00018
[Tags] 多源ip对象
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=192.168.50.18 port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.hebbank.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00018 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID} source=${objectId}|TSG_SECURITY_SOURCE_ADDR
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId33 ${objectId}
insert_policyId_to_file1 deny_http_objectId34 ${object_fqdn_Id}
insert_policyId_to_file1 deny_http_policyId17 ${policyId}
SecurityPolicy-Deny-Http-00019
[Tags] the minimum match
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00019 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_policyId18 ${policyId}
SecurityPolicy-Deny-Http-00020
[Tags] substring
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$www.xinhuanet.com/
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
Comment cookie8个子串,创建请求头
${addItemList1} Create Dictionary keywordArray=7764,636964,756964,77646c617374,363964,3666653461,3462326663,38346463633835 isHexbin=${1} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ck_Id} AddObjects ${1} ${objectDict}
Comment user-agent8个子串,创建请求头
${addItemList1} Create Dictionary keywordArray=4d6f7a696c6c612f352e30,57696e646f7773,57696e3634,783634,4170706c65,65624b6974,4b48544d4c,6c696b65 isHexbin=${1} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ua_Id} AddObjects ${1} ${objectDict}
Comment cont-Type8个子串,创建应答头:text/html
${addItemList1} Create Dictionary keywordArray=7465,7874,746578,657874,74657874,6874,6d6c,68746d isHexbin=${1} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ct_Id} AddObjects ${1} ${objectDict}
# Comment set-cookie8个子串,创建应答头
# ${addItemList1} Create Dictionary keywordArray=7465,78742f,6874,6d6c,68746d6c,63686172,736574,63686172736574 isHexbin=${1} district=Set-Cookie
# ${addItemLists} Create list ${addItemList1}
# ${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
# ${rescode} ${object_ct_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00020 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${object_url_Id}|TSG_FIELD_HTTP_URL,${object_ck_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_ct_Id}|TSG_FIELD_HTTP_RES_HDR,${object_ua_Id}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_http_objectId42 ${object_url_Id}
insert_policyId_to_file1 deny_http_objectId43 ${object_ck_Id}
insert_policyId_to_file1 deny_http_objectId44 ${object_ua_Id}
insert_policyId_to_file1 deny_http_objectId45 ${object_ct_Id}
insert_policyId_to_file1 deny_http_policyId19 ${policyId}

View File

@@ -1,408 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
*** Test Cases ***
SecurityPolicy-Deny-Mail-00001
[Tags] content字串匹配 update:ip geo,Content
Comment 创建Content1
${addItemList1} Create Dictionary keywordArray=стопо isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Content_Id} AddObjects ${1} ${objectDict}
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建Content2
${addItemList1} Create Dictionary keywordArray=$Простопорно isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Content_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00001 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"drop"} filterList=${object_Content_Id}|TSG_FIELD_MAIL_CONTENT isValid=${1} appIdObjects=${MAIL_ID}
#userRegion={"protocol":"MAIL","method":"block","code":550}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId ${object_Content_Id}
insert_policyId_to_file1 deny_mail_objectId32 ${objectId}
insert_policyId_to_file1 deny_mail_objectId33 ${object_Content_Id1}
insert_policyId_to_file1 deny_mail_policyId ${policyId}
SecurityPolicy-Deny-Mail-00002
[Tags] att_cont字串匹配 update:att_cont
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=BigTitle isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建ATT_CONT1
${addItemList1} Create Dictionary keywordArray=Простопорно isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ATT_CONT_Id} AddObjects ${1} ${objectDict}
Comment 创建ATT_CONT2
${addItemList1} Create Dictionary keywordArray=$姬巍川测试文件内容Простопорно isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ATT_CONT_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00002 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"drop"} filterList=${object_ATT_CONT_Id}|TSG_FIELD_MAIL_ATT_CONTENT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId39 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId34 ${object_ATT_CONT_Id1}
insert_policyId_to_file1 deny_mail_objectId1 ${object_ATT_CONT_Id}
insert_policyId_to_file1 deny_mail_policyId1 ${policyId}
SecurityPolicy-Deny-Mail-00003
[Tags] from右匹配 subject右匹配 update: from,subject
Comment 创建Subject1
${addItemList1} Create Dictionary keywordArray=*ОВИДЕО isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建From1
${addItemList1} Create Dictionary keywordArray=*163.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id} AddObjects ${1} ${objectDict}
Comment 创建Subject2
${addItemList1} Create Dictionary keywordArray=ОВИДЕО isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id1} AddObjects ${1} ${objectDict}
Comment 创建From2
${addItemList1} Create Dictionary keywordArray=163.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00003 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId2 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId3 ${object_From_Id}
insert_policyId_to_file1 deny_mail_objectId35 ${object_Subject_Id1}
insert_policyId_to_file1 deny_mail_objectId36 ${object_From_Id1}
insert_policyId_to_file1 deny_mail_policyId2 ${policyId}
SecurityPolicy-Deny-Mail-00004
[Tags] from完整匹配 subject完整匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=$明天周末 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建From
${addItemList1} Create Dictionary keywordArray=$hebingning2021@163.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00004 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId4 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId5 ${object_From_Id}
insert_policyId_to_file1 deny_mail_policyId3 ${policyId}
SecurityPolicy-Deny-Mail-00005
[Tags] subject字串匹配 from字串匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=12345678 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建From
${addItemList1} Create Dictionary keywordArray=hebingning isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00005 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId6 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId7 ${object_From_Id}
insert_policyId_to_file1 deny_mail_policyId4 ${policyId}
SecurityPolicy-Deny-Mail-00006
[Tags] subject左匹配 from左匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=afte* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建From
${addItemList1} Create Dictionary keywordArray=hebing* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00006 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId8 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId9 ${object_From_Id}
insert_policyId_to_file1 deny_mail_policyId5 ${policyId}
SecurityPolicy-Deny-Mail-00007
[Tags] to右匹配 subject左匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=*ыонлай isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=*ks.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_To_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00007 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_To_Id}|TSG_FIELD_MAIL_TO,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId10 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId11 ${object_To_Id}
insert_policyId_to_file1 deny_mail_policyId6 ${policyId}
SecurityPolicy-Deny-Mail-00008
[Tags] to完整匹配 subject完整匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=$zxcvbnm isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=$hebingning@geedgenetworks.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_To_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00008 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_To_Id}|TSG_FIELD_MAIL_TO,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId12 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId13 ${object_To_Id}
insert_policyId_to_file1 deny_mail_policyId7 ${policyId}
SecurityPolicy-Deny-Mail-00009
[Tags] to字串匹配 subject字串匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=新的一天 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=hebingning isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_To_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00009 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_To_Id}|TSG_FIELD_MAIL_TO,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId14 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId15 ${object_To_Id}
insert_policyId_to_file1 deny_mail_policyId8 ${policyId}
SecurityPolicy-Deny-Mail-00010
[Tags] subject左匹配 to左匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=tomor* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=hebing* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_To_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00010 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_To_Id}|TSG_FIELD_MAIL_TO,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId16 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId17 ${object_To_Id}
insert_policyId_to_file1 deny_mail_policyId9 ${policyId}
SecurityPolicy-Deny-Mail-00011
[Tags] subject右匹配 account右匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=*发送失败 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=*2021@163.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00011 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId18 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId19 ${object_Account_Id}
insert_policyId_to_file1 deny_mail_policyId10 ${policyId}
SecurityPolicy-Deny-Mail-00012
[Tags] subject完整匹配 account完整匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=$Онлайнфильмывхоро isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=$hebingning2021@163.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00012 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId20 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId21 ${object_Account_Id}
insert_policyId_to_file1 deny_mail_policyId11 ${policyId}
SecurityPolicy-Deny-Mail-00013
[Tags] subject字串匹配 account字串匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=asdfg isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=hebingning2021@ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00013 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId22 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId23 ${object_Account_Id}
insert_policyId_to_file1 deny_mail_policyId12 ${policyId}
SecurityPolicy-Deny-Mail-00014
[Tags] subject左匹配 account左匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=马上就要* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=hebingning* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00014 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId24 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId25 ${object_Account_Id}
insert_policyId_to_file1 deny_mail_policyId13 ${policyId}
SecurityPolicy-Deny-Mail-00015
[Tags] 最大组合
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=$人生路远及时行乐 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=hebingning* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建Content
${addItemList1} Create Dictionary keywordArray=good isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Content_Id} AddObjects ${1} ${objectDict}
Comment 创建ATT_CONT
${addItemList1} Create Dictionary keywordArray=Простопорно isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ATT_CONT_Id} AddObjects ${1} ${objectDict}
Comment 创建From
${addItemList1} Create Dictionary keywordArray=hebing isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id} AddObjects ${1} ${objectDict}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=geedge isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_To_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00015 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT,${object_Content_Id}|TSG_FIELD_MAIL_CONTENT,${object_ATT_CONT_Id}|TSG_FIELD_MAIL_ATT_CONTENT,${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_To_Id}|TSG_FIELD_MAIL_TO isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId26 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId27 ${object_Content_Id}
insert_policyId_to_file1 deny_mail_objectId28 ${object_ATT_CONT_Id}
insert_policyId_to_file1 deny_mail_objectId29 ${object_From_Id}
insert_policyId_to_file1 deny_mail_objectId30 ${object_To_Id}
insert_policyId_to_file1 deny_mail_objectId31 ${object_Account_Id}
insert_policyId_to_file1 deny_mail_policyId14 ${policyId}
SecurityPolicy-Deny-Mail-00016
[Tags] the minimum match
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00016 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} isValid=${0} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_policyId15 ${policyId}
SecurityPolicy-Deny-Mail-00017
[Tags] content右匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=denymail017 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=hebingning2021@ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建Content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Deny17*
${rescode} ${object_Content_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00017 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT,${object_Content_Id}|TSG_FIELD_MAIL_CONTENT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId37 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId38 ${object_Account_Id}
insert_policyId_to_file1 deny_mail_policyId16 ${policyId}

View File

@@ -1,173 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_policy Trusted_Certificate_Authorities
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
# Resource ../../../03-Variable/ApplicationID.txt
*** Test Cases ***
SecurityPolicy-Deny-Rtp-00001
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建目的IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipOutListenIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Rtp-00001 policyType=tsg_security policyDesc=autotest action=deny source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR userRegion={"protocol":"RTP","method":"drop"} isValid=${1} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_rtp_objectId8 ${object_Ip_Id}
insert_policyId_to_file1 deny_rtp_objectId9 ${object_Ip_Id1}
insert_policyId_to_file1 deny_rtp_policyId ${policyId}
SecurityPolicy-Deny-Rtp-00002
[Tags] calling ip port source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Rtp-00002 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"RTP","method":"drop"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_rtp_objectId ${objectId}
insert_policyId_to_file1 deny_rtp_policyId1 ${policyId}
SecurityPolicy-Deny-Rtp-00003
[Tags] calling subid source
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Rtp-00003 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"RTP","method":"drop"} defaultClient=clientsubid isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_rtp_policyId2 ${policyId}
SecurityPolicy-Deny-Rtp-00004
[Tags] calling ip geo source
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Rtp-00004 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"RTP","method":"drop"} source=${objectId}|TSG_SECURITY_SOURCE_LOCATION isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_rtp_objectId1 ${objectId}
insert_policyId_to_file1 deny_rtp_policyId3 ${policyId}
SecurityPolicy-Deny-Rtp-00005
[Tags] called domain ip source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Rtp-00005 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"RTP","method":"drop"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_rtp_objectId2 ${objectId}
insert_policyId_to_file1 deny_rtp_policyId4 ${policyId}
SecurityPolicy-Deny-Rtp-00006
[Tags] called domain ip port source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Rtp-00006 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"RTP","method":"drop"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_rtp_objectId3 ${objectId}
insert_policyId_to_file1 deny_rtp_policyId5 ${policyId}
SecurityPolicy-Deny-Rtp-00007
[Tags] called domain ip geo source
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Rtp-00007 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"RTP","method":"drop"} source=${objectId}|TSG_SECURITY_SOURCE_LOCATION isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_rtp_objectId4 ${objectId}
insert_policyId_to_file1 deny_rtp_policyId6 ${policyId}
SecurityPolicy-Deny-Rtp-00008
[Tags] called domain ip des
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Rtp-00005 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"RTP","method":"drop"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_rtp_objectId5 ${objectId}
insert_policyId_to_file1 deny_rtp_policyId7 ${policyId}
SecurityPolicy-Deny-Rtp-00009
[Tags] called domain ip port des
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Rtp-00006 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"RTP","method":"drop"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_rtp_objectId6 ${objectId}
insert_policyId_to_file1 deny_rtp_policyId8 ${policyId}
SecurityPolicy-Deny-Rtp-000010
[Tags] called domain ip geo des
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Rtp-00007 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"RTP","method":"drop"} destination=${objectId}|TSG_SECURITY_DESTINATION_LOCATION isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_rtp_objectId7 ${objectId}
insert_policyId_to_file1 deny_rtp_policyId9 ${policyId}

View File

@@ -1,600 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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
# Resource ../../../03-Variable/ApplicationID.txt
*** Test Cases ***
SecurityPolicy-Deny-SIP-00001
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建from
${addItemList1} Create Dictionary keywordArray=test112 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-00001 policyType=tsg_security policyDesc=autotest action=deny source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION userRegion={"protocol":"SIP","method":"block","code":"480"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId38 ${object_Ip_Id}
insert_policyId_to_file1 deny_sip_objectId39 ${object_Account_Id1}
insert_policyId_to_file1 deny_sip_policyId ${policyId}
SecurityPolicy-Deny-SIP-00001-1
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建to
${addItemList1} Create Dictionary keywordArray=test16 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-00001 policyType=tsg_security policyDesc=autotest action=deny source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION userRegion={"protocol":"SIP","method":"block","code":"500"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId40 ${object_Ip_Id}
insert_policyId_to_file1 deny_sip_objectId41 ${object_Account_Id1}
insert_policyId_to_file1 deny_sip_policyId24 ${policyId}
SecurityPolicy-Deny-SIP-00001-2
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建目的IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipListenIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
Comment 创建from
${addItemList1} Create Dictionary keywordArray=test114 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-00001 policyType=tsg_security policyDesc=autotest action=deny source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION userRegion={"protocol":"SIP","method":"drop"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId42 ${object_Ip_Id}
insert_policyId_to_file1 deny_sip_objectId43 ${object_Ip_Id1}
insert_policyId_to_file1 deny_sip_objectId44 ${object_Account_Id1}
insert_policyId_to_file1 deny_sip_policyId25 ${policyId}
SecurityPolicy-Deny-SIP-00001-3
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建目的IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipListenIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
Comment 创建to
${addItemList1} Create Dictionary keywordArray=test18 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-00001 policyType=tsg_security policyDesc=autotest action=deny source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION userRegion={"protocol":"SIP","method":"block","code":"480"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId45 ${object_Ip_Id}
insert_policyId_to_file1 deny_sip_objectId46 ${object_Ip_Id1}
insert_policyId_to_file1 deny_sip_objectId47 ${object_Account_Id1}
insert_policyId_to_file1 deny_sip_policyId26 ${policyId}
SecurityPolicy-Deny-SIP-00001-4
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建目的IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipOutListenIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
Comment 创建from
${addItemList1} Create Dictionary keywordArray=test116 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-00001 policyType=tsg_security policyDesc=autotest action=deny source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION userRegion={"protocol":"SIP","method":"block","code":"500"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId48 ${object_Ip_Id}
insert_policyId_to_file1 deny_sip_objectId49 ${object_Ip_Id1}
insert_policyId_to_file1 deny_sip_objectId50 ${object_Account_Id1}
insert_policyId_to_file1 deny_sip_policyId27 ${policyId}
SecurityPolicy-Deny-SIP-00001-5
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建目的IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipOutListenIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
Comment 创建to
${addItemList1} Create Dictionary keywordArray=test20 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-00001 policyType=tsg_security policyDesc=autotest action=deny source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION userRegion={"protocol":"SIP","method":"drop"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId51 ${object_Ip_Id}
insert_policyId_to_file1 deny_sip_objectId52 ${object_Ip_Id1}
insert_policyId_to_file1 deny_sip_objectId53 ${object_Account_Id1}
insert_policyId_to_file1 deny_sip_policyId28 ${policyId}
SecurityPolicy-Deny-SIP-00002
[Tags] calling ip port source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-00002 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"block","code":"480"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId ${objectId}
insert_policyId_to_file1 deny_sip_policyId1 ${policyId}
SecurityPolicy-Deny-SIP-00003
[Tags] calling subid source
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-00003 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"block","code":"500"} defaultClient=clientsubid isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_policyId2 ${policyId}
SecurityPolicy-Deny-SIP-00004
[Tags] calling ip geo source
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-00004 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"drop"} source=${objectId}|TSG_SECURITY_SOURCE_LOCATION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId1 ${objectId}
insert_policyId_to_file1 deny_sip_policyId3 ${policyId}
SecurityPolicy-Deny-SIP-00005
[Tags] called domain ip source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-00005 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"drop"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId2 ${objectId}
insert_policyId_to_file1 deny_sip_policyId4 ${policyId}
SecurityPolicy-Deny-SIP-00006
[Tags] called domain ip port source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-00006 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"drop"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId3 ${objectId}
insert_policyId_to_file1 deny_sip_policyId5 ${policyId}
SecurityPolicy-Deny-SIP-00007
[Tags] called domain ip geo source
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-00007 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"drop"} source=${objectId}|TSG_SECURITY_SOURCE_LOCATION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId4 ${objectId}
insert_policyId_to_file1 deny_sip_policyId6 ${policyId}
SecurityPolicy-Deny-SIP-00008
[Tags] called domain ip dest
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-00008 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"drop"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId5 ${objectId}
insert_policyId_to_file1 deny_sip_policyId7 ${policyId}
SecurityPolicy-Deny-SIP-00009
[Tags] called domain ip port dest
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-00009 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"drop"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId6 ${objectId}
insert_policyId_to_file1 deny_sip_policyId8 ${policyId}
SecurityPolicy-Deny-SIP-000010
[Tags] called domain ip geo dest
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-000010 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"drop"} destination=${objectId}|TSG_SECURITY_DESTINATION_LOCATION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId7 ${objectId}
insert_policyId_to_file1 deny_sip_policyId9 ${policyId}
SecurityPolicy-Deny-SIP-000011
[Tags] calling ip source,from account ,deny drop,若测试无源和目的的情况可以将/03-Variable/BifangApiVariable.txt中addTestClentIPFlag置为0
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount}
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-000011 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"drop"} filterList=${object_Account_Id}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId8 ${object_Account_Id}
insert_policyId_to_file1 deny_sip_policyId10 ${policyId}
SecurityPolicy-Deny-SIP-000012
[Tags] calling ip source,from account ,deny block 480,若测试无源和目的的情况可以将/03-Variable/BifangApiVariable.txt中addTestClentIPFlag置为0
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount}
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-000012 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"block","code":"480"} filterList=${object_Account_Id}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId9 ${object_Account_Id}
insert_policyId_to_file1 deny_sip_policyId11 ${policyId}
SecurityPolicy-Deny-SIP-000013
[Tags] calling ip source,from account ,deny block 500,若测试无源和目的的情况可以将/03-Variable/BifangApiVariable.txt中addTestClentIPFlag置为0
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount}
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-000013 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"block","code":"500"} filterList=${object_Account_Id}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId10 ${object_Account_Id}
insert_policyId_to_file1 deny_sip_policyId12 ${policyId}
SecurityPolicy-Deny-SIP-000014
[Tags] calling ip source,to account ,deny drop
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount}
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-000014 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"drop"} filterList=${object_Account_Id}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId11 ${object_Account_Id}
insert_policyId_to_file1 deny_sip_policyId13 ${policyId}
SecurityPolicy-Deny-SIP-000015
[Tags] calling ip source,to account ,deny block 480
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount}
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-000015 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"block","code":"480"} filterList=${object_Account_Id}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId12 ${object_Account_Id}
insert_policyId_to_file1 deny_sip_policyId14 ${policyId}
SecurityPolicy-Deny-SIP-000016
[Tags] calling ip source,to account ,deny block 500
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount}
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-000016 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"block","code":"500"} filterList=${object_Account_Id}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId13 ${object_Account_Id}
insert_policyId_to_file1 deny_sip_policyId15 ${policyId}
SecurityPolicy-Deny-SIP-000017
[Tags] calling ip source,called domain ip dest,from account,to account ,allow , monitor and deny drop
Comment 创建domain ip dest
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建Account1
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount}
${rescode} ${object_Account_Id1} AddObject2 ${1} ${objectDict}
Comment 创建Account2
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount1}
${rescode} ${object_Account_Id2} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-000017 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"drop"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id2}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId14 ${objectId}
insert_policyId_to_file1 deny_sip_objectId15 ${object_Account_Id1}
insert_policyId_to_file1 deny_sip_objectId1501 ${object_Account_Id2}
insert_policyId_to_file1 deny_sip_policyId16 ${policyId}
SecurityPolicy-Deny-SIP-000018
[Tags] calling ip source,called domain ip dest,from account,to account ,allow , monitor and deny block 480
Comment 创建domain ip dest
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建Account1
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount}
${rescode} ${object_Account_Id1} AddObject2 ${1} ${objectDict}
Comment 创建Account2
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount1}
${rescode} ${object_Account_Id2} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-000018 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"block","code":"480"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id2}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId16 ${object_Account_Id1}
insert_policyId_to_file1 deny_sip_objectId1601 ${object_Account_Id2}
insert_policyId_to_file1 deny_sip_objectId17 ${objectId}
insert_policyId_to_file1 deny_sip_policyId17 ${policyId}
SecurityPolicy-Deny-SIP-000019
[Tags] calling ip source,called domain ip dest,from account,to account ,allow , monitor and deny block 500
Comment 创建domain ip dest
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建Account1
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount}
${rescode} ${object_Account_Id1} AddObject2 ${1} ${objectDict}
Comment 创建Account2
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount1}
${rescode} ${object_Account_Id2} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-000019 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"block","code":"500"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id2}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId18 ${object_Account_Id1}
insert_policyId_to_file1 deny_sip_objectId1801 ${object_Account_Id2}
insert_policyId_to_file1 deny_sip_objectId19 ${objectId}
insert_policyId_to_file1 deny_sip_policyId18 ${policyId}
SecurityPolicy-Deny-SIP-000020
[Tags] called ip dest,called domain ip source,from account,to account ,allow , monitor and deny
Comment 创建被叫方域名IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建被叫方IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP3} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建Account1
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount}
${rescode} ${object_Account_Id1} AddObject2 ${1} ${objectDict}
Comment 创建Account2
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount1}
${rescode} ${object_Account_Id2} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-000020 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"drop"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR destination=${objectId1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id2}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId20 ${objectId}
insert_policyId_to_file1 deny_sip_objectId21 ${objectId1}
insert_policyId_to_file1 deny_sip_objectId22 ${object_Account_Id1}
insert_policyId_to_file1 deny_sip_objectId23 ${object_Account_Id2}
insert_policyId_to_file1 deny_sip_policyId19 ${policyId}
SecurityPolicy-Deny-SIP-000021
[Tags] called ip dest,called domain ip source,from account,to account ,allow , monitor and deny
Comment 创建被叫方域名IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建被叫方IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP3} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建Account1
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount}
${rescode} ${object_Account_Id1} AddObject2 ${1} ${objectDict}
Comment 创建Account2
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount1}
${rescode} ${object_Account_Id2} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-000021 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"block","code":"480"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR destination=${objectId1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id2}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId24 ${objectId}
insert_policyId_to_file1 deny_sip_objectId25 ${objectId1}
insert_policyId_to_file1 deny_sip_objectId26 ${object_Account_Id1}
insert_policyId_to_file1 deny_sip_objectId27 ${object_Account_Id2}
insert_policyId_to_file1 deny_sip_policyId20 ${policyId}
SecurityPolicy-Deny-SIP-000022
[Tags] called ip dest,called domain ip source,from account,to account ,allow , monitor and deny
Comment 创建被叫方域名IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建被叫方IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP3} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建Account1
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount}
${rescode} ${object_Account_Id1} AddObject2 ${1} ${objectDict}
Comment 创建Account2
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount1}
${rescode} ${object_Account_Id2} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-000022 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"block","code":"500"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR destination=${objectId1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id2}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId28 ${objectId}
insert_policyId_to_file1 deny_sip_objectId29 ${objectId1}
insert_policyId_to_file1 deny_sip_objectId30 ${object_Account_Id1}
insert_policyId_to_file1 deny_sip_objectId31 ${object_Account_Id2}
insert_policyId_to_file1 deny_sip_policyId21 ${policyId}
SecurityPolicy-Deny-SIP-000023
[Tags] deny,SIP and RTP
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SipAndsip-000015 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","protocol":"RTP","method":"drop"} isValid=${0} appIdObjects=${SIP_ID},${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_policyId22 ${policyId}
SecurityPolicy-Deny-SIP-000024
[Tags] The largest combination1,deny drop,all conditions from,to
Comment 创建Account1
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$zdjzyq12voip
${rescode} ${object_Account_Id1} AddObject2 ${1} ${objectDict}
Comment 创建Account2
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=zdjzy*
${rescode} ${object_Account_Id2} AddObject2 ${1} ${objectDict}
Comment 创建Account3
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=yq12v
${rescode} ${object_Account_Id3} AddObject2 ${1} ${objectDict}
Comment 创建Account4
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*12voip
${rescode} ${object_Account_Id4} AddObject2 ${1} ${objectDict}
Comment 创建Account5
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$zdjzyq12voi
${rescode} ${object_Account_Id5} AddObject2 ${1} ${objectDict}
Comment 创建Account6
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*12voi
${rescode} ${object_Account_Id6} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SIP-000022 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SIP","method":"drop"} filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id2}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION,${object_Account_Id3}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id4}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION,${object_Account_Id5}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id6}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_sip_objectId32 ${object_Account_Id1}
insert_policyId_to_file1 deny_sip_objectId33 ${object_Account_Id2}
insert_policyId_to_file1 deny_sip_objectId34 ${object_Account_Id3}
insert_policyId_to_file1 deny_sip_objectId35 ${object_Account_Id4}
insert_policyId_to_file1 deny_sip_objectId36 ${object_Account_Id5}
insert_policyId_to_file1 deny_sip_objectId37 ${object_Account_Id6}
insert_policyId_to_file1 deny_sip_policyId23 ${policyId}

View File

@@ -1,135 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
*** Test Cases ***
SecurityPolicy-Deny-Ssl-00001
[Tags] sni fqdn完整和右匹配 update policy:ip geo,fqdn_sni
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.cxwl.com isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*freestockimages.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建categories
${addItemList1} Create Dictionary fqdn=$www.cxwl.com
${addItemList2} Create Dictionary fqdn=*freestockimages.ru
${addItemLists} Create list ${addItemList1} ${addItemList2}
${objectDict} Create Dictionary categoryType=fqdn categoryName=lkong objectSubType=category isValid=${1} fqdnList=${addItemLists}
${rescode} ${categoryObjId} ${categoryId} AddCategories ${1} ${objectDict} add 200
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=*www.cxwl.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
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 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Ssl-00001 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"rst"} filterList=${objectId}|TSG_FIELD_SSL_SNI,${categoryObjId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_ssl_objectId ${objectId}
insert_policyId_to_file1 deny_ssl_objectId4 ${objectId1}
insert_policyId_to_file1 deny_ssl_objectId5 ${objectId2}
insert_policyId_to_file1 deny_ssl_categoryId ${categoryId}
insert_policyId_to_file1 deny_ssl_policyId ${policyId}
SecurityPolicy-Deny-Ssl-00002
[Tags] cn cat右匹配
${iniCatId} GetIniCategoryId science
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*amesweb.info isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*rentar.com isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Ssl-00002 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"rst"} filterList=${iniCatId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_ssl_objectId1 ${objectId}
insert_policyId_to_file1 deny_ssl_policyId1 ${policyId}
SecurityPolicy-Deny-Ssl-00003
[Tags] san
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*austinama.org isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Ssl-00003 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"drop"} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_ssl_objectId2 ${objectId}
insert_policyId_to_file1 deny_ssl_policyId2 ${policyId}
SecurityPolicy-Deny-Ssl-00004
[Tags] 最大组合 update policy:fqdn_sni,fqdn_san,fqdn_cn
Comment 创建fqdn1
${addItemList1} Create Dictionary keywordArray=*prlib.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=$www.prlib.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Ssl-00004 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"drop"} filterList=${objectId}|TSG_FIELD_SSL_SAN,${objectId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_CN isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_ssl_objectId3 ${objectId}
insert_policyId_to_file1 deny_ssl_objectId6 ${objectId1}
insert_policyId_to_file1 deny_ssl_policyId3 ${policyId}
SecurityPolicy-Deny-Ssl-00005
[Tags] update policy:
Comment 创建fqdn1
${addItemList1} Create Dictionary keywordArray=*leisu.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建categories
${addItemList1} Create Dictionary fqdn=*leisu.com
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary categoryType=fqdn categoryName=leisu objectSubType=category isValid=${1} fqdnList=${addItemLists}
${rescode} ${categoryObjId} ${categoryId} AddCategories ${1} ${objectDict} add 200
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Ssl-00005 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"drop"} filterList=${objectId}|TSG_FIELD_SSL_SAN,${objectId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_CN,${categoryObjId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_ssl_objectId7 ${objectId}
insert_policyId_to_file1 deny_ssl_policyId4 ${policyId}
insert_policyId_to_file1 deny_ssl_categoryId ${categoryId}
SecurityPolicy-Deny-Ssl-00006
[Tags] the minimum match
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Ssl-00006 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"drop"} isValid=${0} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_ssl_policyId5 ${policyId}

View File

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

View File

@@ -1,657 +0,0 @@
*** 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
# Resource ../../../03-Variable/ApplicationID.txt
*** Variables ***
${url} /v1/policy/profile/hijackfiles
*** Test Cases ***
Proxy-Policy-hijack-00001
[Tags] fqdn完整匹配 update policy:fqdn,ip geo
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$vator.tv isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建categories
${addItemList1} Create Dictionary fqdn=$vator.tv
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary categoryType=fqdn categoryName=vator objectSubType=category isValid=${1} fqdnList=${addItemLists}
${rescode} ${categoryObjId} ${categoryId} AddCategories ${1} ${objectDict} add 200
Comment 创建url
${addItemList1} Create Dictionary keywordArray=or.tv/news isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test.apk hijack {"isValid":1,"contentType":"application/vnd.android.package-archive","opAction":"add","profileName":"test1","contentName":"Create-Hijack Files-test.apk","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
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
${addItemList1} Create Dictionary keywordArray=*tor.tv isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-hijack policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI,${categoryObjId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建hijack策略
${policyDict} Create Dictionary policyName=Proxy-Policy-hijack-00001 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL,${categoryObjId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 hijack_profileId ${profiledId}
insert_policyId_to_file1 hijack_objectId ${objectId}
insert_policyId_to_file1 hijack_objectId39 ${objectId1}
insert_policyId_to_file1 hijack_objectId42 ${objectId2}
insert_policyId_to_file1 hijack_objectId43 ${objectId3}
insert_policyId_to_file1 hijack_categoryId ${categoryId}
insert_policyId_to_file1 intercept_hijack_policyId ${policyId1}
insert_policyId_to_file1 hijack_policyId ${policyId2}
Proxy-Policy-hijack-00002
[Tags] cat右匹配
${iniCatId} GetIniCategoryId ugyhur
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.uqur.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=uqur.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-hijack policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${iniCatId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建hijack策略
${policyDict} Create Dictionary policyName=Proxy-Policy-hijack-00002 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${iniCatId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 hijack_profileId1 ${profiledId}
insert_policyId_to_file1 hijack_objectId1 ${objectId}
insert_policyId_to_file1 hijack_objectId40 ${objectId1}
insert_policyId_to_file1 intercept_hijack_policyId1 ${policyId1}
insert_policyId_to_file1 hijack_policyId1 ${policyId2}
Proxy-Policy-hijack-00003
[Tags] url4种匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*lexus.ru isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*oktrucking.org isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=*federalsignal.com isHexbin=${0}
${addItemList4} Create Dictionary keywordArray=*peasedev.org isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=www.lex* isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=$oktrucking.org/ isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=*signal.com/ isHexbin=${0}
${addItemList4} Create Dictionary keywordArray=peasedev isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-1.exe hijack {"isValid":1,"contentType":"application/x-msdos-program","opAction":"add","profileName":"test2","contentName":"Create-Hijack Files-test-1.exe","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-hijack policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建hijack策略
${policyDict} Create Dictionary policyName=Proxy-Policy-hijack-00003 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 hijack_profileId2 ${profiledId}
insert_policyId_to_file1 hijack_objectId2 ${objectId}
insert_policyId_to_file1 hijack_objectId3 ${objectId1}
insert_policyId_to_file1 intercept_hijack_policyId2 ${policyId1}
insert_policyId_to_file1 hijack_policyId2 ${policyId2}
Proxy-Policy-hijack-00004
[Tags] 请求头左匹配 update policy:url,请求头
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*huoshan.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=greenlive isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建url2
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=huoshan
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
Comment user-agent,创建请求头2
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-hijack policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建hijack策略
${policyDict} Create Dictionary policyName=Proxy-Policy-hijack-00004 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 hijack_profileId3 ${profiledId}
insert_policyId_to_file1 hijack_objectId4 ${objectId}
insert_policyId_to_file1 hijack_objectId5 ${objectId1}
insert_policyId_to_file1 hijack_objectId6 ${objectId2}
insert_policyId_to_file1 hijack_objectId44 ${objectId3}
insert_policyId_to_file1 hijack_objectId45 ${objectId4}
insert_policyId_to_file1 intercept_hijack_policyId3 ${policyId1}
insert_policyId_to_file1 hijack_policyId3 ${policyId2}
Proxy-Policy-hijack-00005
[Tags] 请求头完整匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.ixigua.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=channel/dianying/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-5.png hijack {"isValid":1,"contentType":"image/png","opAction":"add","profileName":"test4","contentName":"Create-Hijack Files-test-5.png","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-hijack policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建hijack策略
${policyDict} Create Dictionary policyName=Proxy-Policy-hijack-00005 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 hijack_profileId4 ${profiledId}
insert_policyId_to_file1 hijack_objectId7 ${objectId}
insert_policyId_to_file1 hijack_objectId8 ${objectId1}
insert_policyId_to_file1 hijack_objectId9 ${objectId2}
insert_policyId_to_file1 intercept_hijack_policyId4 ${policyId1}
insert_policyId_to_file1 hijack_policyId4 ${policyId2}
Proxy-Policy-hijack-00006
[Tags] 请求头字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.dcdapp.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=dongchediapp isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=AppleWebKit isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-4.jpeg hijack {"isValid":1,"contentType":"image/jpeg","opAction":"add","profileName":"test5","contentName":"Create-Hijack Files-test-4.jpeg","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-hijack policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建hijack策略
${policyDict} Create Dictionary policyName=Proxy-Policy-hijack-00006 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 hijack_profileId5 ${profiledId}
insert_policyId_to_file1 hijack_objectId10 ${objectId}
insert_policyId_to_file1 hijack_objectId11 ${objectId1}
insert_policyId_to_file1 hijack_objectId12 ${objectId2}
insert_policyId_to_file1 intercept_hijack_policyId5 ${policyId1}
insert_policyId_to_file1 hijack_policyId5 ${policyId2}
Proxy-Policy-hijack-00007
[Tags] 请求头右匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.gogokid.com.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=cn/teacher isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
# Comment 创建请求头
# ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
# ${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=*Safari/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-2.gif hijack {"isValid":1,"contentType":"image/gif","opAction":"add","profileName":"test6","contentName":"Create-Hijack Files-test-2.gif","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-hijack policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建hijack策略
${policyDict} Create Dictionary policyName=Proxy-Policy-hijack-00007 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 hijack_profileId6 ${profiledId}
insert_policyId_to_file1 hijack_objectId13 ${objectId}
insert_policyId_to_file1 hijack_objectId14 ${objectId1}
insert_policyId_to_file1 hijack_objectId15 ${objectId2}
insert_policyId_to_file1 intercept_hijack_policyId6 ${policyId1}
insert_policyId_to_file1 hijack_policyId6 ${policyId2}
Proxy-Policy-hijack-00008
[Tags] 应答头右匹配 update policy:应答头
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*mafengwo.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=wo.cn/mdd/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
# Comment 创建应答头
# ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*utf-8|Content-Type
# ${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=*utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
# Comment 创建应答头2
# ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=utf-8|Content-Type
# ${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
Comment 创建应答头2Content-Type
${addItemList1} Create Dictionary keywordArray=utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-hijack policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建hijack策略
${policyDict} Create Dictionary policyName=Proxy-Policy-hijack-00008 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 hijack_profileId7 ${profiledId}
insert_policyId_to_file1 hijack_objectId16 ${objectId}
insert_policyId_to_file1 hijack_objectId17 ${objectId1}
insert_policyId_to_file1 hijack_objectId18 ${objectId2}
insert_policyId_to_file1 hijack_objectId46 ${objectId3}
insert_policyId_to_file1 intercept_hijack_policyId7 ${policyId1}
insert_policyId_to_file1 hijack_policyId7 ${policyId2}
Proxy-Policy-hijack-00009
[Tags] 应答头完整匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*hexun.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=default.htm isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
# Comment 创建应答头
# ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
# ${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=$text/html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-hijack policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建hijack策略
${policyDict} Create Dictionary policyName=Proxy-Policy-hijack-00009 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 hijack_profileId8 ${profiledId}
insert_policyId_to_file1 hijack_objectId19 ${objectId}
insert_policyId_to_file1 hijack_objectId20 ${objectId1}
insert_policyId_to_file1 hijack_objectId21 ${objectId2}
insert_policyId_to_file1 intercept_hijack_policyId8 ${policyId1}
insert_policyId_to_file1 hijack_policyId8 ${policyId2}
Proxy-Policy-hijack-00010
[Tags] 应答头字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*axun.1616.net isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=/jiemeng.htm isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=text/html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-hijack policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建hijack策略
${policyDict} Create Dictionary policyName=Proxy-Policy-hijack-00010 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 hijack_profileId9 ${profiledId}
insert_policyId_to_file1 hijack_objectId22 ${objectId}
insert_policyId_to_file1 hijack_objectId23 ${objectId1}
insert_policyId_to_file1 hijack_objectId24 ${objectId2}
insert_policyId_to_file1 intercept_hijack_policyId9 ${policyId1}
insert_policyId_to_file1 hijack_policyId9 ${policyId2}
Proxy-Policy-hijack-00011
[Tags] 应答头左匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*airwargame.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=/eng/start/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=text* isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-1.exe hijack {"isValid":1,"contentType":"application/x-msdos-program","opAction":"add","profileName":"test2","contentName":"Create-Hijack Files-test-1.exe","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-hijack-011 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建hijack策略
${policyDict} Create Dictionary policyName=Proxy-Policy-hijack-00011 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 hijack_profileId10 ${profiledId}
insert_policyId_to_file1 hijack_objectId25 ${objectId}
insert_policyId_to_file1 hijack_objectId26 ${objectId1}
insert_policyId_to_file1 hijack_objectId27 ${objectId2}
insert_policyId_to_file1 intercept_hijack_policyId10 ${policyId1}
insert_policyId_to_file1 hijack_policyId10 ${policyId2}
Proxy-Policy-hijack-00012
[Tags] cookie字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.reval.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=corporates/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建cookie
${addItemList1} Create Dictionary keywordArray=saltkey isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-5.png hijack {"isValid":1,"contentType":"image/png","opAction":"add","profileName":"test4","contentName":"Create-Hijack Files-test-5.png","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-hijack policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建hijack策略
${policyDict} Create Dictionary policyName=Proxy-Policy-hijack-00012 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 hijack_profileId11 ${profiledId}
insert_policyId_to_file1 hijack_objectId28 ${objectId}
insert_policyId_to_file1 hijack_objectId29 ${objectId1}
insert_policyId_to_file1 hijack_objectId30 ${objectId2}
insert_policyId_to_file1 intercept_hijack_policyId11 ${policyId1}
insert_policyId_to_file1 hijack_policyId11 ${policyId2}
Proxy-Policy-hijack-00013
[Tags] set-cookie4种匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$nsscreencast.com,*edreams.net,*boutiquehotel.me,$www.united.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_nsscreencast_session_*|Set-Cookie,*Secure; SameSite=None|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,www.united.com
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-4.jpeg hijack {"isValid":1,"contentType":"image/jpeg","opAction":"add","profileName":"test5","contentName":"Create-Hijack Files-test-4.jpeg","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-hijack policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建hijack策略
${policyDict} Create Dictionary policyName=Proxy-Policy-hijack-00013 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR,${objectId2}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 hijack_profileId12 ${profiledId}
insert_policyId_to_file1 hijack_objectId31 ${objectId}
insert_policyId_to_file1 hijack_objectId32 ${objectId1}
insert_policyId_to_file1 hijack_objectId41 ${objectId2}
insert_policyId_to_file1 intercept_hijack_policyId12 ${policyId1}
insert_policyId_to_file1 hijack_policyId12 ${policyId2}
Proxy-Policy-hijack-00014
[Tags] 最大组合
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.travelzoo.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*collections/hotels/ihg-group-meta/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_qq_Id} AddObjects ${1} ${objectDict}
Comment 创建应答头
${addItemList1} Create Dictionary keywordArray=charset isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_yd_Id} AddObjects ${1} ${objectDict}
Comment 创建cookie
${addItemList1} Create Dictionary keywordArray=__stripe_sid isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ck_Id} AddObjects ${1} ${objectDict}
Comment 创建set-cookie
${addItemList1} Create Dictionary keywordArray=domain=travelzoo.com isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_sk_Id} AddObjects ${1} ${objectDict}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-2.gif hijack {"isValid":1,"contentType":"image/gif","opAction":"add","profileName":"test6","contentName":"Create-Hijack Files-test-2.gif","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-hijack policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建hijack策略
${policyDict} Create Dictionary policyName=Proxy-Policy-hijack-00014 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_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_sk_Id}|TSG_FIELD_HTTP_RES_HDR,${object_ck_Id}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 hijack_profileId13 ${profiledId}
insert_policyId_to_file1 hijack_objectId33 ${object_fqdn_Id}
insert_policyId_to_file1 hijack_objectId34 ${object_url_Id}
insert_policyId_to_file1 hijack_objectId35 ${object_qq_Id}
insert_policyId_to_file1 hijack_objectId36 ${object_yd_Id}
insert_policyId_to_file1 hijack_objectId37 ${object_ck_Id}
insert_policyId_to_file1 hijack_objectId38 ${object_sk_Id}
insert_policyId_to_file1 intercept_hijack_policyId13 ${policyId1}
insert_policyId_to_file1 hijack_policyId13 ${policyId2}
Proxy-Policy-hijack-000015
[Tags] substring
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$tengrinews.kz isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=tengrinews.kz/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment set-cookie8个子串,创建应答头
${addItemList1} Create Dictionary keywordArray=68747470,6f6e6c79,70617468,4d6178,416765,474d54,6d656761,65794a isHexbin=${1} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_sc_Id} AddObjects ${1} ${objectDict}
Comment user-agent8个子串,创建请求头
${addItemList1} Create Dictionary keywordArray=4d6f7a696c6c612f352e30,57696e646f7773,57696e3634,783634,4170706c65,65624b6974,4b48544d4c,6c696b65 isHexbin=${1} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ua_Id} AddObjects ${1} ${objectDict}
Comment cont-Type8个子串,创建应答头:text/html
${addItemList1} Create Dictionary keywordArray=7465,7874,746578,657874,74657874,6874,6d6c,68746d isHexbin=${1} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ct_Id} AddObjects ${1} ${objectDict}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-5.png hijack {"isValid":1,"contentType":"image/png","opAction":"add","profileName":"test4","contentName":"Create-Hijack Files-test-5.png","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-hijack15 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建hijack策略
${policyDict} Create Dictionary policyName=Proxy-Policy-hijack-000015 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${object_ua_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_sc_Id}|TSG_FIELD_HTTP_RES_HDR,${object_ct_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 hijack_profileId14 ${profiledId}
insert_policyId_to_file1 hijack_objectId47 ${objectId}
insert_policyId_to_file1 hijack_objectId48 ${objectId1}
insert_policyId_to_file1 hijack_objectId49 ${object_sc_Id}
insert_policyId_to_file1 hijack_objectId50 ${object_ua_Id}
insert_policyId_to_file1 hijack_objectId51 ${object_ct_Id}
insert_policyId_to_file1 intercept_hijack_policyId14 ${policyId1}
insert_policyId_to_file1 hijack_policyId14 ${policyId2}

View File

@@ -1,570 +0,0 @@
*** 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
# Resource ../../../03-Variable/ApplicationID.txt
*** Variables ***
${url} /v1/policy/profile/insertscripts
*** Test Cases ***
Proxy-Policy-insert-00001
[Tags] fqdn完整匹配 update policy:ip geo,fqdn
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.costcotravel.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建categories
${addItemList1} Create Dictionary fqdn=$www.costcotravel.com
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary categoryType=fqdn categoryName=costcotravel objectSubType=category isValid=${1} fqdnList=${addItemLists}
${rescode} ${categoryObjId} ${categoryId} AddCategories ${1} ${objectDict} add 200
Comment 创建url
${addItemList1} Create Dictionary keywordArray=costcotravel isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
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
${addItemList1} Create Dictionary keywordArray=*.costcotravel.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-insert-01 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI,${categoryObjId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=Proxy-Policy-insert-00001 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL,${categoryObjId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 insert_profileId ${profiledId}
insert_policyId_to_file1 insert_objectId ${objectId}
insert_policyId_to_file1 insert_objectId39 ${objectId1}
insert_policyId_to_file1 insert_categoryId ${categoryId}
insert_policyId_to_file1 insert_objectId41 ${objectId2}
insert_policyId_to_file1 insert_objectId42 ${objectId3}
insert_policyId_to_file1 intercept_insert_policyId ${policyId1}
insert_policyId_to_file1 insert_policyId ${policyId2}
Proxy-Policy-insert-00002
[Tags] cat右匹配
${iniCatId} GetIniCategoryId webphone
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.meilleurmobile.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=meilleurmobile isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-insert-02 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${iniCatId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=Proxy-Policy-insert-00002 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${iniCatId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL,${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 insert_profileId1 ${profiledId}
insert_policyId_to_file1 insert_objectId1 ${objectId}
insert_policyId_to_file1 insert_objectId40 ${objectId1}
insert_policyId_to_file1 insert_webphoneCatId ${objectId}
insert_policyId_to_file1 intercept_insert_policyId1 ${policyId1}
insert_policyId_to_file1 insert_policyId1 ${policyId2}
Proxy-Policy-insert-00003
[Tags] url4种匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*ttsdalepublicart.org isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=$www.troop508.org isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=*wordpress.com isHexbin=${0}
${addItemList4} Create Dictionary keywordArray=$www.doctorpoo.net isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=scottsdalepublic* isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=$www.troop508.org/ isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=doctorpoo isHexbin=${0}
${addItemList4} Create Dictionary keywordArray=*wordpress.com/ isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-insert-03 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=Proxy-Policy-insert-00003 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 insert_profileId2 ${profiledId}
insert_policyId_to_file1 insert_objectId2 ${objectId}
insert_policyId_to_file1 insert_objectId3 ${objectId1}
insert_policyId_to_file1 intercept_insert_policyId2 ${policyId1}
insert_policyId_to_file1 insert_policyId2 ${policyId2}
Proxy-Policy-insert-00004
[Tags] 请求头左匹配 update policy:url,请求头
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*viator.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=login_redirect isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建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=viator.com
# ${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=viator.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头2
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-insert-04 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=Proxy-Policy-insert-00004 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 insert_profileId3 ${profiledId}
insert_policyId_to_file1 insert_objectId4 ${objectId}
insert_policyId_to_file1 insert_objectId5 ${objectId1}
insert_policyId_to_file1 insert_objectId6 ${objectId2}
insert_policyId_to_file1 insert_objectId43 ${objectId3}
insert_policyId_to_file1 insert_objectId44 ${objectId4}
insert_policyId_to_file1 intercept_insert_policyId3 ${policyId1}
insert_policyId_to_file1 insert_policyId3 ${policyId2}
Proxy-Policy-insert-00005
[Tags] 请求头完整匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$matadornetwork.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=destinations isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建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-05 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=Proxy-Policy-insert-00005 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 insert_profileId4 ${profiledId}
insert_policyId_to_file1 insert_objectId7 ${objectId}
insert_policyId_to_file1 insert_objectId8 ${objectId1}
insert_policyId_to_file1 insert_objectId9 ${objectId2}
insert_policyId_to_file1 intercept_insert_policyId4 ${policyId1}
insert_policyId_to_file1 insert_policyId4 ${policyId2}
Proxy-Policy-insert-00006
[Tags] 请求头字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.farecompare.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=hotels/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建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-06 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=Proxy-Policy-insert-00006 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 insert_profileId5 ${profiledId}
insert_policyId_to_file1 insert_objectId10 ${objectId}
insert_policyId_to_file1 insert_objectId11 ${objectId1}
insert_policyId_to_file1 insert_objectId12 ${objectId2}
insert_policyId_to_file1 intercept_insert_policyId5 ${policyId1}
insert_policyId_to_file1 insert_policyId5 ${policyId2}
Proxy-Policy-insert-00007
[Tags] 请求头右匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.tripit.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=tripit isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
# Comment 创建请求头
# ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
# ${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=*Safari/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建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-07 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=Proxy-Policy-insert-00007 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 insert_profileId6 ${profiledId}
insert_policyId_to_file1 insert_objectId13 ${objectId}
insert_policyId_to_file1 insert_objectId14 ${objectId1}
insert_policyId_to_file1 insert_objectId15 ${objectId2}
insert_policyId_to_file1 intercept_insert_policyId6 ${policyId1}
insert_policyId_to_file1 insert_policyId6 ${policyId2}
Proxy-Policy-insert-00008
[Tags] 应答头右匹配 update policy :应答头
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*waikikibeachwalk.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=Shops.htm isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=*utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建应答头2Content-Type
${addItemList1} Create Dictionary keywordArray=utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-insert-08 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=Proxy-Policy-insert-00008 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 insert_profileId7 ${profiledId}
insert_policyId_to_file1 insert_objectId16 ${objectId}
insert_policyId_to_file1 insert_objectId17 ${objectId1}
insert_policyId_to_file1 insert_objectId18 ${objectId2}
insert_policyId_to_file1 insert_objectId45 ${objectId3}
insert_policyId_to_file1 intercept_insert_policyId7 ${policyId1}
insert_policyId_to_file1 insert_policyId7 ${policyId2}
Proxy-Policy-insert-00009
[Tags] 应答头完整匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*guides.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=nevada/las-vegas/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=$text/html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-insert-09 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=Proxy-Policy-insert-00009 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 insert_profileId8 ${profiledId}
insert_policyId_to_file1 insert_objectId19 ${objectId}
insert_policyId_to_file1 insert_objectId20 ${objectId1}
insert_policyId_to_file1 insert_objectId21 ${objectId2}
insert_policyId_to_file1 intercept_insert_policyId8 ${policyId1}
insert_policyId_to_file1 insert_policyId8 ${policyId2}
Proxy-Policy-insert-00010
[Tags] 应答头字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*cnstock.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=ck.com/kcb isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=text/html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-insert-10 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=Proxy-Policy-insert-00010 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 insert_profileId9 ${profiledId}
insert_policyId_to_file1 insert_objectId22 ${objectId}
insert_policyId_to_file1 insert_objectId23 ${objectId1}
insert_policyId_to_file1 insert_objectId24 ${objectId2}
insert_policyId_to_file1 intercept_insert_policyId9 ${policyId1}
insert_policyId_to_file1 insert_policyId9 ${policyId2}
Proxy-Policy-insert-00011
[Tags] 应答头左匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*newone.com.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=cwyw isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=text* isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-insert-11 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=Proxy-Policy-insert-00011 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 insert_profileId10 ${profiledId}
insert_policyId_to_file1 insert_objectId25 ${objectId}
insert_policyId_to_file1 insert_objectId26 ${objectId1}
insert_policyId_to_file1 insert_objectId27 ${objectId2}
insert_policyId_to_file1 intercept_insert_policyId10 ${policyId1}
insert_policyId_to_file1 insert_policyId10 ${policyId2}
Proxy-Policy-insert-00012
[Tags] cookie字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$petapixel.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=equipment/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建cookie
${addItemList1} Create Dictionary keywordArray=saltkey isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${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-12 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建insert策略
${policyDict} Create Dictionary policyName=Proxy-Policy-insert-00012 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 insert_profileId11 ${profiledId}
insert_policyId_to_file1 insert_objectId28 ${objectId}
insert_policyId_to_file1 insert_objectId29 ${objectId1}
insert_policyId_to_file1 insert_objectId30 ${objectId2}
insert_policyId_to_file1 intercept_insert_policyId11 ${policyId1}
insert_policyId_to_file1 insert_policyId11 ${policyId2}
Proxy-Policy-insert-00013
[Tags] 最大组合
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*intervalworld.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*world.com/web/my/home isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_qq_Id} AddObjects ${1} ${objectDict}
Comment 创建应答头
${addItemList1} Create Dictionary keywordArray=charset isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_yd_Id} AddObjects ${1} ${objectDict}
Comment 创建cookie
${addItemList1} Create Dictionary keywordArray=__stripe_sid isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ck_Id} AddObjects ${1} ${objectDict}
Comment 创建set-cookie
${addItemList1} Create Dictionary keywordArray=Domain=.intervalworld.com isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_sk_Id} AddObjects ${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-13 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建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=${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=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 insert_profileId13 ${profiledId}
insert_policyId_to_file1 insert_objectId33 ${object_fqdn_Id}
insert_policyId_to_file1 insert_objectId34 ${object_url_Id}
insert_policyId_to_file1 insert_objectId35 ${object_qq_Id}
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

@@ -1,106 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
*** Variables ***
*** Test Cases ***
SecurityPolicy-Intercept-Http-00001
[Tags] fqdn完整匹配 update policy:source geo
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建fqdn1
${addItemList1} Create Dictionary keywordArray=$www.yumi.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建categories
${addItemList1} Create Dictionary fqdn=$www.yumi.com
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary categoryType=fqdn categoryName=baomi objectSubType=category isValid=${1} fqdnList=${addItemLists}
${rescode} ${categoryObjId} ${categoryId} AddCategories ${1} ${objectDict} add 200
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-Http-00001 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST,${categoryObjId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 intercept_http_objectId ${objectId}
insert_policyId_to_file1 intercept_http_objectId1 ${objectId1}
insert_policyId_to_file1 intercept_http_categoryId ${categoryId}
insert_policyId_to_file1 intercept_http_policyId ${policyId}
SecurityPolicy-Intercept-Http-00002
[Tags] cat右匹配
${iniCatId} GetIniCategoryId recreation
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$mbzponton.org isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-Http-00002 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${iniCatId}|TSG_FIELD_HTTP_HOST,${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 intercept_http_objectId6 ${objectId}
insert_policyId_to_file1 intercept_http_policyId1 ${policyId}
SecurityPolicy-Intercept-Http-00003
[Tags] destination ip
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建destination ip
${addItemList1} Create Dictionary isSession=endpoint ip=192.168.40.158-192.168.40.158 port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-Http-00003 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} destination=${objectId1}|TSG_SECURITY_DESTINATION_ADDR filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 intercept_http_objectId2 ${objectId}
insert_policyId_to_file1 intercept_http_objectId3 ${objectId1}
insert_policyId_to_file1 intercept_http_policyId2 ${policyId}
SecurityPolicy-Intercept-Http-00004
[Tags] update policy:fqdn
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*zongheng.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=$www.zongheng.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-Http-00004 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 intercept_http_objectId4 ${objectId}
insert_policyId_to_file1 intercept_http_objectId5 ${objectId1}
insert_policyId_to_file1 intercept_http_policyId3 ${policyId}

View File

@@ -1,98 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
*** Variables ***
*** Test Cases ***
SecurityPolicy-Intercept-Ssl-00001
[Tags] fqdn完整匹配 update policy:source geo
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.reviewpro.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建ip geo
${addItemList1} Create Dictionary keywordArray=XXG地区.*
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=geo_location isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建categories
${addItemList1} Create Dictionary fqdn=$www.reviewpro.com
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary categoryType=fqdn categoryName=reviewpro objectSubType=category isValid=${1} fqdnList=${addItemLists}
${rescode} ${categoryObjId} ${categoryId} AddCategories ${1} ${objectDict} add 200
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-Ssl-00001 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI,${categoryObjId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 intercept_ssl_objectId ${objectId}
insert_policyId_to_file1 intercept_ssl_objectId1 ${objectId1}
insert_policyId_to_file1 intercept_ssl_categoryId ${categoryId}
insert_policyId_to_file1 intercept_ssl_policyId ${policyId}
SecurityPolicy-Intercept-Ssl-00002
[Tags] category
${iniCatId} GetIniCategoryId warez
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*fenopy.se isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-Ssl-00002 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${iniCatId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 intercept_ssl_objectId2 ${objectId}
insert_policyId_to_file1 intercept_ssl_policyId1 ${policyId}
SecurityPolicy-Intercept-Ssl-00003
[Tags] fqdn other Certificate update policy:fqdn
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.xs8.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=*xs8.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-Ssl-00003 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":9,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 intercept_ssl_objectId3 ${objectId}
insert_policyId_to_file1 intercept_ssl_objectId4 ${objectId1}
insert_policyId_to_file1 intercept_ssl_policyId2 ${policyId}
SecurityPolicy-Intercept-Ssl-00004
[Tags] category Other Certificate to replace
${iniCatId} GetIniCategoryId weapons
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*worldweapon.info isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-Ssl-00004 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":9,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${iniCatId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 intercept_ssl_objectId5 ${objectId}
insert_policyId_to_file1 intercept_ssl_policyId3 ${policyId}

View File

@@ -1,79 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
*** Test Cases ***
SecurityPolicy-Monitor-Dns-00001
[Tags] fqdn完整和右匹配 update policy:ip geo,fqdn_sni
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$travelgam.com isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*flyaurora.ru isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=*travelgam.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
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 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Dns-00001 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"DNS"} filterList=${objectId}|TSG_FIELD_DNS_QNAME isValid=${1} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_dns_objectId ${objectId}
insert_policyId_to_file1 monitor_dns_objectId1 ${objectId1}
insert_policyId_to_file1 monitor_dns_objectId2 ${objectId2}
insert_policyId_to_file1 monitor_dns_policyId ${policyId}
SecurityPolicy-Monitor-Dns-00002
[Tags] fqdn_cat
${iniCatId} GetIniCategoryId weapons
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Dns-00002 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"DNS"} filterList=${iniCatId}|TSG_FIELD_DNS_QNAME isValid=${1} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
#insert_policyId_to_file1 monitor_dns_objectId1 ${objectId}
insert_policyId_to_file1 monitor_dns_policyId1 ${policyId}
SecurityPolicy-Monitor-Dns-00003
[Tags] update destination:ip learning
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*u17.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Dns-00003 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"DNS"} filterList=${objectId}|TSG_FIELD_DNS_QNAME isValid=${1} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_dns_objectId3 ${objectId}
insert_policyId_to_file1 monitor_dns_policyId2 ${policyId}
SecurityPolicy-Monitor-Dns-00004
[Tags] the minimum match
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Dns-00004 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"DNS"} isValid=${0} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_dns_policyId3 ${policyId}

View File

@@ -1,142 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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
# Resource ../../../03-Variable/ApplicationID.txt
*** Test Cases ***
SecurityPolicy-Monitor-Ftp-00001
[Tags] 子串匹配 update :ip geo,url,content,account
Comment 创建Account1
${addItemList1} Create Dictionary keywordArray=ftpuser isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建url1
${addItemList1} Create Dictionary keywordArray=123zxcvbnm.txt isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建content1
${addItemList1} Create Dictionary keywordArray=crfvtgbyhnuj isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_content_Id} AddObjects ${1} ${objectDict}
Comment 创建ip geo
${addItemList1} Create Dictionary keywordArray=XXG地区.*
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=geo_location isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建Account2
${addItemList1} Create Dictionary keywordArray=$ftpuser isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建url2
${addItemList1} Create Dictionary keywordArray=*cvbnm.txt isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id1} AddObjects ${1} ${objectDict}
Comment 创建content2
${addItemList1} Create Dictionary keywordArray=*tgbyhnuj isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_content_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-FTP-00001 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"FTP"} filterList=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT,${object_content_Id}|TSG_FIELD_FTP_CONTENT,${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_ftp_objectId ${object_Account_Id}
insert_policyId_to_file1 monitor_ftp_objectId1 ${object_url_Id}
insert_policyId_to_file1 monitor_ftp_objectId2 ${object_content_Id}
insert_policyId_to_file1 monitor_ftp_objectId12 ${objectId1}
insert_policyId_to_file1 monitor_ftp_objectId13 ${object_Account_Id1}
insert_policyId_to_file1 monitor_ftp_objectId14 ${object_url_Id1}
insert_policyId_to_file1 monitor_ftp_objectId15 ${object_content_Id1}
insert_policyId_to_file1 monitor_ftp_policyId ${policyId}
SecurityPolicy-Monitor-Ftp-00002
[Tags] 右匹配
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=*user isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*amp.txt isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建content
${addItemList1} Create Dictionary keywordArray=*Shandong Province isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_content_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-FTP-00002 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"FTP"} filterList=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT,${object_content_Id}|TSG_FIELD_FTP_CONTENT,${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_ftp_objectId3 ${object_Account_Id}
insert_policyId_to_file1 monitor_ftp_objectId4 ${object_url_Id}
insert_policyId_to_file1 monitor_ftp_objectId5 ${object_content_Id}
insert_policyId_to_file1 monitor_ftp_policyId1 ${policyId}
SecurityPolicy-Monitor-Ftp-00003
[Tags] 完整匹配
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=$ftpuser isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=$ftp://192.168.40.158/qwert.txt isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建content
${addItemList1} Create Dictionary keywordArray=$花好听的名字 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_content_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-FTP-00003 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"FTP"} filterList=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT,${object_content_Id}|TSG_FIELD_FTP_CONTENT,${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_ftp_objectId6 ${object_Account_Id}
insert_policyId_to_file1 monitor_ftp_objectId7 ${object_url_Id}
insert_policyId_to_file1 monitor_ftp_objectId8 ${object_content_Id}
insert_policyId_to_file1 monitor_ftp_policyId2 ${policyId}
SecurityPolicy-Monitor-Ftp-00004
[Tags] 左匹配
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=ftpu* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=ftp://192.168.40* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建content
${addItemList1} Create Dictionary keywordArray=уютных а* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_content_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-FTP-00004 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"FTP"} filterList=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT,${object_content_Id}|TSG_FIELD_FTP_CONTENT,${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appIdObjects=${FTP_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_ftp_objectId9 ${object_Account_Id}
insert_policyId_to_file1 monitor_ftp_objectId10 ${object_url_Id}
insert_policyId_to_file1 monitor_ftp_objectId11 ${object_content_Id}
insert_policyId_to_file1 monitor_ftp_policyId3 ${policyId}

View File

@@ -1,483 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
*** Variables ***
*** Test Cases ***
SecurityPolicy-Monitor-Http-00001
[Tags] fqdn完整匹配 update policy:ip geo,fqdn
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.jrj.com.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建categories
${addItemList1} Create Dictionary fqdn=$www.jrj.com.cn
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary categoryType=fqdn categoryName=jrj objectSubType=category isValid=${1} fqdnList=${addItemLists}
${rescode} ${categoryObjId} ${categoryId} AddCategories ${1} ${objectDict} add 200
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=*jrj.com.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
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 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00001 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST,${categoryObjId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId ${objectId}
insert_policyId_to_file1 monitor_http_categoryId ${categoryId}
insert_policyId_to_file1 monitor_http_objectId33 ${objectId1}
insert_policyId_to_file1 monitor_http_objectId34 ${objectId2}
insert_policyId_to_file1 monitor_http_policyId ${policyId}
SecurityPolicy-Monitor-Http-00002
[Tags] cat右匹配
${iniCatId} GetIniCategoryId news
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*fitzhughmedia.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00002 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${iniCatId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId1 ${objectId}
insert_policyId_to_file1 monitor_http_policyId1 ${policyId}
SecurityPolicy-Monitor-Http-00003
[Tags] url4种匹配
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*portal/zh_CN/home/index.html isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=www.nuk-baby.ru* isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=davidsmithhunting.com isHexbin=${0}
${addItemList4} Create Dictionary keywordArray=crosswordheaven isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00003 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId2 ${objectId}
insert_policyId_to_file1 monitor_http_policyId2 ${policyId}
SecurityPolicy-Monitor-Http-00004
[Tags] 请求头左匹配 update url,请求头
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*quotes.html isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建url2
${addItemList1} Create Dictionary keywordArray=quotes.html isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00004 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId3 ${objectId}
insert_policyId_to_file1 monitor_http_objectId4 ${object_url_Id}
insert_policyId_to_file1 monitor_http_objectId35 ${objectId1}
insert_policyId_to_file1 monitor_http_objectId36 ${object_url_Id1}
insert_policyId_to_file1 monitor_http_policyId3 ${policyId}
SecurityPolicy-Monitor-Http-00005
[Tags] 请求头完整匹配
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*home/bj/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00005 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId5 ${object_url_Id}
insert_policyId_to_file1 monitor_http_objectId6 ${objectId}
insert_policyId_to_file1 monitor_http_policyId4 ${policyId}
SecurityPolicy-Monitor-Http-00006
[Tags] 请求头字串匹配与hijack-009中的安全策略验证优先级
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=AppleWebKit/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=fundType isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00006 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId7 ${object_url_Id}
insert_policyId_to_file1 monitor_http_objectId8 ${objectId}
insert_policyId_to_file1 monitor_http_policyId5 ${policyId}
SecurityPolicy-Monitor-Http-00007
[Tags] 请求头右匹配
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=*Safari/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*games/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00007 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId9 ${object_url_Id}
insert_policyId_to_file1 monitor_http_objectId10 ${objectId}
insert_policyId_to_file1 monitor_http_policyId6 ${policyId}
SecurityPolicy-Monitor-Http-00008
[Tags] 应答头右匹配 update 应答头
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*index.shtml isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=*html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建应答头2Content-Type
${addItemList1} Create Dictionary keywordArray=html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00008 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId11 ${object_url_Id}
insert_policyId_to_file1 monitor_http_objectId12 ${objectId}
insert_policyId_to_file1 monitor_http_objectId37 ${objectId1}
insert_policyId_to_file1 monitor_http_policyId7 ${policyId}
SecurityPolicy-Monitor-Http-00009
[Tags] 应答头完整匹配
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*org/facts isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=$text/html; charset=utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00009 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId13 ${object_url_Id}
insert_policyId_to_file1 monitor_http_objectId14 ${objectId}
insert_policyId_to_file1 monitor_http_policyId8 ${policyId}
SecurityPolicy-Monitor-Http-00010
[Tags] 应答头字串匹配
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*videogix.com/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00010 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId15 ${object_url_Id}
insert_policyId_to_file1 monitor_http_objectId16 ${objectId}
insert_policyId_to_file1 monitor_http_policyId9 ${policyId}
SecurityPolicy-Monitor-Http-00011
[Tags] 应答头左匹配
Comment 创建url
${addItemList1} Create Dictionary keywordArray=ors.com/about/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=text* isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00010 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId17 ${object_url_Id}
insert_policyId_to_file1 monitor_http_objectId18 ${objectId}
insert_policyId_to_file1 monitor_http_policyId10 ${policyId}
SecurityPolicy-Monitor-Http-00012
[Tags] cookie字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*www.titter.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建请求头cookie
${addItemList1} Create Dictionary keywordArray=wingsofprey isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00012 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId19 ${objectId}
insert_policyId_to_file1 monitor_http_objectId45 ${object_fqdn_Id}
insert_policyId_to_file1 monitor_http_policyId11 ${policyId}
SecurityPolicy-Monitor-Http-00013
[Tags] set-cookie4种匹配
Comment 创建Set-Cookie
${addItemList1} Create Dictionary keywordArray=$tplVer=06-18 isHexbin=${0} district=Set-Cookie
${addItemList2} Create Dictionary keywordArray=*domain=bing.com isHexbin=${0} district=Set-Cookie
${addItemList3} Create Dictionary keywordArray=domain=www.spore.com isHexbin=${0} district=Set-Cookie
${addItemList4} Create Dictionary keywordArray=domain=cye=beijing* isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00013 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId20 ${objectId}
insert_policyId_to_file1 monitor_http_policyId12 ${policyId}
SecurityPolicy-Monitor-Http-00014
[Tags] 请求体字串匹配 update policy:请求体
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
Comment 创建请求体
${addItemList1} Create Dictionary keywordArray=monitortest141 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建请求体2
${addItemList1} Create Dictionary keywordArray=monitortest142 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00014 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${objectId}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId40 ${object_fqdn_Id}
insert_policyId_to_file1 monitor_http_objectId21 ${objectId}
insert_policyId_to_file1 monitor_http_objectId38 ${objectId1}
insert_policyId_to_file1 monitor_http_policyId13 ${policyId}
SecurityPolicy-Monitor-Http-00015
[Tags] 应答体字串匹配
Comment 创建应答体
${addItemList1} Create Dictionary keywordArray=我的自选 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建应答体2
${addItemList1} Create Dictionary keywordArray=*我的自选 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00015 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId22 ${objectId}
insert_policyId_to_file1 monitor_http_objectId39 ${objectId1}
insert_policyId_to_file1 monitor_http_policyId14 ${policyId}
SecurityPolicy-Monitor-Http-00016
[Tags] 最大组合1
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=open.node isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_qq_Id} AddObjects ${1} ${objectDict}
Comment 创建应答头
${addItemList1} Create Dictionary keywordArray=charset isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_yd_Id} AddObjects ${1} ${objectDict}
Comment 创建请求体
${addItemList1} Create Dictionary keywordArray=monitorHttp0016 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_body_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00016 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_qq_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_yd_Id}|TSG_FIELD_HTTP_RES_HDR,${object_body_Id}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId23 ${object_fqdn_Id}
insert_policyId_to_file1 monitor_http_objectId24 ${object_url_Id}
insert_policyId_to_file1 monitor_http_objectId25 ${object_qq_Id}
insert_policyId_to_file1 monitor_http_objectId26 ${object_yd_Id}
insert_policyId_to_file1 monitor_http_objectId27 ${object_body_Id}
insert_policyId_to_file1 monitor_http_policyId15 ${policyId}
SecurityPolicy-Monitor-Http-00017
[Tags] 最大组合2
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*airwargame.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*/eng/start/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建cookie
${addItemList1} Create Dictionary keywordArray=wingsofprey isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ck_Id} AddObjects ${1} ${objectDict}
Comment 创建set-cookie
${addItemList1} Create Dictionary keywordArray=wingsofprey isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_yd_Id} AddObjects ${1} ${objectDict}
Comment 创建应答体
${addItemList1} Create Dictionary keywordArray=Last news isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_body_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00017 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_ck_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_yd_Id}|TSG_FIELD_HTTP_RES_HDR,${object_body_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId28 ${object_fqdn_Id}
insert_policyId_to_file1 monitor_http_objectId29 ${object_url_Id}
insert_policyId_to_file1 monitor_http_objectId30 ${object_ck_Id}
insert_policyId_to_file1 monitor_http_objectId31 ${object_yd_Id}
insert_policyId_to_file1 monitor_http_objectId32 ${object_body_Id}
insert_policyId_to_file1 monitor_http_policyId16 ${policyId}
SecurityPolicy-Monitor-Http-00018
[Tags] substring
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$sports.xinhuanet.com/index.htm
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
Comment cookie8个子串,创建请求头
${addItemList1} Create Dictionary keywordArray=7764,636964,756964,77646c617374,363964,3666653461,3462326663,38346463633835 isHexbin=${1} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ck_Id} AddObjects ${1} ${objectDict}
Comment user-agent8个子串,创建请求头
${addItemList1} Create Dictionary keywordArray=4d6f7a696c6c612f352e30,57696e646f7773,57696e3634,783634,4170706c65,65624b6974,4b48544d4c,6c696b65 isHexbin=${1} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ua_Id} AddObjects ${1} ${objectDict}
Comment cont-Type8个子串,创建应答头:text/html
${addItemList1} Create Dictionary keywordArray=7465,7874,746578,657874,74657874,6874,6d6c,68746d isHexbin=${1} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ct_Id} AddObjects ${1} ${objectDict}
# Comment set-cookie8个子串,创建应答头
# ${addItemList1} Create Dictionary keywordArray=7465,78742f,6874,6d6c,68746d6c,63686172,736574,63686172736574 isHexbin=${1} district=Set-Cookie
# ${addItemLists} Create list ${addItemList1}
# ${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
# ${rescode} ${object_ct_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Http-00018 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"HTTP"} filterList=${object_url_Id}|TSG_FIELD_HTTP_URL,${object_ck_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_ct_Id}|TSG_FIELD_HTTP_RES_HDR,${object_ua_Id}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_http_objectId41 ${object_url_Id}
insert_policyId_to_file1 monitor_http_objectId42 ${object_ck_Id}
insert_policyId_to_file1 monitor_http_objectId43 ${object_ua_Id}
insert_policyId_to_file1 monitor_http_objectId44 ${object_ct_Id}
insert_policyId_to_file1 monitor_http_policyId17 ${policyId}

View File

@@ -1,382 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
*** Test Cases ***
SecurityPolicy-Monitor-Mail-00001
[Tags] content字串匹配 update :ip geo,Content
Comment 创建Content1
${addItemList1} Create Dictionary keywordArray=zzzzz isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Content_Id} AddObjects ${1} ${objectDict}
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建Content2
${addItemList1} Create Dictionary keywordArray=*zzz isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Content_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00001 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} filterList=${object_Content_Id}|TSG_FIELD_MAIL_CONTENT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_mail_objectId ${object_Content_Id}
insert_policyId_to_file1 monitor_mail_objectId32 ${objectId}
insert_policyId_to_file1 monitor_mail_objectId33 ${object_Content_Id1}
insert_policyId_to_file1 monitor_mail_policyId ${policyId}
SecurityPolicy-Monitor-Mail-00002
[Tags] att_cont字串匹配 update:att_cont
Comment 创建ATT_CONT1
${addItemList1} Create Dictionary keywordArray=朱明明测试文件 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ATT_CONT_Id} AddObjects ${1} ${objectDict}
Comment 创建ATT_CONT2
${addItemList1} Create Dictionary keywordArray=$朱明明测试文件内容 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ATT_CONT_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00002 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} filterList=${object_ATT_CONT_Id}|TSG_FIELD_MAIL_ATT_CONTENT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_mail_objectId1 ${object_ATT_CONT_Id}
insert_policyId_to_file1 monitor_mail_objectId34 ${object_ATT_CONT_Id1}
insert_policyId_to_file1 monitor_mail_policyId1 ${policyId}
SecurityPolicy-Monitor-Mail-00003
[Tags] subject右匹配 from右匹配 update :subject, from
Comment 创建Subject1
${addItemList1} Create Dictionary keywordArray=*асятся isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建From1
${addItemList1} Create Dictionary keywordArray=*qq.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id} AddObjects ${1} ${objectDict}
Comment 创建Subject2
${addItemList1} Create Dictionary keywordArray=асятся isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id1} AddObjects ${1} ${objectDict}
Comment 创建From2
${addItemList1} Create Dictionary keywordArray=qq.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00003 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} filterList=${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_mail_objectId2 ${object_Subject_Id}
insert_policyId_to_file1 monitor_mail_objectId3 ${object_From_Id}
insert_policyId_to_file1 monitor_mail_objectId35 ${object_Subject_Id1}
insert_policyId_to_file1 monitor_mail_objectId36 ${object_From_Id1}
insert_policyId_to_file1 monitor_mail_policyId2 ${policyId}
SecurityPolicy-Monitor-Mail-00004
[Tags] subject完整匹配 from完整匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=$后天周末 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建From
${addItemList1} Create Dictionary keywordArray=$2662136486@qq.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00004 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} filterList=${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_mail_objectId4 ${object_Subject_Id}
insert_policyId_to_file1 monitor_mail_objectId5 ${object_From_Id}
insert_policyId_to_file1 monitor_mail_policyId3 ${policyId}
SecurityPolicy-Monitor-Mail-00005
[Tags] subject字串匹配 from字串匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=210zxcv isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建From
${addItemList1} Create Dictionary keywordArray=36486 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00005 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} filterList=${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_mail_objectId6 ${object_Subject_Id}
insert_policyId_to_file1 monitor_mail_objectId7 ${object_From_Id}
insert_policyId_to_file1 monitor_mail_policyId4 ${policyId}
SecurityPolicy-Monitor-Mail-00006
[Tags] subject左匹配 from左匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=Tomator* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建From
${addItemList1} Create Dictionary keywordArray=26621* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00006 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} filterList=${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_mail_objectId8 ${object_Subject_Id}
insert_policyId_to_file1 monitor_mail_objectId9 ${object_From_Id}
insert_policyId_to_file1 monitor_mail_policyId5 ${policyId}
SecurityPolicy-Monitor-Mail-00007
[Tags] to右匹配 subject右匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=*ируете isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=*geedgenetworks.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_To_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00007 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} filterList=${object_To_Id}|TSG_FIELD_MAIL_TO,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_mail_objectId10 ${object_Subject_Id}
insert_policyId_to_file1 monitor_mail_objectId11 ${object_To_Id}
insert_policyId_to_file1 monitor_mail_policyId6 ${policyId}
SecurityPolicy-Monitor-Mail-00008
[Tags] to完整匹配 subject完整匹配 update:to
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=$asdf741852 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=$hebingning@geedgenetworks.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_To_Id} AddObjects ${1} ${objectDict}
Comment 创建To2
${addItemList1} Create Dictionary keywordArray=geedgenetworks.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_To_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00008 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} filterList=${object_To_Id}|TSG_FIELD_MAIL_TO,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_mail_objectId12 ${object_Subject_Id}
insert_policyId_to_file1 monitor_mail_objectId13 ${object_To_Id}
insert_policyId_to_file1 monitor_mail_objectId37 ${object_To_Id1}
insert_policyId_to_file1 monitor_mail_policyId7 ${policyId}
SecurityPolicy-Monitor-Mail-00009
[Tags] to字串匹配 subject字串匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=又过一天 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=hebingning@geedgenetworks.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_To_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00009 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} filterList=${object_To_Id}|TSG_FIELD_MAIL_TO,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_mail_objectId14 ${object_Subject_Id}
insert_policyId_to_file1 monitor_mail_objectId15 ${object_To_Id}
insert_policyId_to_file1 monitor_mail_policyId8 ${policyId}
SecurityPolicy-Monitor-Mail-00010
[Tags] to右匹配 subject右匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=weeke* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=hebingning* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_To_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00010 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} filterList=${object_To_Id}|TSG_FIELD_MAIL_TO,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_mail_objectId16 ${object_Subject_Id}
insert_policyId_to_file1 monitor_mail_objectId17 ${object_To_Id}
insert_policyId_to_file1 monitor_mail_policyId9 ${policyId}
SecurityPolicy-Monitor-Mail-00011
[Tags] account右匹配 subject右匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=*发送成功 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=*qq.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00011 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_mail_objectId18 ${object_Subject_Id}
insert_policyId_to_file1 monitor_mail_objectId19 ${object_Account_Id}
insert_policyId_to_file1 monitor_mail_policyId10 ${policyId}
SecurityPolicy-Monitor-Mail-00012
[Tags] account完整匹配 subject完整匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=$ограничительным isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=$2662136486@qq.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00012 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_mail_objectId20 ${object_Subject_Id}
insert_policyId_to_file1 monitor_mail_objectId21 ${object_Account_Id}
insert_policyId_to_file1 monitor_mail_policyId11 ${policyId}
SecurityPolicy-Monitor-Mail-00013
[Tags] account字串匹配 subject字串匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=258zxc isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=2662136486@qq.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00013 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_mail_objectId22 ${object_Subject_Id}
insert_policyId_to_file1 monitor_mail_objectId23 ${object_Account_Id}
insert_policyId_to_file1 monitor_mail_policyId12 ${policyId}
SecurityPolicy-Monitor-Mail-00014
[Tags] account左匹配 subject左匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=一小时一天* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=26621* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00014 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_mail_objectId24 ${object_Subject_Id}
insert_policyId_to_file1 monitor_mail_objectId25 ${object_Account_Id}
insert_policyId_to_file1 monitor_mail_policyId13 ${policyId}
SecurityPolicy-Monitor-Mail-00015
[Tags] 最大组合
Comment 创建Subject
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=$要留清白在人间
${rescode} ${object_Subject_Id} AddObject2 ${1} ${objectDict}
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=266213*
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
Comment 创建Content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=good
${rescode} ${object_Content_Id} AddObject2 ${1} ${objectDict}
Comment 创建ATT_CONT
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Простопорно
${rescode} ${object_ATT_CONT_Id} AddObject2 ${1} ${objectDict}
Comment 创建From
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=2662136486
${rescode} ${object_From_Id} AddObject2 ${1} ${objectDict}
Comment 创建To
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=hebingning
${rescode} ${object_To_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00015 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT,${object_Content_Id}|TSG_FIELD_MAIL_CONTENT,${object_ATT_CONT_Id}|TSG_FIELD_MAIL_ATT_CONTENT,${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_To_Id}|TSG_FIELD_MAIL_TO isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_mail_objectId26 ${object_Subject_Id}
insert_policyId_to_file1 monitor_mail_objectId27 ${object_Content_Id}
insert_policyId_to_file1 monitor_mail_objectId28 ${object_ATT_CONT_Id}
insert_policyId_to_file1 monitor_mail_objectId29 ${object_From_Id}
insert_policyId_to_file1 monitor_mail_objectId30 ${object_To_Id}
insert_policyId_to_file1 monitor_mail_objectId31 ${object_Account_Id}
insert_policyId_to_file1 monitor_mail_policyId14 ${policyId}
SecurityPolicy-Monitor-Mail-00016
[Tags] content右匹配
Comment 创建Subject
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=monitorMail16
${rescode} ${object_Subject_Id} AddObject2 ${1} ${objectDict}
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=2662136486
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
Comment 创建Content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Monitor16*
${rescode} ${object_Content_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00016 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT,${object_Content_Id}|TSG_FIELD_MAIL_CONTENT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_mail_objectId38 ${object_Subject_Id}
insert_policyId_to_file1 monitor_mail_objectId39 ${object_Account_Id}
insert_policyId_to_file1 monitor_mail_policyId15 ${policyId}

View File

@@ -1,173 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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
# Resource ../../../03-Variable/ApplicationID.txt
*** Test Cases ***
SecurityPolicy-Monitor-Rtp-00001
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建目的IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipOutListenIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Rtp-00001 policyType=tsg_security policyDesc=autotest action=monitor source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR userRegion={"protocol":"RTP"} isValid=${1} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_rtp_objectId8 ${object_Ip_Id}
insert_policyId_to_file1 monitor_rtp_objectId9 ${object_Ip_Id1}
insert_policyId_to_file1 monitor_rtp_policyId ${policyId}
SecurityPolicy-Monitor-Rtp-00002
[Tags] calling ip port source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=192.168.50.60-192.168.50.60 port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Rtp-00002 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"RTP"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_rtp_objectId ${objectId}
insert_policyId_to_file1 monitor_rtp_policyId1 ${policyId}
SecurityPolicy-Monitor-Rtp-00003
[Tags] calling subid source
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Rtp-00003 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"RTP"} defaultClient=clientsubid isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_rtp_policyId2 ${policyId}
SecurityPolicy-Monitor-Rtp-00004
[Tags] calling ip geo source
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Rtp-00004 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"RTP"} source=${objectId}|TSG_SECURITY_SOURCE_LOCATION isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_rtp_objectId1 ${objectId}
insert_policyId_to_file1 monitor_rtp_policyId3 ${policyId}
SecurityPolicy-Monitor-Rtp-00005
[Tags] called domain ip source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=192.168.50.2-192.168.50.2 port=0-0 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Rtp-00005 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"RTP"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_rtp_objectId2 ${objectId}
insert_policyId_to_file1 monitor_rtp_policyId4 ${policyId}
SecurityPolicy-Monitor-Rtp-00006
[Tags] called domain ip port source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=192.168.50.2-192.168.50.2 port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Rtp-00006 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"RTP"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_rtp_objectId3 ${objectId}
insert_policyId_to_file1 monitor_rtp_policyId5 ${policyId}
SecurityPolicy-Monitor-Rtp-00007
[Tags] called domain ip geo source
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Rtp-00007 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"RTP"} source=${objectId}|TSG_SECURITY_SOURCE_LOCATION isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_rtp_objectId4 ${objectId}
insert_policyId_to_file1 monitor_rtp_policyId6 ${policyId}
SecurityPolicy-Monitor-Rtp-00008
[Tags] called domain ip source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=192.168.50.2-192.168.50.2 port=0-0 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Rtp-00005 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"RTP"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_rtp_objectId5 ${objectId}
insert_policyId_to_file1 monitor_rtp_policyId7 ${policyId}
SecurityPolicy-Monitor-Rtp-00009
[Tags] called domain ip port source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=192.168.50.2-192.168.50.2 port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Rtp-00006 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"RTP"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_rtp_objectId6 ${objectId}
insert_policyId_to_file1 monitor_rtp_policyId8 ${policyId}
SecurityPolicy-Monitor-Rtp-000010
[Tags] called domain ip geo source
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Rtp-00007 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"RTP"} destination=${objectId}|TSG_SECURITY_DESTINATION_LOCATION isValid=${0} appIdObjects=${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_rtp_objectId7 ${objectId}
insert_policyId_to_file1 monitor_rtp_policyId9 ${policyId}

View File

@@ -1,431 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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
# Resource ../../../03-Variable/ApplicationID.txt
*** Test Cases ***
SecurityPolicy-Monitor-SIP-00001
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建from
${addItemList1} Create Dictionary keywordArray=test106 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-00001 policyType=tsg_security policyDesc=autotest action=monitor source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION userRegion={"protocol":"SIP"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId23 ${object_Ip_Id}
insert_policyId_to_file1 monitor_sip_objectId24 ${object_Account_Id1}
insert_policyId_to_file1 monitor_sip_policyId ${policyId}
SecurityPolicy-Monitor-SIP-00001-1
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建to
${addItemList1} Create Dictionary keywordArray=test10 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-00001 policyType=tsg_security policyDesc=autotest action=monitor source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION userRegion={"protocol":"SIP"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId25 ${object_Ip_Id}
insert_policyId_to_file1 monitor_sip_objectId26 ${object_Account_Id1}
insert_policyId_to_file1 monitor_sip_policyId17 ${policyId}
SecurityPolicy-Monitor-SIP-00001-2
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建目的IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipListenIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
Comment 创建from
${addItemList1} Create Dictionary keywordArray=test108 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-00001 policyType=tsg_security policyDesc=autotest action=monitor source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION userRegion={"protocol":"SIP"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId27 ${object_Ip_Id}
insert_policyId_to_file1 monitor_sip_objectId28 ${object_Ip_Id1}
insert_policyId_to_file1 monitor_sip_objectId29 ${object_Account_Id1}
insert_policyId_to_file1 monitor_sip_policyId18 ${policyId}
SecurityPolicy-Monitor-SIP-00001-3
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建目的IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipListenIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
Comment 创建to
${addItemList1} Create Dictionary keywordArray=test12 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-00001 policyType=tsg_security policyDesc=autotest action=monitor source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION userRegion={"protocol":"SIP"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId30 ${object_Ip_Id}
insert_policyId_to_file1 monitor_sip_objectId31 ${object_Ip_Id1}
insert_policyId_to_file1 monitor_sip_objectId32 ${object_Account_Id1}
insert_policyId_to_file1 monitor_sip_policyId19 ${policyId}
SecurityPolicy-Monitor-SIP-00001-4
[Tags] calling ip source
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建目的IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipOutListenIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
Comment 创建from
${addItemList1} Create Dictionary keywordArray=test110 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-00001 policyType=tsg_security policyDesc=autotest action=monitor source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION userRegion={"protocol":"SIP"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId34 ${object_Ip_Id}
insert_policyId_to_file1 monitor_sip_objectId35 ${object_Ip_Id1}
insert_policyId_to_file1 monitor_sip_objectId36 ${object_Account_Id1}
insert_policyId_to_file1 monitor_sip_policyId20 ${policyId}
SecurityPolicy-Monitor-SIP-00001-5
Comment 创建第2个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipCallIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id} AddObjects ${1} ${objectDict}
Comment 创建目的IP
${addItemList1} Create Dictionary isSession=endpoint ip=${voipOutListenIp} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
Comment 创建to
${addItemList1} Create Dictionary keywordArray=test14 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-00001 policyType=tsg_security policyDesc=autotest action=monitor source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION userRegion={"protocol":"SIP"} isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId37 ${object_Ip_Id}
insert_policyId_to_file1 monitor_sip_objectId38 ${object_Ip_Id1}
insert_policyId_to_file1 monitor_sip_objectId39 ${object_Account_Id1}
insert_policyId_to_file1 monitor_sip_policyId21 ${policyId}
SecurityPolicy-Monitor-SIP-00002
[Tags] calling ip port source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-00002 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SIP"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId ${objectId}
insert_policyId_to_file1 monitor_sip_policyId1 ${policyId}
SecurityPolicy-Monitor-SIP-00003
[Tags] calling subid source
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-00003 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SIP"} defaultClient=clientsubid isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_policyId2 ${policyId}
SecurityPolicy-Monitor-SIP-00004
[Tags] calling ip geo source
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-00004 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SIP"} source=${objectId}|TSG_SECURITY_SOURCE_LOCATION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId1 ${objectId}
insert_policyId_to_file1 monitor_sip_policyId3 ${policyId}
SecurityPolicy-Monitor-SIP-00005
[Tags] called domain ip source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-00005 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SIP"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId2 ${objectId}
insert_policyId_to_file1 monitor_sip_policyId4 ${policyId}
SecurityPolicy-Monitor-SIP-00006
[Tags] called domain ip port source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-00006 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SIP"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId3 ${objectId}
insert_policyId_to_file1 monitor_sip_policyId5 ${policyId}
SecurityPolicy-Monitor-SIP-00007
[Tags] called domain ip geo source
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-00007 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SIP"} source=${objectId}|TSG_SECURITY_SOURCE_LOCATION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId4 ${objectId}
insert_policyId_to_file1 monitor_sip_policyId6 ${policyId}
SecurityPolicy-Monitor-SIP-00008
[Tags] called domain ip source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-00005 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SIP"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId5 ${objectId}
insert_policyId_to_file1 monitor_sip_policyId7 ${policyId}
SecurityPolicy-Monitor-SIP-00009
[Tags] called domain ip port source
Comment 创建第二个源IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-22222 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-00006 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SIP"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId6 ${objectId}
insert_policyId_to_file1 monitor_sip_policyId8 ${policyId}
SecurityPolicy-Monitor-SIP-000010
[Tags] called domain ip geo dest
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} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-000010 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SIP"} destination=${objectId}|TSG_SECURITY_DESTINATION_LOCATION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId7 ${objectId}
insert_policyId_to_file1 monitor_sip_policyId9 ${policyId}
SecurityPolicy-Monitor-SIP-000011
[Tags] calling ip source,from account ,monitor and monitor,若测试无源和目的的情况可以将/03-Variable/BifangApiVariable.txt中addTestClentIPFlag置为0
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount}
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-000011 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SIP"} filterList=${object_Account_Id}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId8 ${object_Account_Id}
insert_policyId_to_file1 monitor_sip_policyId10 ${policyId}
SecurityPolicy-Monitor-SIP-000012
[Tags] calling ip source,to account ,monitor and monitor
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount}
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-000012 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SIP"} filterList=${object_Account_Id}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId9 ${object_Account_Id}
insert_policyId_to_file1 monitor_sip_policyId11 ${policyId}
SecurityPolicy-Monitor-SIP-000013
[Tags] calling ip source,called domain ip dest,from account,to account ,monitor , monitor and deny
Comment 创建被叫方域名IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建Account1
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount}
${rescode} ${object_Account_Id1} AddObject2 ${1} ${objectDict}
Comment 创建Account2
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount1}
${rescode} ${object_Account_Id2} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-000013 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SIP"} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id2}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId10 ${objectId}
insert_policyId_to_file1 monitor_sip_objectId11 ${object_Account_Id1}
insert_policyId_to_file1 monitor_sip_objectId12 ${object_Account_Id2}
insert_policyId_to_file1 monitor_sip_policyId12 ${policyId}
SecurityPolicy-Monitor-SIP-000014
[Tags] called ip dest,called domain ip source,from account,to account ,monitor , monitor and deny
Comment 创建被叫方域名IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP2} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建被叫方IP
${addItemList1} Create Dictionary isSession=endpoint ip=${testClentIP3} port=0-65535 direction=0 protocol=0 isInitialize=0
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建Account1
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount}
${rescode} ${object_Account_Id1} AddObject2 ${1} ${objectDict}
Comment 创建Account2
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=${sipAccount1}
${rescode} ${object_Account_Id2} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-000014 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SIP"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR destination=${objectId1}|TSG_SECURITY_DESTINATION_ADDR filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id2}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${1} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId13 ${objectId}
insert_policyId_to_file1 monitor_sip_objectId14 ${objectId1}
insert_policyId_to_file1 monitor_sip_objectId15 ${object_Account_Id1}
insert_policyId_to_file1 monitor_sip_objectId16 ${object_Account_Id2}
insert_policyId_to_file1 monitor_sip_policyId13 ${policyId}
SecurityPolicy-Monitor-SIP-000015
[Tags] Monitor,SIP and sip
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-000015 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SIP","protocol":"sip"} isValid=${0} appIdObjects=${SIP_ID},${RTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_policyId14 ${policyId}
SecurityPolicy-Monitor-SIP-000016
[Tags] The largest combination
Comment 创建Account1
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$zdjzyq12voip
${rescode} ${object_Account_Id1} AddObject2 ${1} ${objectDict}
Comment 创建Account2
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=zdjzy*
${rescode} ${object_Account_Id2} AddObject2 ${1} ${objectDict}
Comment 创建Account3
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=yq12v
${rescode} ${object_Account_Id3} AddObject2 ${1} ${objectDict}
Comment 创建Account4
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*12voip
${rescode} ${object_Account_Id4} AddObject2 ${1} ${objectDict}
Comment 创建Account5
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$zdjzyq12voi
${rescode} ${object_Account_Id5} AddObject2 ${1} ${objectDict}
Comment 创建Account6
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*12voi
${rescode} ${object_Account_Id6} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SIP-000016 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SIP"} filterList=${object_Account_Id1}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id2}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION,${object_Account_Id3}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id4}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION,${object_Account_Id5}|TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION,${object_Account_Id6}|TSG_FIELD_SIP_RESPONDER_DESCRIPTION isValid=${0} appIdObjects=${SIP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_sip_objectId17 ${object_Account_Id1}
insert_policyId_to_file1 monitor_sip_objectId18 ${object_Account_Id2}
insert_policyId_to_file1 monitor_sip_objectId19 ${object_Account_Id3}
insert_policyId_to_file1 monitor_sip_objectId20 ${object_Account_Id4}
insert_policyId_to_file1 monitor_sip_objectId21 ${object_Account_Id5}
insert_policyId_to_file1 monitor_sip_objectId22 ${object_Account_Id6}
insert_policyId_to_file1 monitor_sip_policyId15 ${policyId}

View File

@@ -1,104 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp adc_api security_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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
*** Test Cases ***
SecurityPolicy-Monitor-Ssl-00001
[Tags] sni fqdn完整和右匹配 update ip geo,fqdn
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.wego.cn isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*freecountry.com isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=*www.wego.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
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 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Ssl-00001 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SSL"} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_ssl_objectId ${objectId}
insert_policyId_to_file1 monitor_ssl_objectId4 ${objectId1}
insert_policyId_to_file1 monitor_ssl_objectId5 ${objectId2}
insert_policyId_to_file1 monitor_ssl_policyId ${policyId}
SecurityPolicy-Monitor-Ssl-00002
[Tags] cn cat右匹配
${iniCatId} GetIniCategoryId press
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*www.keysnews.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=$keysnews.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Ssl-00002 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SSL"} filterList=${iniCatId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_SNI,${objectId1}|TSG_FIELD_SSL_CN isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_ssl_objectId1 ${objectId}
insert_policyId_to_file1 monitor_ssl_objectId7 ${objectId1}
insert_policyId_to_file1 monitor_ssl_policyId1 ${policyId}
SecurityPolicy-Monitor-Ssl-00003
[Tags] cat右匹配
${iniCatId} GetIniCategoryId politics
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*academia.org isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*proisraelforever.com isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Ssl-00003 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SSL"} filterList=${iniCatId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_ssl_objectId2 ${objectId}
insert_policyId_to_file1 monitor_ssl_policyId2 ${policyId}
SecurityPolicy-Monitor-Ssl-00004
[Tags] 最大组合 update policy obj:san,sni,cn
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*nerdreactor.com isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*cloudflaressl.com isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=*dreactor.com isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*cloudflaressl.com isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Ssl-00004 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"SSL"} filterList=${objectId}|TSG_FIELD_SSL_SAN,${objectId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_CN isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 monitor_ssl_objectId3 ${objectId}
insert_policyId_to_file1 monitor_ssl_objectId6 ${objectId1}
insert_policyId_to_file1 monitor_ssl_policyId3 ${policyId}

View File

@@ -1,675 +0,0 @@
*** 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
# Resource ../../../03-Variable/ApplicationID.txt
*** Variables ***
*** Test Cases ***
Proxy-Policy-monitor-00001
[Tags] fqdn完整匹配 update policy:ip geo,fqdn与allow002验证同时命中allow和monitor策略
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$tv.cctv.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建ip geo
${addItemList1} Create Dictionary keywordArray=XXG地区.*
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=geo_location isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建categories
${addItemList1} Create Dictionary fqdn=$tv.cctv.com
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary categoryType=fqdn categoryName=cctv objectSubType=category isValid=${1} fqdnList=${addItemLists}
${rescode} ${categoryObjId} ${categoryId} AddCategories ${1} ${objectDict} add 200
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=*feishu.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-monitor-01 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建monitor策略
${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00001 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 monitor_objectId ${objectId}
insert_policyId_to_file1 monitor_objectId46 ${objectId1}
insert_policyId_to_file1 monitor_objectId47 ${objectId2}
insert_policyId_to_file1 monitor_categoryId ${categoryId}
insert_policyId_to_file1 intercept_monitor_policyId ${policyId1}
insert_policyId_to_file1 monitor_policyId ${policyId2}
Proxy-Policy-monitor-00002
[Tags] cat右匹配
${iniCatId} GetIniCategoryId recreation
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*parkpennies.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-monitor policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${iniCatId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建monitor策略
${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00002 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${iniCatId}|TSG_FIELD_HTTP_HOST,${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 monitor_objectId1 ${objectId}
insert_policyId_to_file1 intercept_monitor_policyId1 ${policyId1}
insert_policyId_to_file1 monitor_policyId1 ${policyId2}
Proxy-Policy-monitor-00003
[Tags] url4种匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*wmtransfer.com isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*banbaowang.com isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=*qidian.com isHexbin=${0}
${addItemList4} Create Dictionary keywordArray=*rolandberger.com isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=www.wmtransfer* isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=$www.banbaowang.com/shouchaobao/ isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=*qidian.com/rank isHexbin=${0}
${addItemList4} Create Dictionary keywordArray=country=RU isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-monitor policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建monitor策略
${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00003 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 monitor_objectId2 ${objectId}
insert_policyId_to_file1 monitor_objectId3 ${objectId1}
insert_policyId_to_file1 intercept_monitor_policyId2 ${policyId1}
insert_policyId_to_file1 monitor_policyId2 ${policyId2}
Proxy-Policy-monitor-00004
[Tags] 请求头左匹配 update policy:url,请求头
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*v.qq.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=qq.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建fqdn2
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*kumi.cn
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
Comment 创建url2
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=kumi
${rescode} ${objectId4} AddObject2 ${1} ${objectDict}
Comment user-agent,创建请求头2
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId5} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-monitor-04 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建monitor策略
${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00004 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 monitor_objectId4 ${objectId}
insert_policyId_to_file1 monitor_objectId5 ${objectId1}
insert_policyId_to_file1 monitor_objectId6 ${objectId2}
insert_policyId_to_file1 monitor_objectId48 ${objectId3}
insert_policyId_to_file1 monitor_objectId49 ${objectId4}
insert_policyId_to_file1 monitor_objectId50 ${objectId5}
insert_policyId_to_file1 intercept_monitor_policyId3 ${policyId1}
insert_policyId_to_file1 monitor_policyId3 ${policyId2}
Proxy-Policy-monitor-00005
[Tags] 请求头完整匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.mgtv.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=mgtv.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-monitor-05 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建monitor策略
${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00005 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 monitor_objectId7 ${objectId}
insert_policyId_to_file1 monitor_objectId8 ${objectId1}
insert_policyId_to_file1 monitor_objectId9 ${objectId2}
insert_policyId_to_file1 intercept_monitor_policyId4 ${policyId1}
insert_policyId_to_file1 monitor_policyId4 ${policyId2}
Proxy-Policy-monitor-00006
[Tags] 请求头字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$v.ifeng.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=ifeng isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=AppleWebKit isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-monitor policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建monitor策略
${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00006 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 monitor_objectId10 ${objectId}
insert_policyId_to_file1 monitor_objectId11 ${objectId1}
insert_policyId_to_file1 monitor_objectId12 ${objectId2}
insert_policyId_to_file1 intercept_monitor_policyId5 ${policyId1}
insert_policyId_to_file1 monitor_policyId5 ${policyId2}
Proxy-Policy-monitor-00007
[Tags] 请求头右匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.pptv.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*pptv.com/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=*Safari/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-monitor-007 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建monitor策略
${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00007 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 monitor_objectId13 ${objectId}
insert_policyId_to_file1 monitor_objectId14 ${objectId1}
insert_policyId_to_file1 monitor_objectId15 ${objectId2}
insert_policyId_to_file1 intercept_monitor_policyId6 ${policyId1}
insert_policyId_to_file1 monitor_policyId6 ${policyId2}
Proxy-Policy-monitor-00008
[Tags] 应答头右匹配 update policy:fqdn,url,应答头
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*zhenai.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=zhenai isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=*utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建fqdn2
${addItemList1} Create Dictionary keywordArray=*love.163.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
Comment 创建url2
${addItemList1} Create Dictionary keywordArray=163.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId5} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-monitor-08 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建monitor策略
${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00008 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 monitor_objectId16 ${objectId}
insert_policyId_to_file1 monitor_objectId17 ${objectId1}
insert_policyId_to_file1 monitor_objectId18 ${objectId2}
insert_policyId_to_file1 monitor_objectId51 ${objectId3}
insert_policyId_to_file1 monitor_objectId52 ${objectId4}
insert_policyId_to_file1 monitor_objectId53 ${objectId5}
insert_policyId_to_file1 intercept_monitor_policyId7 ${policyId1}
insert_policyId_to_file1 monitor_policyId7 ${policyId2}
Proxy-Policy-monitor-00009
[Tags] 应答头完整匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*ilu.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=$v.iqilu.com/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=$text/html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-monitor policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建monitor策略
${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00009 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 monitor_objectId19 ${objectId}
insert_policyId_to_file1 monitor_objectId20 ${objectId1}
insert_policyId_to_file1 monitor_objectId21 ${objectId2}
insert_policyId_to_file1 intercept_monitor_policyId8 ${policyId1}
insert_policyId_to_file1 monitor_policyId8 ${policyId2}
Proxy-Policy-monitor-00010
[Tags] 应答头字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*fun.tv isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=/movie isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=text/html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-monitor policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建monitor策略
${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00010 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 monitor_objectId22 ${objectId}
insert_policyId_to_file1 monitor_objectId23 ${objectId1}
insert_policyId_to_file1 monitor_objectId24 ${objectId2}
insert_policyId_to_file1 intercept_monitor_policyId9 ${policyId1}
insert_policyId_to_file1 monitor_policyId9 ${policyId2}
Proxy-Policy-monitor-00011
[Tags] 应答头左匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*hongniang.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=hongniang isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=text* isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-monitor policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建monitor策略
${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00011 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 monitor_objectId25 ${objectId}
insert_policyId_to_file1 monitor_objectId26 ${objectId1}
insert_policyId_to_file1 monitor_objectId27 ${objectId2}
insert_policyId_to_file1 intercept_monitor_policyId10 ${policyId1}
insert_policyId_to_file1 monitor_policyId10 ${policyId2}
# Proxy-Policy-monitor-00012
# [Tags] cookie字串匹配
# Comment 创建fqdn
# ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.youqulu.com
# ${rescode} ${objectId} AddObject2 ${1} ${objectDict}
# Comment 创建url
# ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=zixun
# ${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
# Comment 创建cookie
# ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=saltkey|Cookie
# ${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
# Comment 创建拦截策略
# ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-monitor policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
# log ${policyDict}
# ${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
# ${policyId1} Get-Pids ${policyId1}
# ${policyId1} Set Variable ${policyId1}[0]
# Comment 创建monitor策略
# ${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00012 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
# log ${policyDict}
# ${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
# ${policyId2} Get-Pids ${policyId2}
# ${policyId2} Set Variable ${policyId2}[0]
# insert_policyId_to_file1 monitor_objectId28 ${objectId}
# insert_policyId_to_file1 monitor_objectId29 ${objectId1}
# insert_policyId_to_file1 monitor_objectId30 ${objectId2}
# insert_policyId_to_file1 intercept_monitor_policyId11 ${policyId1}
# insert_policyId_to_file1 monitor_policyId11 ${policyId2}
# Proxy-Policy-monitor-00013
# [Tags] set-cookie4种匹配
# Comment 创建fqdn
# ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.nypl.org,*thailand.com.co,*ke.com,$nationalbank.kz
# ${rescode} ${objectId} AddObject2 ${1} ${objectDict}
# Comment 创建set-cookie
# ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=incap_ses*|Set-Cookie,*Max-Age=604800|Set-Cookie,domain=.ke.com|Set-Cookie,irkzadmin_session*|Set-Cookie
# ${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
# Comment 创建拦截策略
# ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-monitor policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
# log ${policyDict}
# ${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
# ${policyId1} Get-Pids ${policyId1}
# ${policyId1} Set Variable ${policyId1}[0]
# Comment 创建monitor策略
# ${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00013 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
# log ${policyDict}
# ${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
# ${policyId2} Get-Pids ${policyId2}
# ${policyId2} Set Variable ${policyId2}[0]
# insert_policyId_to_file1 monitor_objectId31 ${objectId}
# insert_policyId_to_file1 monitor_objectId32 ${objectId1}
# insert_policyId_to_file1 intercept_monitor_policyId12 ${policyId1}
# insert_policyId_to_file1 monitor_policyId12 ${policyId2}
Proxy-Policy-monitor-00014
Comment 与Deny动作代理测试中的0014组合搭配验证代理Monitor和其他策略同时命中
[Tags] 请求体子串匹配
Comment 创建请求体
${addItemList1} Create Dictionary keywordArray=ProxydenyTest001402 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-monitor policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建monitor策略
${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00014 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 monitor_objectId33 ${objectId}
insert_policyId_to_file1 monitor_objectId34 ${objectId1}
insert_policyId_to_file1 intercept_monitor_policyId13 ${policyId1}
insert_policyId_to_file1 monitor_policyId13 ${policyId2}
Proxy-Policy-monitor-00015
Comment 同14与deny0015共同存在
[Tags] 应答体字串匹配
Comment 创建应答体
${addItemList1} Create Dictionary keywordArray=Proxydeny001501 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建monitor策略
${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00015 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 monitor_objectId35 ${objectId}
insert_policyId_to_file1 monitor_policyId14 ${policyId2}
Proxy-Policy-monitor-00016
[Tags] substring
Comment 效果与Proxy-Policy-hijack-000015相同可以验证hijack和monitor同时命中某策略时策略日志产生情况
Comment 两个用例公用一个拦截此用例未建立b步骤两个用例公用b步骤
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$tengrinews.kz isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=tengrinews.kz/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment set-cookie8个子串,创建应答头
${addItemList1} Create Dictionary keywordArray=68747470,6f6e6c79,70617468,4d6178,416765,474d54,6d656761,65794a isHexbin=${1} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_sc_Id} AddObjects ${1} ${objectDict}
Comment user-agent8个子串,创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla,Windows,Win64,x64,AppleWebKit,537.36,KHTML,Chrome isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ua_Id} AddObjects ${1} ${objectDict}
Comment cont-Type8个子串,创建应答头:text/html
${addItemList1} Create Dictionary keywordArray=text,html,text/html,char,rset,arset,UTF-8,charset=UTF-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ct_Id} AddObjects ${1} ${objectDict}
Comment 创建monitor策略
${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00016 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${object_ua_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_sc_Id}|TSG_FIELD_HTTP_RES_HDR,${object_ct_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 monitor_objectId41 ${objectId}
insert_policyId_to_file1 monitor_objectId42 ${objectId1}
insert_policyId_to_file1 monitor_objectId43 ${object_sc_Id}
insert_policyId_to_file1 monitor_objectId44 ${object_ua_Id}
insert_policyId_to_file1 monitor_objectId45 ${object_ct_Id}
insert_policyId_to_file1 monitor_policyId16 ${policyId2}
Proxy-Policy-monitor-00019
Comment 效果与Proxy-Policy-deny-00019相同可以验证deny和monitor同时命中某策略时策略日志产生情况
Comment 两个用例公用一个拦截此用例未建立b步骤两个用例公用b步骤
[Tags] substring
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.cndns.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=www.cndns.com/cn/sms/index.aspx isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment keyword8个子串,创建应答体
${addItemList1} Create Dictionary keywordArray=美橙短信,短信群发,到达率更强,企业营销类,短信验证,群发服务,正规106网关,联通全面 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_res_cont_Id} AddObjects ${1} ${objectDict}
Comment user-agent8个子串,创建请求头
${addItemList1} Create Dictionary keywordArray=4d6f7a696c6c612f352e30,57696e646f7773,57696e3634,783634,4170706c65,65624b6974,4b48544d4c,6c696b65 isHexbin=${1} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ua_Id} AddObjects ${1} ${objectDict}
Comment cont-Type8个子串,创建应答头
${addItemList1} Create Dictionary keywordArray=7465,78742f,6874,6d6c,68746d6c,63686172,736574,63686172736574 isHexbin=${1} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ct_Id} AddObjects ${1} ${objectDict}
Comment 创建deny策略
${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00019 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_ua_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_res_cont_Id}|TSG_FIELD_HTTP_RES_CONTENT,${object_ct_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 monitor_objectId36 ${object_fqdn_Id}
insert_policyId_to_file1 monitor_objectId37 ${object_url_Id}
insert_policyId_to_file1 monitor_objectId38 ${object_res_cont_Id}
insert_policyId_to_file1 monitor_objectId39 ${object_ua_Id}
insert_policyId_to_file1 monitor_objectId40 ${object_ct_Id}
insert_policyId_to_file1 monitor_policyId15 ${policyId2}
# Proxy-Policy-monitor-00016
# [Tags] 最大组合1
# Comment 创建fqdn
# ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
# ${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
# Comment 创建url
# ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*action
# ${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 创建应答头
# ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=charset|Content-Type
# ${rescode} ${object_yd_Id} AddObject2 ${1} ${objectDict}
# Comment 创建请求体
# ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=mnbv
# ${rescode} ${object_body_Id} AddObject2 ${1} ${objectDict}
# Comment 创建monitor策略
# ${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00016 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_qq_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_yd_Id}|TSG_FIELD_HTTP_RES_HDR,${object_body_Id}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
# log ${policyDict}
# ${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
# ${policyId2} Get-Pids ${policyId2}
# ${policyId2} Set Variable ${policyId2}[0]
# insert_policyId_to_file1 monitor_objectId36 ${object_fqdn_Id}
# insert_policyId_to_file1 monitor_objectId37 ${object_url_Id}
# insert_policyId_to_file1 monitor_objectId38 ${object_qq_Id}
# insert_policyId_to_file1 monitor_objectId39 ${object_yd_Id}
# insert_policyId_to_file1 monitor_objectId40 ${object_body_Id}
# insert_policyId_to_file1 monitor_policyId15 ${policyId2}
# Proxy-Policy-monitor-00017
# [Tags] 最大组合2
# Comment 创建fqdn
# ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.umusicpub.com
# ${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
# Comment 创建url
# ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=sicpub.com
# ${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
# Comment 创建cookie
# ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=timezoneoffset|Cookie
# ${rescode} ${object_qq_Id} AddObject2 ${1} ${objectDict}
# Comment 创建set-cookie
# ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Domain=.umusicpub.com|Set-Cookie
# ${rescode} ${object_yd_Id} AddObject2 ${1} ${objectDict}
# Comment 创建应答体
# ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=NOFOLLOW
# ${rescode} ${object_body_Id} AddObject2 ${1} ${objectDict}
# Comment 创建拦截策略
# ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-monitor policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
# log ${policyDict}
# ${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
# ${policyId1} Get-Pids ${policyId1}
# ${policyId1} Set Variable ${policyId1}[0]
# Comment 创建monitor策略
# ${policyDict} Create Dictionary policyName=Proxy-Policy-monitor-00017 policyType=pxy_manipulation policyDesc=autotest action=monitor userRegion={"method":"monitor","protocol":"HTTP"} filterList=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_qq_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_yd_Id}|TSG_FIELD_HTTP_RES_HDR,${object_body_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
# log ${policyDict}
# ${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
# ${policyId2} Get-Pids ${policyId2}
# ${policyId2} Set Variable ${policyId2}[0]
# insert_policyId_to_file1 monitor_objectId41 ${object_fqdn_Id}
# insert_policyId_to_file1 monitor_objectId42 ${object_url_Id}
# insert_policyId_to_file1 monitor_objectId43 ${object_qq_Id}
# insert_policyId_to_file1 monitor_objectId44 ${object_yd_Id}
# insert_policyId_to_file1 monitor_objectId45 ${object_body_Id}
# insert_policyId_to_file1 intercept_monitor_policyId14 ${policyId1}
# insert_policyId_to_file1 monitor_policyId16 ${policyId2}

View File

@@ -1,607 +0,0 @@
*** 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
# Resource ../../../03-Variable/ApplicationID.txt
*** Test Cases ***
Proxy-Policy-redirect-00001
[Tags] fqdn完整匹配 update policy:ip geo,fqdn
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$tudou.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建categories
${addItemList1} Create Dictionary fqdn=$tudou.com
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary categoryType=fqdn categoryName=tudou objectSubType=category isValid=${1} fqdnList=${addItemLists}
${rescode} ${categoryObjId} ${categoryId} AddCategories ${1} ${objectDict} add 200
Comment 创建url
${addItemList1} Create Dictionary keywordArray=tudou isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
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
${addItemList1} Create Dictionary keywordArray=*tudou.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${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,${categoryObjId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00001 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL,${categoryObjId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 redirect_objectId ${objectId}
insert_policyId_to_file1 redirect_objectId44 ${objectId1}
insert_policyId_to_file1 redirect_objectId48 ${objectId2}
insert_policyId_to_file1 redirect_objectId49 ${objectId3}
insert_policyId_to_file1 redirect_categoryId ${categoryId}
insert_policyId_to_file1 intercept_redirect_policyId ${policyId1}
insert_policyId_to_file1 redirect_policyId ${policyId2}
Proxy-Policy-redirect-00002
[Tags] cat右匹配 update policy:url
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*glazok.kz isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=glazok.kz isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建url2
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*glazok.kz/
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00002 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 redirect_objectId1 ${objectId}
insert_policyId_to_file1 redirect_objectId45 ${objectId1}
insert_policyId_to_file1 redirect_objectId50 ${objectId2}
insert_policyId_to_file1 intercept_redirect_policyId1 ${policyId1}
insert_policyId_to_file1 redirect_policyId1 ${policyId2}
Proxy-Policy-redirect-00003
[Tags] url4种匹配 verify_redirect_00003
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.deepin.org isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*vmall.com isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=$www.suning.com isHexbin=${0}
${addItemList4} Create Dictionary keywordArray=*flights.ctrip.com isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=www.deepin.org* isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=vmall isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=*suning.com/ isHexbin=${0}
${addItemList4} Create Dictionary keywordArray=$flights.ctrip.com/international/search/domestic isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00003 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://www.baidu.com/","code":301,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 redirect_objectId2 ${objectId}
insert_policyId_to_file1 redirect_objectId3 ${objectId1}
insert_policyId_to_file1 intercept_redirect_policyId2 ${policyId1}
insert_policyId_to_file1 redirect_policyId2 ${policyId2}
Proxy-Policy-redirect-00004
[Tags] 请求头左匹配 update policy:请求头
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*merrilledge.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=investing/online-trading isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头2
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00004 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 redirect_objectId4 ${objectId}
insert_policyId_to_file1 redirect_objectId5 ${objectId1}
insert_policyId_to_file1 redirect_objectId6 ${objectId2}
insert_policyId_to_file1 redirect_objectId51 ${objectId3}
insert_policyId_to_file1 intercept_redirect_policyId3 ${policyId1}
insert_policyId_to_file1 redirect_policyId3 ${policyId2}
Proxy-Policy-redirect-00005
[Tags] 请求头完整匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.marketscreener.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=stock-analyses/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00005 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 redirect_objectId7 ${objectId}
insert_policyId_to_file1 redirect_objectId8 ${objectId1}
insert_policyId_to_file1 redirect_objectId9 ${objectId2}
insert_policyId_to_file1 intercept_redirect_policyId4 ${policyId1}
insert_policyId_to_file1 redirect_policyId4 ${policyId2}
Proxy-Policy-redirect-00006
[Tags] 请求头字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.dota2.com.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=dota2 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
# Comment 创建请求头
# ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=AppleWebKit|User-Agent
# ${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=AppleWebKit isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建redirect策略
${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=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 redirect_objectId10 ${objectId}
insert_policyId_to_file1 redirect_objectId11 ${objectId1}
insert_policyId_to_file1 redirect_objectId12 ${objectId2}
insert_policyId_to_file1 intercept_redirect_policyId5 ${policyId1}
insert_policyId_to_file1 redirect_policyId5 ${policyId2}
Proxy-Policy-redirect-00007
[Tags] 请求头右匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.ufcu.org isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=personal/insurance/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建redirect策略
${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=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 redirect_objectId13 ${objectId}
insert_policyId_to_file1 redirect_objectId14 ${objectId1}
insert_policyId_to_file1 redirect_objectId15 ${objectId2}
insert_policyId_to_file1 intercept_redirect_policyId6 ${policyId1}
insert_policyId_to_file1 redirect_policyId6 ${policyId2}
Proxy-Policy-redirect-00008
[Tags] 应答头右匹配 update policy:应答头
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*essence.com.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=business/fixed isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=*utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建应答头2Content-Type
${addItemList1} Create Dictionary keywordArray=utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-redirect policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建redirect策略
${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=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 redirect_objectId16 ${objectId}
insert_policyId_to_file1 redirect_objectId17 ${objectId1}
insert_policyId_to_file1 redirect_objectId18 ${objectId2}
insert_policyId_to_file1 redirect_objectId52 ${objectId3}
insert_policyId_to_file1 intercept_redirect_policyId7 ${policyId1}
insert_policyId_to_file1 redirect_policyId7 ${policyId2}
Proxy-Policy-redirect-00009
[Tags] 应答头完整匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*west95582.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=/jdw/index.html isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=$text/html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-redirect policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建redirect策略
${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=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 redirect_objectId19 ${objectId}
insert_policyId_to_file1 redirect_objectId20 ${objectId1}
insert_policyId_to_file1 redirect_objectId21 ${objectId2}
insert_policyId_to_file1 intercept_redirect_policyId8 ${policyId1}
insert_policyId_to_file1 redirect_policyId8 ${policyId2}
Proxy-Policy-redirect-00010
[Tags] 应答头字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*chinahr.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=/home/bj/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=text/html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-redirect policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00010 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 redirect_objectId22 ${objectId}
insert_policyId_to_file1 redirect_objectId23 ${objectId1}
insert_policyId_to_file1 redirect_objectId24 ${objectId2}
insert_policyId_to_file1 intercept_redirect_policyId9 ${policyId1}
insert_policyId_to_file1 redirect_policyId9 ${policyId2}
Proxy-Policy-redirect-00011
[Tags] 应答头左匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*cs.ecitic.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=newsite/business/bank/tzyh_ywjs/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=text* isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-redirect policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00011 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 redirect_objectId25 ${objectId}
insert_policyId_to_file1 redirect_objectId26 ${objectId1}
insert_policyId_to_file1 redirect_objectId27 ${objectId2}
insert_policyId_to_file1 intercept_redirect_policyId10 ${policyId1}
insert_policyId_to_file1 redirect_policyId10 ${policyId2}
Proxy-Policy-redirect-00012
[Tags] cookie字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.investors-trust.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=products/product-type/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建cookie
${addItemList1} Create Dictionary keywordArray=saltkey isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00012 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 redirect_objectId28 ${objectId}
insert_policyId_to_file1 redirect_objectId29 ${objectId1}
insert_policyId_to_file1 redirect_objectId30 ${objectId2}
insert_policyId_to_file1 intercept_redirect_policyId11 ${policyId1}
insert_policyId_to_file1 redirect_policyId11 ${policyId2}
Proxy-Policy-redirect-00013
[Tags] set-cookie4种匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.travelmath.com,*monticello.org,*expediapartnersolutions.com,*tripadvisor.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=mobile=2*|Set-Cookie,PHPSESSID|Set-Cookie,SameSite=None; Secure|Set-Cookie,TASession*|Set-Cookie
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=www.travelmath.com,monticello.org,expediapartnersolutions.com,tripadvisor.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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00013 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR,${objectId2}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 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}
Proxy-Policy-redirect-00014
[Tags] 请求体字串匹配,update policy:请求体
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=open.node isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建请求体
${addItemList1} Create Dictionary keywordArray=testredirect0014001 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
Comment 创建请求体2
${addItemList1} Create Dictionary keywordArray=testredirect0014002 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId4} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-redirect policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00014 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${objectId3}|TSG_FIELD_HTTP_REQ_CONTENT,${objectId2}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
# insert_policyId_to_file1 redirect_objectId33 ${objectId}
insert_policyId_to_file1 redirect_objectId34 ${objectId1}
insert_policyId_to_file1 redirect_objectId47 ${objectId2}
insert_policyId_to_file1 redirect_objectId53 ${objectId3}
insert_policyId_to_file1 redirect_objectId54 ${objectId4}
insert_policyId_to_file1 intercept_redirect_policyId13 ${policyId1}
insert_policyId_to_file1 redirect_policyId13 ${policyId2}
Proxy-Policy-redirect-00015
[Tags] 最大组合1
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_qq_Id} AddObjects ${1} ${objectDict}
Comment 创建应答头
${addItemList1} Create Dictionary keywordArray=charset isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_yd_Id} AddObjects ${1} ${objectDict}
Comment 创建请求体
${addItemList1} Create Dictionary keywordArray=testredirect0015 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_body_Id} AddObjects ${1} ${objectDict}
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00015 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","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_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 redirect_objectId35 ${object_fqdn_Id}
insert_policyId_to_file1 redirect_objectId36 ${object_url_Id}
insert_policyId_to_file1 redirect_objectId37 ${object_qq_Id}
insert_policyId_to_file1 redirect_objectId38 ${object_yd_Id}
insert_policyId_to_file1 redirect_objectId39 ${object_body_Id}
insert_policyId_to_file1 redirect_policyId14 ${policyId2}
Proxy-Policy-redirect-00016
[Tags] 最大组合2
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.equifax.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*personal/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建cookie
${addItemList1} Create Dictionary keywordArray=COOKIE_SUPPORT isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_qq_Id} AddObjects ${1} ${objectDict}
Comment 创建set-cookie
${addItemList1} Create Dictionary keywordArray=GUEST_LANGUAGE_ID isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_yd_Id} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${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=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建redirect策略
${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00016 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","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=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 redirect_objectId40 ${object_fqdn_Id}
insert_policyId_to_file1 redirect_objectId41 ${object_url_Id}
insert_policyId_to_file1 redirect_objectId42 ${object_qq_Id}
insert_policyId_to_file1 redirect_objectId43 ${object_yd_Id}
insert_policyId_to_file1 intercept_redirect_policyId14 ${policyId1}
insert_policyId_to_file1 redirect_policyId15 ${policyId2}

View File

@@ -1,539 +0,0 @@
*** 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
# Resource ../../../03-Variable/ApplicationID.txt
*** Test Cases ***
Proxy-Policy-replace-00001
[Tags] fqdn完整匹配 update policy:ip source ,fqdn, replace content:resp_body
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$destidotcom.wordpress.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=wordpress.com/contact/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
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
${addItemList1} Create Dictionary keywordArray=*destidotcom.wordpress.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
Comment Comment 创建拦截策略
${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}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建replace策略
${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}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 replace_objectId ${objectId}
insert_policyId_to_file1 replace_objectId39 ${objectId1}
insert_policyId_to_file1 replace_objectId42 ${objectId2}
insert_policyId_to_file1 replace_objectId43 ${objectId3}
insert_policyId_to_file1 intercept_replace_policyId ${policyId1}
insert_policyId_to_file1 replace_policyId ${policyId2}
Proxy-Policy-replace-00002
[Tags] cat右匹配 update policy:url, replace content:http_req_uri
${iniCatId} GetIniCategoryId recreation
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*stana.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建categories
${addItemList1} Create Dictionary fqdn=*stana.com
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary categoryType=fqdn categoryName=airastana objectSubType=category isValid=${1} fqdnList=${addItemLists}
${rescode} ${categoryObjId} ${categoryId} AddCategories ${1} ${objectDict} add 200
Comment 创建url
${addItemList1} Create Dictionary keywordArray=airastana.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建url2
${addItemList1} Create Dictionary keywordArray=airastana.com* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 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,${categoryObjId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建replace策略
${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":"Kop-baghytty-ushu","replace_with":"Arnaiy-usynystar"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${categoryObjId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 replace_objectId1 ${objectId}
insert_policyId_to_file1 replace_objectId40 ${objectId1}
insert_policyId_to_file1 replace_objectId44 ${objectId2}
insert_policyId_to_file1 replace_categoryId ${categoryId}
insert_policyId_to_file1 intercept_replace_policyId1 ${policyId1}
insert_policyId_to_file1 replace_policyId1 ${policyId2}
Proxy-Policy-replace-00003
[Tags] url4种匹配
${iniCatId} GetIniCategoryId recreation
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*umcfa.webs.com isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=*www.pjpugliese.com isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=$carblog.co.za isHexbin=${0}
${addItemList4} Create Dictionary keywordArray=$www.ornithomedia.com isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=umcfa.webs.com* isHexbin=${0}
${addItemList2} Create Dictionary keywordArray=$www.pjpugliese.com/ isHexbin=${0}
${addItemList3} Create Dictionary keywordArray=*co.za/ isHexbin=${0}
${addItemList4} Create Dictionary keywordArray=ornithomedia isHexbin=${0}
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${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=${iniCatId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建replace策略
${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}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 replace_objectId2 ${objectId}
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
[Tags] 请求头左匹配 update policy:请求头replace content:http_resp_header
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*ino.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=headlines/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头2
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建replace策略
${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}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 replace_objectId4 ${objectId}
insert_policyId_to_file1 replace_objectId5 ${objectId1}
insert_policyId_to_file1 replace_objectId6 ${objectId2}
insert_policyId_to_file1 replace_objectId45 ${objectId3}
insert_policyId_to_file1 intercept_replace_policyId3 ${policyId1}
insert_policyId_to_file1 replace_policyId3 ${policyId2}
Proxy-Policy-replace-00005
[Tags] 请求头完整匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.bestwestern.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=estern.com/en_US.html isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-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}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建replace策略
${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}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
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
[Tags] 请求头字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.quickenloans.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=mortgage-education/home-buyers-guide?qlsource=nav isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=AppleWebKit isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-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}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建replace策略
${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}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
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
[Tags] 请求头右匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.gobank.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=mobile-banking/mobile-app isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment user-agent,创建请求头
${addItemList1} Create Dictionary keywordArray=*Safari/537.36 isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-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}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建replace策略
${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}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
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
[Tags] 应答头右匹配 update policy:应答头replace content:http_resp_header
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*www.ghzq.com.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=ghzq/index.html isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=text* isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建应答头2Content-Type
${addItemList1} Create Dictionary keywordArray=html isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId3} AddObjects ${1} ${objectDict}
Comment Comment 创建拦截策略
${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}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建replace策略
${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}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 replace_objectId16 ${objectId}
insert_policyId_to_file1 replace_objectId17 ${objectId1}
insert_policyId_to_file1 replace_objectId18 ${objectId2}
insert_policyId_to_file1 replace_objectId46 ${objectId3}
insert_policyId_to_file1 intercept_replace_policyId7 ${policyId1}
insert_policyId_to_file1 replace_policyId7 ${policyId2}
Proxy-Policy-replace-00009
[Tags] 应答头完整匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*zcool.com.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=www.zcool.com.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=$text/html; charset=utf-8 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment Comment 创建拦截策略
${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}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建replace策略
${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}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
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
[Tags] fqdn右匹配 update policy:replace content:http_resp_body
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*open.node.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=open.node isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=testpolicyreplace_0010 isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment Comment 创建拦截策略
${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}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建replace策略
${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}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 replace_objectId22 ${objectId}
insert_policyId_to_file1 replace_objectId23 ${objectId1}
insert_policyId_to_file1 replace_objectId47 ${objectId2}
insert_policyId_to_file1 intercept_replace_policyId9 ${policyId1}
insert_policyId_to_file1 replace_policyId9 ${policyId2}
Proxy-Policy-replace-00011
[Tags] 应答头左匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*shfe.com.cn isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=products/au/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建应答头Content-Type
${addItemList1} Create Dictionary keywordArray=text* isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 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=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建replace策略
${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=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 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
[Tags] cookie字串匹配
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=$www.national-park.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=welcome-to-canyonlands-national-park/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
Comment 创建cookie
${addItemList1} Create Dictionary keywordArray=saltkey isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId2} AddObjects ${1} ${objectDict}
Comment 创建拦截策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-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}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
Comment 创建replace策略
${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=${objectId}|TSG_FIELD_HTTP_HOST,${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 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
[Tags] set-cookie4种匹配
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}
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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
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,${objectId2}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 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}
Proxy-Policy-replace-00014
[Tags] 最大组合 verifyreplace0014
Comment 创建fqdn
${addItemList1} Create Dictionary keywordArray=*engadget.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=fqdn objectSubType=fqdn isValid=${1} addItemList=${addItemLists}
${rescode} ${object_fqdn_Id} AddObjects ${1} ${objectDict}
Comment 创建url
${addItemList1} Create Dictionary keywordArray=*gaming/ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=url objectSubType=url isValid=${1} addItemList=${addItemLists}
${rescode} ${object_url_Id} AddObjects ${1} ${objectDict}
Comment 创建请求头
${addItemList1} Create Dictionary keywordArray=Mozilla/5.0* isHexbin=${0} district=User-Agent
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_qq_Id} AddObjects ${1} ${objectDict}
Comment 创建应答头
${addItemList1} Create Dictionary keywordArray=text isHexbin=${0} district=Content-Type
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_yd_Id} AddObjects ${1} ${objectDict}
Comment 创建cookie
${addItemList1} Create Dictionary keywordArray=__stripe_sid isHexbin=${0} district=Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ck_Id} AddObjects ${1} ${objectDict}
Comment 创建set-cookie
${addItemList1} Create Dictionary keywordArray=Domain=.engadget.com isHexbin=${0} district=Set-Cookie
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
${rescode} ${object_sk_Id} AddObjects ${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=${SSL_ID}
log ${policyDict}
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
${policyId1} Get-Pids ${policyId1}
${policyId1} Set Variable ${policyId1}[0]
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_sk_Id}|TSG_FIELD_HTTP_RES_HDR,${object_ck_Id}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
${policyId2} Get-Pids ${policyId2}
${policyId2} Set Variable ${policyId2}[0]
insert_policyId_to_file1 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}
sleep ${policyModifySleepSeconds}

View File

@@ -1,68 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp security_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
SecurityPolicy-Allow-Http-00001
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00001.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00001_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List COVID
... ELSE Create List COVID
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变allow策略
${policyDict} Create Dictionary policyId=${allow_http_policyId} source=${allow_http_objectId3}|TSG_SECURITY_SOURCE_LOCATION policyName=SecurityPolicy-Allow-Http-00001-1 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"HTTP"} filterList=${allow_http_objectId4}|TSG_FIELD_HTTP_HOST,${allow_http_objectId5}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00001_1.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00001_1_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 首页 - 橙光
... ELSE Create List 首页 - 橙光
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Allow-Http-00002
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00002.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00002_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List ScoutBahamas.org
... ELSE Create List ScoutBahamas.org
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变allow策略
log ${allow_http_policyId1}
${policyDict} Create Dictionary policyId=${allow_http_policyId1} policyName=SecurityPolicy-Allow-Http-00002-1 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"HTTP"} filterList=${allow_http_objectId7}|TSG_FIELD_HTTP_HOST,${allow_http_objectId8}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00002_1.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00002_1L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 女生小说-香网小说网
... ELSE Create List 女生小说-香网小说网
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Allow-Http-00003
Comment 开启allow策略
${policyDict} Create Dictionary policyId=${allow_http_policyId2} policyName=SecurityPolicy-Allow-Http-00003-1 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"HTTP"} isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00002.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00002_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List ScoutBahamas.org
... ELSE Create List ScoutBahamas.org
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 关闭allow策略
${policyDict} Create Dictionary policyId=${allow_http_policyId2} policyName=SecurityPolicy-Allow-Http-00003-2 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"HTTP"} isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}

View File

@@ -1,80 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp security_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Library Custometest
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../05-Other/AllFlowCaseVariable.txt
Library Custometest
Library SSHLibrary
*** Test Cases ***
SecurityPolicy-Allow-RTP-00005-1
Open Connection ${voipOutListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/Rtpp-3.6.0/data
Write Rtpp -sf reg.xml -inf reg6.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
sleep 10
Write Rtpp -sf uas.xml -inf reg6.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/Rtpp-3.6.0/data/uac
Write Rtpp -sf reg.xml -inf reg104.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write Rtpp -sf uac_1.xml -d 10000 -s test3 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file allowRtperror005.log
sleep 10
Write grep "404" /home/yyq/Rtpp-3.6.0/data/uac/allowRtperror002.log
${res} Read delay=5s
Should Contain ${res} 404 Not here
Close All Connections
SecurityPolicy-Allow-RTP-00005-2
Open Connection ${voipOutListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/Rtpp-3.6.0/data
Write Rtpp -sf reg.xml -inf reg7.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
sleep 10
Write Rtpp -sf uas.xml -inf reg7.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/Rtpp-3.6.0/data/uac
Write Rtpp -sf reg.xml -inf reg105.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write Rtpp -sf uac_1.xml -d 10000 -s test3 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file allowRtperror006.log
sleep 10
Write grep "404" /home/yyq/Rtpp-3.6.0/data/uac/allowRtperror002.log
${res} Read delay=5s
Should Contain ${res} 404 Not here
Close All Connections
SecurityPolicy-Allow-RTP-00005-3
Open Connection ${voipListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/Rtpp-3.6.0/data
Write Rtpp -sf reg.xml -inf reg2.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
sleep 10
Write Rtpp -sf uas.xml -inf reg2.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/Rtpp-3.6.0/data/uac
Write Rtpp -sf reg.xml -inf reg1.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write Rtpp -sf uac_1.xml -d 10000 -s test3 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -allowRtperror_file allowRtperror003.log
sleep 10
Write grep "404" /home/yyq/Rtpp-3.6.0/data/uac/allowRtperror003.log
${res} Read delay=5s
Should Contain ${res} 404 Not here
Close All Connections
# # Rtpp -sf uac_11.xml -d 10000 -s test3 192.168.40.158 -i 192.168.50.57 -r 1 -m 5 -trace_msg -message_file 0001.log -ringbuffer_size 10240

View File

@@ -1,149 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp security_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Library Custometest
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../05-Other/AllFlowCaseVariable.txt
Library Custometest
Library SSHLibrary
*** Test Cases ***
SecurityPolicy-Allow-SIP-00005-1
Open Connection ${voipListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data
Write sipp -sf reg.xml -inf reg2.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
sleep ${policyModifySleepSeconds}
Write sipp -sf uas.xml -inf reg2.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
Write sipp -sf uas.xml -inf reg2.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data/uac
Write sipp -sf reg.xml -inf reg1.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write sipp -sf uac_1.xml -d 10000 -s test3 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 001.log
Write sipp -sf uac_1.xml -d 10000 -s test3 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 001.log
sleep ${policyModifySleepSeconds}
Write grep "404" /home/yyq/sipp-3.6.0/data/uac/001.log
${res} Read delay=5s
Should Contain ${res} 404 Not here
Close All Connections
SecurityPolicy-Allow-SIP-00005-2
Open Connection ${voipListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data
Write sipp -sf reg.xml -inf reg3.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
sleep ${policyModifySleepSeconds}
Write sipp -sf uas.xml -inf reg3.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
Write sipp -sf uas.xml -inf reg3.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data/uac
Write sipp -sf reg.xml -inf reg101.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write sipp -sf uac_1.xml -d 10000 -s test4 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 002.log
Write sipp -sf uac_1.xml -d 10000 -s test4 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 002.log
sleep ${policyModifySleepSeconds}
Write grep "404" /home/yyq/sipp-3.6.0/data/uac/002.log
${res} Read delay=5s
Should Contain ${res} 404 Not here
Close All Connections
SecurityPolicy-Allow-SIP-00005-3
Open Connection ${voipListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data
Write sipp -sf reg.xml -inf reg4.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
sleep ${policyModifySleepSeconds}
Write sipp -sf uas.xml -inf reg4.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
Write sipp -sf uas.xml -inf reg4.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data/uac
Write sipp -sf reg.xml -inf reg102.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write sipp -sf uac_1.xml -d 10000 -s test5 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 003.log
Write sipp -sf uac_1.xml -d 10000 -s test5 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 003.log
sleep ${policyModifySleepSeconds}
Write grep "404" /home/yyq/sipp-3.6.0/data/uac/003.log
${res} Read delay=5s
Should Contain ${res} 404 Not here
Close All Connections
SecurityPolicy-Allow-SIP-00005-4
Open Connection ${voipListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data
Write sipp -sf reg.xml -inf reg5.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
sleep ${policyModifySleepSeconds}
Write sipp -sf uas.xml -inf reg5.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
Write sipp -sf uas.xml -inf reg5.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data/uac
Write sipp -sf reg.xml -inf reg103.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write sipp -sf uac_1.xml -d 10000 -s test6 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 004.log
Write sipp -sf uac_1.xml -d 10000 -s test6 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 004.log
sleep ${policyModifySleepSeconds}
Write grep "404" /home/yyq/sipp-3.6.0/data/uac/004.log
${res} Read delay=5s
Should Contain ${res} 404 Not here
Close All Connections
SecurityPolicy-Allow-SIP-00005-5
Open Connection ${voipOutListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data
Write sipp -sf reg.xml -inf reg6.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
sleep ${policyModifySleepSeconds}
Write sipp -sf uas.xml -inf reg6.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
Write sipp -sf uas.xml -inf reg6.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data/uac
Write sipp -sf reg.xml -inf reg104.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write sipp -sf uac_1.xml -d 10000 -s test7 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 005.log
Write sipp -sf uac_1.xml -d 10000 -s test7 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 005.log
sleep ${policyModifySleepSeconds}
Write grep "404" /home/yyq/sipp-3.6.0/data/uac/005.log
${res} Read delay=5s
Should Contain ${res} 404 Not here
Close All Connections
SecurityPolicy-Allow-SIP-00005-6
Open Connection ${voipOutListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data
Write sipp -sf reg.xml -inf reg7.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
sleep ${policyModifySleepSeconds}
Write sipp -sf uas.xml -inf reg7.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
Write sipp -sf uas.xml -inf reg7.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data/uac
Write sipp -sf reg.xml -inf reg105.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write sipp -sf uac_1.xml -d 10000 -s test8 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 006.log
Write sipp -sf uac_1.xml -d 10000 -s test8 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 006.log
sleep ${policyModifySleepSeconds}
Write grep "404" /home/yyq/sipp-3.6.0/data/uac/006.log
${res} Read delay=5s
Should Contain ${res} 404 Not here
Close All Connections
# # sipp -sf uac_11.xml -d 10000 -s test3 192.168.40.158 -i 192.168.50.57 -r 1 -m 5 -trace_msg -message_file 0001.log -ringbuffer_size 10240

View File

@@ -1,69 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp security_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
SecurityPolicy-Allow-Ssl-00001
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Allow_SSL_00001.bat
... ELSE set variable curl https://homebank.kz/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Переводы
... ELSE Create List Переводы
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变Allow策略
${policyDict} Create Dictionary policyId=${allow_ssl_policyId} source=${allow_ssl_objectId2}|TSG_SECURITY_SOURCE_LOCATION policyName=SecurityPolicy-Allow-Ssl-00001 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SSL"} filterList=${allow_ssl_objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Allow_SSL_00001.bat
... ELSE set variable curl https://homebank.kz/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Переводы
... ELSE Create List Переводы
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Allow-Ssl-00002
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Allow_SSL_00002.bat
... ELSE set variable curl -kv https://protomail.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Secure email
... ELSE Create List Secure email
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变Allow策略
${policyDict} Create Dictionary policyId=${allow_ssl_policyId1} policyName=SecurityPolicy-Allow-Ssl-00002-1 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SSL"} filterList=${allow_ssl_objectId3}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Allow_SSL_00002_1.bat
... ELSE set variable curl -kv https://xinyue.qq.com/#/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 心悦
... ELSE Create List 心悦
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Allow-Ssl-00003
Comment 开启allow策略
${policyDict} Create Dictionary policyId=${allow_ssl_policyId2} policyName=SecurityPolicy-Allow-Ssl-00003-1 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SSL"} isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Allow_SSL_00002.bat
... ELSE set variable curl -kv https://protonmail.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Secure email
... ELSE Create List Secure email
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 关闭allow策略
${policyDict} Create Dictionary policyId=${allow_ssl_policyId2} policyName=SecurityPolicy-Allow-Ssl-00003-2 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"SSL"} isValid=${0} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}

View File

@@ -1,204 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp proxy_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
Proxy-Policy-allow-00001
sleep ${policyModifySleepSeconds}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00001.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_allow_00001_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 皮皮虾下载 Tango Secure Gateway CA
... ELSE Create List 皮皮虾下载 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变拦截策略
${policyDict} Create Dictionary policyId=${intercept_allow_policyId} policyName=SecurityPolicy-Intercept-allow_1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${allow_objectId39}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 改变allow策略
${policyDict} Create Dictionary policyId=${allow_policyId} policyName=Proxy-Policy-allow-00001_1 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${allow_objectId39}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00001.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_allow_00001_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 皮皮虾下载 Tango Secure Gateway CA
... ELSE Create List 皮皮虾下载 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-allow-00002
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00002.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_allow_00002_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List www.feishu.cn Tango Secure Gateway CA
... ELSE Create List www.feishu.cn Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-allow-00003
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00003.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_allow_00003_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List csgo500 Tango Secure Gateway CA
... ELSE Create List csgo500 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00003_1.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_allow_00003_1L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List Тайные Tango Secure Gateway CA
... ELSE Create List Новости Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00003_2.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_allow_00003_2L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List RSD Tango Secure Gateway CA
... ELSE Create List RSD Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-allow-00004
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.hao123.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 上网从这里开始 Tango Secure Gateway CA
... ELSE Create List 上网从这里开始 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变allow策略
${policyDict} Create Dictionary policyId=${allow_policyId3} policyName=Proxy-Policy-allow-00004-1 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${allow_objectId40}|TSG_FIELD_HTTP_URL,${allow_objectId41}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.hao123.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 上网从这里开始 Tango Secure Gateway CA
... ELSE Create List 上网从这里开始 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-allow-00005
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 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
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-allow-00006
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_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.choicehotels.com/quality-inn
${stringlist} run keyword if '${systemType}'=='Windows' Create List stores locale settings for multiple country sites Tango Secure Gateway CA
... ELSE Create List stores locale settings for multiple country sites Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-allow-00007
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00007.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_allow_00007_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List WoodSnap Tango Secure Gateway CA
... ELSE Create List WoodSnap Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-allow-00008
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00008.bat
... ELSE set variable curl http://www.sse.com.cn/market/overview/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 上海证券交易所
... ELSE Create List 上海证券交易所
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-allow-00009
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00009.bat
... ELSE set variable curl http://www.szse.cn/lawrules/index.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 信息订阅
... ELSE Create List 信息订阅
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-allow-00010
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00010.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_allow_00010_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 广发证券
... ELSE Create List 广发证券
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-allow-00011
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00011.bat
... ELSE set variable curl http://www.chinastock.com.cn/newsite/cgs-services/investBank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 中国银河证券
... ELSE Create List 中国银河证券
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变allow
${policyDict} Create Dictionary policyId=${allow_policyId10} policyName=Proxy-Policy-allow-00011_1 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${allow_objectId26}|TSG_FIELD_HTTP_URL,${allow_objectId42}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00011.bat
... ELSE set variable curl http://www.chinastock.com.cn/newsite/cgs-services/investBank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 中国银河证券
... ELSE Create List 中国银河证券
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-allow-00012
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00012.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_allow_00012_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List Object moved Tango Secure Gateway CA
... ELSE Create List Object moved Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00012_2.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_allow_00012_2L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 红袖读书 Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00012_3.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_allow_00012_3L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 小说阅读网 Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00012_4.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_allow_00012_4L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-allow-00013
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00013.bat
... ELSE set variable curl -kv https://russia.payu.com/orange-data/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00013_1.bat
... ELSE set variable curl -kv https://tytbz.925mm.com/page/about.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 璐村 Tango Secure Gateway CA
... ELSE Create List 贴壁纸联盟 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00013_2.bat
... ELSE set variable curl -kv https://dujia.qunar.com/?ex_track=auto_52b3f121
${stringlist} run keyword if '${systemType}'=='Windows' Create List 去哪儿旅游 Tango Secure Gateway CA
... ELSE Create List 去哪儿旅游 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00013_3.bat
... ELSE set variable curl -kv https://www.vitalsource.com/textbooks
${stringlist} run keyword if '${systemType}'=='Windows' Create List Shop online and downloadable Tango Secure Gateway CA
... ELSE Create List Shop online and downloadable Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-allow-00014
Comment 功能端验证HTTP验证
${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 www.orbitz.com Tango Secure Gateway CA
... ELSE Create List www.orbitz.com Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}

View File

@@ -1,97 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
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_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Library json
Library DateTime
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-Http-00001
#新增策略验证
#创建attributes中的字典
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.66rpg.com"}
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${qname_fqdn_id} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.66rpg.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${qname_fqdn_id} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_http_policyId}
# 打印检查结果
${objectid_verify} Set Variable ${allow_http_objectId4}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_http_objectId5} ${allow_http_policyId} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Allow-Http-00002
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.xiang5.com/"}
${qname_fqdn_id} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.xiang5.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${qname_fqdn_id} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_http_policyId1}
# 打印检查结果
${objectid_verify} Set Variable ${allow_http_objectId7}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_http_objectId8} ${allow_http_policyId1} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true

View File

@@ -1,48 +0,0 @@
*** Settings ***
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
Force Tags tsg_adc_wp adc_log security_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 ../../../05-Other/AllFlowCaseVariable.txt
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../05-Other/AllFlowCaseVariable1.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-Http-00001
#删除对象
${objectids} set Variable ${allow_http_objectId}
${objectids} Catenate SEPARATOR=, ${objectids} ${allow_http_objectId2}
${objectids} Catenate SEPARATOR=, ${objectids} ${allow_http_objectId3}
${objectids} Catenate SEPARATOR=, ${objectids} ${allow_http_objectId4}
${objectids} Catenate SEPARATOR=, ${objectids} ${allow_http_objectId5}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${allow_http_policyId}]}
${s} Convert to String ${allow_http_policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host clintonairport.com
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host www.66rpg.com
SecurityPolicy-Allow-Http-00002
#删除对象
${objectids} set Variable ${allow_http_objectId1}
${objectids} Catenate SEPARATOR=, ${objectids} ${allow_http_objectId6}
${objectids} Catenate SEPARATOR=, ${objectids} ${allow_http_objectId7}
${objectids} Catenate SEPARATOR=, ${objectids} ${allow_http_objectId8}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${allow_http_policyId1}]}
${s} Convert to String ${allow_http_policyId1}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host scoutbahamas
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host www.xiang5.com
SecurityPolicy-Allow-Http-00003
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${allow_http_policyId2}]}
${s} Convert to String ${allow_http_policyId2}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host scoutbahamas

View File

@@ -1,95 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
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_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Library json
Library DateTime
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-Ssl-00001
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "huawei.com"}
${sni} Create Dictionary attributeType=string attributeName=sni appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "homebank.kz"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${SSL_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${sni} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_ssl_policyId}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_ssl_objectId} ${allow_ssl_policyId} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Allow-Ssl-00002
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "hahauawei.org"}
${sni} Create Dictionary attributeType=string attributeName=sni appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "xinyue.qq.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${SSL_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${sni} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_ssl_policyId1}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_ssl_objectId3} ${allow_ssl_policyId1} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true

View File

@@ -1,507 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
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_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Library json
Library DateTime
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
Proxy-Policy-allow-00001
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "mp.pipix.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId39} ${allow_policyId} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-allow-00002
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.feishu.cn"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId1}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId1} ${allow_policyId1} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-allow-00003
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "csgo500.com"}
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "znakitaro.ru"}
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "astrou.ru"}
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "lunar.pw"}
${url1} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "csgo500.com"}
${url2} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "znakitaro.ru"}
${url3} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "astrou.ru"}
${url4} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "lunar.pw"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn1} ${fqdn2} ${fqdn3} ${fqdn4}
... ${url1} ${url2} ${url3} ${url4} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId2}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId2} ${allow_objectId3} ${allow_policyId2} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-allow-00004
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.hao123.com"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "afsfsdafsafsafsfMozilla/5.0afsfsdafsafs","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId3}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId40} ${allow_objectId41} ${allow_policyId3} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-allow-00005
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "boutiquehotel.me"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "boutiquehotel.me/paris/"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Mozilla/5.0aaffwefweaf","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId4}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId7} ${allow_objectId8} ${allow_objectId9} ${allow_policyId4} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-allow-00006
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.choicehotels.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.choicehotels.com/quality-inn"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "AppleWebKit","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId5}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId10} ${allow_objectId11} ${allow_objectId12} ${allow_policyId5}
... ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-allow-00007
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.woodsnap.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.woodsnap.com/about-us/frames"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahahahsfeSafari/537.36","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId6}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId13} ${allow_objectId14} ${allow_objectId15} ${allow_policyId6} ${object_imsi_id}
... ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-allow-00008
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.sse.com.cn"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.sse.com.cn/market/overview/"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "666html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId7}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId16} ${allow_objectId17} ${allow_objectId18} ${allow_policyId7} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-allow-00009
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.szse.cn"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.szse.cn/lawrules/index.html"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId8}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId19} ${allow_objectId20} ${allow_objectId21}
... ${allow_policyId8} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-allow-000010
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.gf.com.cn"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.gf.com.cn/about/intro"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId9}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId22} ${allow_objectId23} ${allow_objectId24} ${allow_policyId9} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-allow-000011
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.chinastock.com.cn/newsite/cgs-services/investBank.html"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId10}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId26} ${allow_objectId42} ${allow_policyId10} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-allow-000012
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.virtuoso.com"}
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.hongxiu.com"}
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.readnovel.com"}
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "b.faloo.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.virtuoso.com/destinations"}
${url2} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.hongxiu.com/"}
${url3} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.readnovel.com/"}
${url4} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "b.faloo.com/"}
${req_hdr_ck1} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "fsfsfslQfQ_2132afaafa","district": "Cookie"}
${req_hdr_ck2} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "afafs_csrfTokenafsfs","district": "Cookie"}
${req_hdr_ck3} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "curr_urlfafsfdfgh","district": "Cookie"}
${req_hdr_ck4} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "afsfs1406562325","district": "Cookie"}
${req_hdr_ck5} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "UM_fafs1234","district": "Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn1} ${fqdn2} ${fqdn3} ${fqdn4} ${url1} ${url2} ${url3} ${url4}
... ${req_hdr_ck1} ${req_hdr_ck2} ${req_hdr_ck3} ${req_hdr_ck4} ${req_hdr_ck5} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId11}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId28} ${allow_objectId29} ${allow_objectId30} ${allow_policyId11} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-allow-000013
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "russia.payu.com"}
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "tytbz.925mm.com"}
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "dujia.qunar.com"}
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.vitalsource.com"}
${res_hdr_sc1} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "frontLang=zh-cnaffwww","district": "Set-Cookie"}
${res_hdr_sc2} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1111222Domain=qunar.com; Path=/","district": "Set-Cookie"}
${res_hdr_sc3} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "pll_language=rufsfdswkl123","district": "Set-Cookie"}
${res_hdr_sc4} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "_stargate_sessionfafaf31","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn1} ${fqdn2} ${fqdn3} ${fqdn4} ${res_hdr_sc1} ${res_hdr_sc2} ${res_hdr_sc3} ${res_hdr_sc4}
... ${res_hdr_sc1} ${res_hdr_sc2} ${res_hdr_sc3} ${res_hdr_sc4} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId12}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId31} ${allow_objectId32} ${allow_policyId12} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-allow-000014
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.orbitz.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.orbitz.com/Flights"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "charset=text","district": "Content-Type"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Mozilla/5.0fsfwhh","district": "User-Agent"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "__stripe_sidafdsvxvx","district": "Cookie"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "afsf123Domain=.orbitz.com","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct} ${req_hdr_ua} ${req_hdr_ck}
... ${res_hdr_sc} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId13}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId33} ${allow_objectId34} ${allow_objectId35} ${allow_objectId36}
... ${allow_objectId37} ${allow_objectId38} ${allow_policyId13} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true

View File

@@ -1,110 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp security_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
SecurityPolicy-Deny-Dns-00001
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.facebook.com
... ELSE set variable nslookup www.facebook.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 超时
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d rutube.ru
... ELSE set variable nslookup -d rutube.ru
${stringlist} run keyword if '${systemType}'=='Windows' Create List 超时
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变阻断策略
${policyDict} Create Dictionary policyId=${deny_dns_policyId} policyName=SecurityPolicy-Deny-Dns-00001_1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"DNS","method":"drop"} source=${deny_dns_objectId4}|TSG_SECURITY_SOURCE_LOCATION filterList=${deny_dns_objectId}|TSG_FIELD_DNS_QNAME isValid=${1} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.facebook.com
... ELSE set variable nslookup www.facebook.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 超时
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d rutube.ru
... ELSE set variable nslookup -d rutube.ru
${stringlist} run keyword if '${systemType}'=='Windows' Create List 超时
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Deny-Dns-00002
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.arctictrucks.ru 8.8.8.8
... ELSE set variable nslookup -debug -query=A \ www.arctictrucks.ru
${stringlist} run keyword if '${systemType}'=='Windows' Create List www.arctictrucks.ru
... ELSE Create List www.arctictrucks.ru
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d wifika.ru 8.8.8.8
... ELSE set variable nslookup -debug -query=A \ wifika.ru
${stringlist} run keyword if '${systemType}'=='Windows' Create List wifika.ru
... ELSE Create List wifika.ru
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Deny-Dns-00003
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d aec188.com 8.8.8.8
... ELSE set variable nslookup -debug -query=AAAA \ aec188.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List aec188.com
... ELSE Create List aec188.com
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d huitu.com 8.8.8.8
... ELSE set variable nslookup -debug -query=AAAA \ huitu.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List huitu.com
... ELSE Create List fc00::2:11 www.taobao.com ttl = 400
${rescode} SystemCommands ${commandstr} ${stringlist}
# Comment 用后失效与insert12互相影响
# ${policyDict} Create Dictionary policyId=${deny_dns_policyId2} policyName=SecurityPolicy-Deny-Dns-00003_1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"AAAA","answer":[{"atype":"AAAA","value":"fc00::2:11","ttl":{"min":400,"max":400}},{"atype":"CNAME","value":"www.taobao.com","ttl":{"min":600,"max":600}}]}]} filterList=129|TSG_FIELD_DNS_QNAME isValid=${0} appIdObjects=${DNS_ID}
# log ${policyDict}
# ${rescode} UpdatePolicies 1 ${policyDict} v2 update
SecurityPolicy-Deny-Dns-00004
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.twitch.tv 8.8.8.8
... ELSE set variable nslookup -debug -query=A \ www.twitch.tv
${stringlist} run keyword if '${systemType}'=='Windows' Create List www.ok.ru
... ELSE Create List 192.168.40.110 www.ok.ru ttl = 400
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变阻断策略
${policyDict} Create Dictionary policyId=${deny_dns_policyId3} policyName=SecurityPolicy-Deny-Dns-00004_1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"DNS","method":"redirect","resolution":[{"answer":[{"atype":"AAAA","value":"fc00::2:22","ttl":{"min":400,"max":400}},{"atype":"CNAME","value":"www.facebook.com","ttl":{"min":400,"max":400}}],"qtype":"AAAA"},{"qtype":"A","answer":[{"atype":"CNAME","value":"www.ok.ru","ttl":{"min":400,"max":400}},{"atype":"A","value":"192.168.40.110","ttl":{"min":400,"max":400}}]}]} filterList=${deny_dns_objectId5}|TSG_FIELD_DNS_QNAME isValid=${1} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.twitch.tv 8.8.8.8
... ELSE set variable nslookup -debug -query=AAAA \ www.twitch.tv
${stringlist} run keyword if '${systemType}'=='Windows' Create List www.ok.ru
... ELSE Create List ttl = 400 www.facebook.com fc00::2:22
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Deny-Dns-00005
Comment 打开安全策略
${policyDict} Create Dictionary policyId=${deny_dns_policyId4} policyName=SecurityPolicy-Deny-Dns-00005-1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"DNS","method":"drop"} isValid=${1} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.facebook.com
... ELSE set variable nslookup www.facebook.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 超时
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 关闭安全策略
${policyDict} Create Dictionary policyId=${deny_dns_policyId4} policyName=SecurityPolicy-Deny-Dns-00005-2 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"DNS","method":"drop"} isValid=${0} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}

View File

@@ -1,62 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp security_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Library Custometest
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
SecurityPolicy-Deny-Ftp-00001
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/123456.txt -u ftpuser:111111 123456789qwertyuiop
# should contain ${FTP} ftp_fail
run keyword if '${systemType}'=='Windows' should contain ${FTP} ftp_fail
... ELSE should contain ${FTP} Fail
Comment 改变阻断策略
${policyDict} Create Dictionary policyId=${deny_ftp_policyId} source=${deny_ftp_objectId12}|TSG_SECURITY_SOURCE_LOCATION policyName=SecurityPolicy-Deny-FTP-00001-1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"FTP","method":"drop"} filterList=${deny_ftp_objectId13}|TSG_FIELD_FTP_ACCOUNT,${deny_ftp_objectId15}|TSG_FIELD_FTP_CONTENT,${deny_ftp_objectId14}|TSG_FIELD_FTP_URI isValid=${1} appIdObjects=${FTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/123456.txt -u ftpuser:111111 123456789qwertyuiop
# should contain ${FTP} ftp_fail
run keyword if '${systemType}'=='Windows' should contain ${FTP} ftp_fail
... ELSE should contain ${FTP} Fail
SecurityPolicy-Deny-Ftp-00002
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/test.txt -u ftpuser:111111 中文test
run keyword if '${systemType}'=='Windows' should contain ${FTP} ftp_fail
... ELSE should contain ${FTP} Fail
SecurityPolicy-Deny-Ftp-00003
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/wlcsy.txt -u ftpuser:111111 中文文件内容
run keyword if '${systemType}'=='Windows' should contain ${FTP} ftp_fail
... ELSE should contain ${FTP} Fail
SecurityPolicy-Deny-Ftp-00004
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/aewn.txt -u ftpuser:111111 завезенными
run keyword if '${systemType}'=='Windows' should contain ${FTP} ftp_fail
... ELSE should contain ${FTP} Fail
SecurityPolicy-Deny-Ftp-00005
Comment 开启阻断策略
${policyDict} Create Dictionary policyId=${deny_ftp_policyId4} policyName=SecurityPolicy-Deny-FTP-00005-1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"FTP","method":"drop"} isValid=${1} appIdObjects=${FTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证
${FTP} FTP_login ftp://192.168.40.158/test.txt -u ftpuser:111111 中文test
# should contain ${FTP} ftp_fail
run keyword if '${systemType}'=='Windows' should contain ${FTP} ftp_fail
... ELSE should contain ${FTP} Fail
Comment 关闭阻断策略
${policyDict} Create Dictionary policyId=${deny_ftp_policyId4} policyName=SecurityPolicy-Deny-FTP-00005-2 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"FTP","method":"rst"} isValid=${0} appIdObjects=${FTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}

View File

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

View File

@@ -1,391 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp security_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_common/StmpHandle.robot
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
SecurityPolicy-Deny-Mail-00001
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable 123123132
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/朱明明测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable Простопорно
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
Comment 改变监控策略
${policyDict} Create Dictionary policyId=${deny_mail_policyId} source=${deny_mail_objectId32}|TSG_SECURITY_SOURCE_LOCATION policyName=SecurityPolicy-Deny-Mail-00001-1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"drop"} filterList=${deny_mail_objectId33}|TSG_FIELD_MAIL_CONTENT isValid=${1} appIdObjects=${MAIL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable 123123132
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/朱明明测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable Простопорно
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
SecurityPolicy-Deny-Mail-00002
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable BigTitle
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
Comment 改变监控策略
${policyDict} Create Dictionary policyId=${deny_mail_policyId1} policyName=SecurityPolicy-Deny-Mail-00002-1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"drop"} filterList=${deny_mail_objectId34}|TSG_FIELD_MAIL_ATT_CONTENT,,${deny_mail_objectId39}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable BigTitle
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
SecurityPolicy-Deny-Mail-00003
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable ПОРНОВИДЕО
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
Comment 改变监控策略
${policyDict} Create Dictionary policyId=${deny_mail_policyId2} policyName=SecurityPolicy-Deny-Mail-00003-1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${deny_mail_objectId36}|TSG_FIELD_MAIL_FROM,${deny_mail_objectId35}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable ПОРНОВИДЕО
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
SecurityPolicy-Deny-Mail-00004
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable 明天周末
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
SecurityPolicy-Deny-Mail-00005
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable 1234567890
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
SecurityPolicy-Deny-Mail-00006
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable afternoon
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
SecurityPolicy-Deny-Mail-00007
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable Смотретьфильмыонлай
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
SecurityPolicy-Deny-Mail-00008
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable zxcvbnm
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
SecurityPolicy-Deny-Mail-00009
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable 又是新的一天
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
SecurityPolicy-Deny-Mail-00010
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable tomorrow
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
SecurityPolicy-Deny-Mail-00011
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable 邮件发送失败
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
SecurityPolicy-Deny-Mail-00012
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable Онлайнфильмывхоро
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
SecurityPolicy-Deny-Mail-00013
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable asdfghjkl
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
SecurityPolicy-Deny-Mail-00014
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable 马上就要下班了
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
SecurityPolicy-Deny-Mail-00015
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable 人生路远及时行乐
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable good
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
SecurityPolicy-Deny-Mail-00016
Comment 开启阻断策略
${policyDict} Create Dictionary policyId=${deny_mail_policyId15} policyName=SecurityPolicy-Deny-Mail-00016 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} isValid=${0} appIdObjects=${MAIL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable 人生路远及时行乐
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable good
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
Comment 关闭阻断策略
${policyDict} Create Dictionary policyId=${deny_mail_policyId15} policyName=SecurityPolicy-Deny-Mail-00016 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} isValid=${0} appIdObjects=${MAIL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}
SecurityPolicy-Deny-Mail-00017
Comment 功能端验证
${Smtp服务器} Set Variable Smtp.163.com
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable ${mailAccount}
${邮箱密码} Set Variable ${mailPasswd}
${邮件主题} Set Variable denymail017
${发送者} Set Variable ${mailAccount}
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["${mailAccountGeedge}"]
${抄送者} Set Variable ["${mailAccountGeedge}"]
${密送者} Set Variable ["${mailAccountGeedge}"]
${邮件正文} Set Variable Deny17右匹配测试邮件正文
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail

View File

@@ -1,66 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp security_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Library Custometest
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../05-Other/AllFlowCaseVariable.txt
Library Custometest
Library SSHLibrary
*** Test Cases ***
SecurityPolicy-Allow-RTP-00005-1
Open Connection ${voipOutListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data
Write sipp -sf reg.xml -inf reg18.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
sleep 10
Write sipp -sf uas.xml -inf reg18.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
Write sipp -sf uas.xml -inf reg18.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data/uac
Write sipp -sf reg.xml -inf reg116.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write sipp -sf uac_1.xml -d 10000 -s test19 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file denyRtperror005.log
Write sipp -sf uac_1.xml -d 10000 -s test19 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file denyRtperror005.log
sleep 10
Write grep "480" /home/yyq/sipp-3.6.0/data/uac/denySiperror005.log
${res} Read delay=5s
Should Contain ${res} 500 Server Internal denySiperror
Close All Connections
SecurityPolicy-Allow-RTP-00005-2
Open Connection ${voipOutListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data
Write sipp -sf reg.xml -inf reg19.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
sleep 10
Write sipp -sf uas.xml -inf reg19.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
Write sipp -sf uas.xml -inf reg19.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data/uac
Write sipp -sf reg.xml -inf reg117.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write sipp -sf uac_1.xml -d 10000 -s test20 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file denyRtperror006.log
Write sipp -sf uac_1.xml -d 10000 -s test20 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file denyRtperror006.log
sleep 10
Write grep "408" /home/yyq/sipp-3.6.0/data/uac/denySiperror006.log
${res} Read delay=5s
Should Contain ${res} 408 Request Timeout
Close All Connections
# # sipp -sf uac_11.xml -d 10000 -s test3 192.168.40.158 -i 192.168.50.57 -r 1 -m 5 -trace_msg -message_file 0001.log -ringbuffer_size 10240

View File

@@ -1,148 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp security_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Library Custometest
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../05-Other/AllFlowCaseVariable.txt
Library Custometest
Library SSHLibrary
*** Test Cases ***
SecurityPolicy-Deny-SIP-00005-1
Open Connection ${voipListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data
Write sipp -sf reg.xml -inf reg14.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
sleep ${policyModifySleepSeconds}
Write sipp -sf uas.xml -inf reg14.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data/uac
Write sipp -sf reg.xml -inf reg112.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write sipp -sf uac_1.xml -d 10000 -s test15 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 007.log
Write sipp -sf uac_1.xml -d 10000 -s test15 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 007.log
sleep ${policyModifySleepSeconds}
Write grep "480" /home/yyq/sipp-3.6.0/data/uac/007.log
${res} Read delay=5s
Should Contain ${res} 480 Temporarily Unavailable
Close All Connections
# Write find . | xargs grep -ri "200 OK" -l
# ${res} Read delay=2s
# Should Contain ${res} 200
SecurityPolicy-Deny-SIP-00005-2
Open Connection ${voipListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data
Write sipp -sf reg.xml -inf reg15.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
sleep ${policyModifySleepSeconds}
Write sipp -sf uas.xml -inf reg15.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data/uac
Write sipp -sf reg.xml -inf reg113.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write sipp -sf uac_1.xml -d 10000 -s test16 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 008.log
Write sipp -sf uac_1.xml -d 10000 -s test16 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 008.log
sleep ${policyModifySleepSeconds}
Write grep "480" /home/yyq/sipp-3.6.0/data/uac/008.log
${res} Read delay=5s
Should Contain ${res} 500 Server Internal denySiperror
Close All Connections
SecurityPolicy-Deny-SIP-00005-3
Open Connection ${voipListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data
Write sipp -sf reg.xml -inf reg16.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
sleep ${policyModifySleepSeconds}
Write sipp -sf uas.xml -inf reg16.csv -p 6068 -i ${voipListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data/uac
Write sipp -sf reg.xml -inf reg114.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write sipp -sf uac_1.xml -d 10000 -s test17 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 009.log
Write sipp -sf uac_1.xml -d 10000 -s test17 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 009.log
sleep ${policyModifySleepSeconds}
Write grep "408" /home/yyq/sipp-3.6.0/data/uac/009.log
${res} Read delay=5s
Should Contain ${res} 408 Request Timeout
Close All Connections
SecurityPolicy-Deny-SIP-00005-4
Open Connection ${voipOutListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data
Write sipp -sf reg.xml -inf reg17.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
sleep ${policyModifySleepSeconds}
Write sipp -sf uas.xml -inf reg17.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data/uac
Write sipp -sf reg.xml -inf reg115.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write sipp -sf uac_1.xml -d 10000 -s test18 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 010.log
Write sipp -sf uac_1.xml -d 10000 -s test18 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 010.log
sleep ${policyModifySleepSeconds}
Write grep "480" /home/yyq/sipp-3.6.0/data/uac/010.log
${res} Read delay=5s
Should Contain ${res} 480 Temporarily Unavailable
Close All Connections
# Write find . | xargs grep -ri "200 OK" -l
# ${res} Read delay=2s
# Should Contain ${res} 200
SecurityPolicy-Deny-SIP-00005-5
Open Connection ${voipOutListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data
Write sipp -sf reg.xml -inf reg18.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
sleep ${policyModifySleepSeconds}
Write sipp -sf uas.xml -inf reg18.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data/uac
Write sipp -sf reg.xml -inf reg116.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write sipp -sf uac_1.xml -d 10000 -s test19 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 011.log
Write sipp -sf uac_1.xml -d 10000 -s test19 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 011.log
sleep ${policyModifySleepSeconds}
Write grep "480" /home/yyq/sipp-3.6.0/data/uac/011.log
${res} Read delay=5s
Should Contain ${res} 500 Server Internal denySiperror
Close All Connections
SecurityPolicy-Deny-SIP-00005-6
Open Connection ${voipOutListenIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data
Write sipp -sf reg.xml -inf reg19.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
sleep ${policyModifySleepSeconds}
Write sipp -sf uas.xml -inf reg19.csv -p 6068 -i ${voipOutListenIp} -m 50 192.168.40.158:5060
Open Connection ${voipCallIp}
SSHLibrary.Login root Xxg-PUB<>90
Write cd /home/yyq/sipp-3.6.0/data/uac
Write sipp -sf reg.xml -inf reg117.csv -p 6067 -i ${voipCallIp} -m 50 192.168.40.158:5060
Write sipp -sf uac_1.xml -d 10000 -s test20 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 012.log
Write sipp -sf uac_1.xml -d 10000 -s test20 192.168.40.158 -i ${voipCallIp} -r 1 -m 5 -trace_err -error_file 012.log
sleep ${policyModifySleepSeconds}
Write grep "408" /home/yyq/sipp-3.6.0/data/uac/012.log
${res} Read delay=5s
Should Contain ${res} 408 Request Timeout
Close All Connections
# # sipp -sf uac_1.xml -d 10000 -s test3 192.168.40.158 -i 192.168.50.57 -r 1 -m 5 -trace_msg -message_file 0001.log -ringbuffer_size 10240

View File

@@ -1,93 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp security_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
SecurityPolicy-Deny-Ssl-00001
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00001.bat
... ELSE set variable curl https://www.freestockimages.ru/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List OpenSSL SSL_connect
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00001_1.bat
... ELSE set variable curl \ \ \ https://www.cxwl.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List OpenSSL SSL_connect
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变阻断策略
${policyDict} Create Dictionary policyId=${deny_ssl_policyId} source=${deny_ssl_objectId5}|TSG_SECURITY_SOURCE_LOCATION policyName=SecurityPolicy-Deny-Ssl-00001_1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"rst"} filterList=${deny_ssl_objectId4}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00001_1.bat
... ELSE set variable curl \ \ \ https://www.cxwl.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List OpenSSL SSL_connect
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Deny-Ssl-00002
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00002.bat
... ELSE set variable curl https://amesweb.info/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List OpenSSL SSL_connect
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00002_2.bat
... ELSE set variable curl https://rentar.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List OpenSSL SSL_connect
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Deny-Ssl-00003
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00003.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00003_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Deny-Ssl-00004
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00004.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00004_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变阻断策略
${policyDict} Create Dictionary policyId=${deny_ssl_policyId3} policyName=SecurityPolicy-Deny-Ssl-00004 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"drop"} filterList=${deny_ssl_objectId6}|TSG_FIELD_SSL_SAN,${deny_ssl_objectId6}|TSG_FIELD_SSL_SNI,${deny_ssl_objectId6}|TSG_FIELD_SSL_CN isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00004.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00004_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Deny-Ssl-00005
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00005.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00005_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变阻断策略
${policyDict} Create Dictionary policyId=${deny_ssl_policyId4} policyName=SecurityPolicy-Deny-Ssl-00005-1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"drop"} filterList=${deny_ssl_objectId7}|TSG_FIELD_SSL_SAN,${deny_ssl_objectId7}|TSG_FIELD_SSL_SNI,${deny_ssl_objectId7}|TSG_FIELD_SSL_CN isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00005.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00005_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
... ELSE Create List timed out
${rescode} SystemCommands ${commandstr} ${stringlist}

View File

@@ -1,306 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp proxy_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
Proxy-Policy-deny-00001
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00001.bat
... ELSE set variable curl -kv \ https://newsela.com/about/content/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 重新开始 Tango Secure Gateway CA
... ELSE Create List 重新开始 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变拦截策略
${policyDict} Create Dictionary policyId=${intercept_deny_policyId} policyName=SecurityPolicy-Intercept-deny-1 source=${deny_objectId56}|TSG_SECURITY_SOURCE_LOCATION policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${deny_objectId57}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}
Comment 改变阻断策略
${policyDict} Create Dictionary policyId=${deny_policyId} source=${deny_objectId56}|TSG_SECURITY_SOURCE_LOCATION policyName=Proxy-Policy-deny-00001-1 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"重新开始","code":403,"protocol":"HTTP"} filterList=${deny_objectId57}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00001.bat
... ELSE set variable curl -kv \ https://newsela.com/about/content/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 重新开始 Tango Secure Gateway CA
... ELSE Create List 重新开始 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 范围性,使用后关闭
Comment 改变拦截策略
${policyDict} Create Dictionary policyId=${intercept_deny_policyId} policyName=SecurityPolicy-Intercept-deny-1 source=${deny_objectId56}|TSG_SECURITY_SOURCE_LOCATION policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${deny_objectId57}|TSG_FIELD_SSL_SNI isValid=${0} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}
Comment 改变阻断策略
${policyDict} Create Dictionary policyId=${deny_policyId} source=${deny_objectId56}|TSG_SECURITY_SOURCE_LOCATION policyName=Proxy-Policy-deny-00001-1 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"重新开始","code":403,"protocol":"HTTP"} filterList=${deny_objectId57}|TSG_FIELD_HTTP_HOST isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Proxy-Policy-deny-00002
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00002.bat
... ELSE set variable curl -kv \ \ https://www.youku.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable Tango Secure Gateway CA
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-deny-00003
Comment 功能端验证HTTP验证
# ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00003.bat
# ... ELSE set variable curl -kv \ https://www.wimdu.de/
# ${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用 Tango Secure Gateway CA
# ... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用 Tango Secure Gateway CA
# ${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00003_1.bat
... ELSE set variable curl -kv \ https://creativetravelgroup.com/
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00003_1.bat
... ELSE set variable curl -kv \ https://creativetravelgroup.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用 Tango Secure Gateway CA
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00003_2.bat
... ELSE set variable curl -kv \ https://www.hinabian.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用 Tango Secure Gateway CA
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00003_3.bat
... ELSE set variable curl -kv \ https://www.smithsonianjourneys.org/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用 Tango Secure Gateway CA
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-deny-00004
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.usdebtclock.org/state-debt-clocks/state-of-california-debt-clock.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List qwertyuiop Tango Secure Gateway CA
... ELSE Create List qwertyuiop Tango Secure Gateway CA
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.usdebtclock.org/state-debt-clocks/state-of-california-debt-clock.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List qwertyuiop Tango Secure Gateway CA
... ELSE Create List qwertyuiop Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变拦截策略
${policyDict} Create Dictionary policyId=${intercept_deny_policyId3} policyName=SecurityPolicy-Intercept-deny-1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${deny_objectId50}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 改变阻断策略
${policyDict} Create Dictionary policyId=${deny_policyId3} policyName=Proxy-Policy-deny-00004-1 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"qwertyuiop","code":404,"protocol":"HTTP"} filterList=${deny_objectId48}|TSG_FIELD_HTTP_URL,${deny_objectId49}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 3
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00004_1.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://bbs.nga.cn/
${stringlist} run keyword if '${systemType}'=='Windows' Create List qwertyuiop Tango Secure Gateway CA
... ELSE Create List qwertyuiop Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-deny-00005
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_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://americantesol.com/tesol-register.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List онлайн фильмы Tango Secure Gateway CA
... ELSE Create List онлайн фильмы Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-deny-00006
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_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.playgroundsessions.com/about/software-features
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_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.playgroundsessions.com/about/software-features
${stringlist} run keyword if '${systemType}'=='Windows' Create List 明天大涨 Tango Secure Gateway CA
... ELSE Create List 明天大涨 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-deny-00007
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_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://peoplestalkradio.com/forums/register.php
${stringlist} run keyword if '${systemType}'=='Windows' Create List 今天中奖 Tango Secure Gateway CA
... ELSE Create List 今天中奖 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-deny-00008
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00008.bat
... ELSE set variable curl http://www.6renyou.com/user_comment/index
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变拦截策略
${policyDict} Create Dictionary policyId=${intercept_deny_policyId7} policyName=SecurityPolicy-Intercept-deny policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${deny_objectId51}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
Comment 改变阻断策略
${policyDict} Create Dictionary policyId=${deny_policyId7} policyName=Proxy-Policy-deny-00004-1 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"qwertyuiop","code":404,"protocol":"HTTP"} filterList=${deny_objectId52}|TSG_FIELD_HTTP_URL,${deny_objectId53}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00008_1.bat
... ELSE set variable curl http://bbs.tianya.cn/list-16-1.shtml
${stringlist} run keyword if '${systemType}'=='Windows' Create List qwertyuiop
... ELSE Create List qwertyuiop
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-deny-00009
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00009.bat
... ELSE set variable curl http://www.cuctv.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-deny-00010
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00010.bat
... ELSE set variable curl http://www.duckduckmoose.com/
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00010.bat
... ELSE set variable curl http://www.duckduckmoose.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-deny-00011
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00011.bat
... ELSE set variable curl http://tutcandy.com/2009/04/ai-sketch-to-vector-tutorial
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00011.bat
... ELSE set variable curl http://tutcandy.com/2009/04/ai-sketch-to-vector-tutorial
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-deny-00012
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00012.bat
... ELSE set variable curl -kv --cookie "lQfQ_2132_saltkey=t8WY1oPe; lQfQ_2132_lastvisit=1595381790; lQfQ_2132_sid=vqXOg6; lQfQ_2132_lastact=1595385400%09forum.php%09image" --referer 'https://www.baidu.com/' \ https://www.youqulu.com/category/zixun
${stringlist} run keyword if '${systemType}'=='Windows' Create List 123456789 Tango Secure Gateway CA
... ELSE Create List 123456789 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-deny-00013
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00013.bat
... ELSE set variable curl -kv \ https://www.nypl.org/books-music-movies
${stringlist} run keyword if '${systemType}'=='Windows' Create List 一直相信 Tango Secure Gateway CA
... ELSE Create List 一直相信 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00013_1.bat
... ELSE set variable curl -kv https://www.thailand.com.co/category-207-b0.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 一直相信 Tango Secure Gateway CA
... ELSE Create List 一直相信 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00013_2.bat
... ELSE set variable curl -kv \ https://bj.zu.ke.com/zufang
${stringlist} run keyword if '${systemType}'=='Windows' Create List 一直相信 Tango Secure Gateway CA
... ELSE Create List 一直相信 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00013_3.bat
... ELSE set variable curl -kv \ https://nationalbank.kz/?switch=kazakh
${stringlist} run keyword if '${systemType}'=='Windows' Create List 一直相信 Tango Secure Gateway CA
... ELSE Create List 一直相信 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-deny-00014
Comment 防止安全策略互相影响,策略验证时候再打开
${policyDict} Create Dictionary policyId=${intercept_deny_policyId13} policyName=SecurityPolicy-Intercept-deny policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${deny_objectId34}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00014.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=1234567&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection was reset
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变阻断策略
${policyDict} Create Dictionary policyId=${deny_policyId13} policyName=Proxy-Policy-deny-00014-1 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"涨涨涨涨","code":404,"protocol":"HTTP"} filterList=${deny_objectId54}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00014_1.bat
... ELSE set variable curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{"requestbody":"denyTest0014","setcook":"12345678","contenttype": "content-type","responsebody": "Response Body"}" http://open.node.com:180/go
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection was reset
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-deny-00015
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00015.bat
... ELSE set variable curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{"requestbody":"lkjh","setcook":"qeqew","contenttype": "content-type","responsebody": "ASDFG"}" http://open.node.com:180/go
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection was reset
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变阻断策略
${policyDict} Create Dictionary policyId=${deny_policyId14} policyName=Proxy-Policy-deny-00015-1 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"涨涨涨涨","code":404,"protocol":"HTTP"} filterList=${deny_objectId55}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00015_1.bat
... ELSE set variable curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{"requestbody":"lkjh","setcook":"qeqew","contenttype": "content-type","responsebody": "deny015"}" http://open.node.com:180/go
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection was reset
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-deny-00016
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00018.bat
... ELSE set variable curl -kv https://mt.meipai.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用 Tango Secure Gateway CA
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-deny-00017
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00016.bat
... ELSE set variable curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{"requestbody":"mnbv","setcook":"asdf","contenttype": "content-type","responsebody": "adzx"}" -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' http://open.node.com:180/go
${stringlist} run keyword if '${systemType}'=='Windows' Create List 涨涨涨涨
... ELSE Create List 涨涨涨涨
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 拦截策略用完之后置为失效
${policyDict} Create Dictionary policyId=${intercept_deny_policyId13} policyName=SecurityPolicy-Intercept-deny policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${deny_objectId34}|TSG_FIELD_HTTP_HOST isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Proxy-Policy-deny-00018
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00017.bat
... ELSE set variable curl -kv --cookie "test%20cookie=null; timezoneoffset=-480; ASP.NET_SessionId=sta2b3gxpxzqei3by1ka3qsa; visid_incap_1010467=Iu/pLzeoTnGn2VDjWdP9GpoBGF8AAAAAQUIPAAAAAADzSLZtZ1tZ/Rbjfct3Nq69" --referer 'https://www.baidu.com/' \ https://www.umusicpub.com/au/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-deny-00019
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00019.bat
... ELSE set variable curl -kv https://www.cndns.com/cn/sms/index.aspx --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36"
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA Empty reply from server
... ELSE Create List Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}

View File

@@ -1,90 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
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_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Library json
Library DateTime
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${categoriesId} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Deny-Dns-00001
# 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${DNS_VID} appName=dns protocol=dns attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${DNS_VID} appName=dns protocol=dns attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${DNS_VID} appName=dns protocol=dns attributeValue={"string": "hahauawei.org"}
${qname_fqdn_id1} Create Dictionary attributeType=string attributeName=qname appId=${DNS_VID} appName=dns protocol=dns attributeValue={"string": "www.facebook.com"}
${qname_fqdn_id2} Create Dictionary attributeType=string attributeName=qname appId=${DNS_VID} appName=dns protocol=dns attributeValue={"string": "rutube.ru"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string":"${DNS_VID}" }
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "252.252.252.252","port": "443","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${qname_fqdn_id1} ${qname_fqdn_id2} ${app_id} ${ipsource} ${ipdestination} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_dns_policyId}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${deny_dns_objectId} ${deny_dns_policyId} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
${testType} Evaluate type($objectid_verify)
sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
#${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Dns-00002
# 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${DNS_VID} appName=dns protocol=dns attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${DNS_VID} appName=dns protocol=dns attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${DNS_VID} appName=dns protocol=dns attributeValue={"string": "huawei.com"}
${qname_fqdn_id} Create Dictionary attributeType=string attributeName=qname appId=${DNS_VID} appName=dns protocol=dns attributeValue={"string": "www.arctictrucks.ru"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string":"${DNS_VID}" }
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "252.252.252.252","port": "443","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${qname_fqdn_id} ${app_id} ${ipsource} ${ipdestination} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_dns_policyId1}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${deny_dns_objectId1} ${deny_dns_policyId1} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
${testType} Evaluate type($objectid_verify)
sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
#${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true

View File

@@ -1,141 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
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_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Library json
Library DateTime
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Deny-Ftp-00001
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "hahauawei.org"}
${url} Create Dictionary attributeType=string attributeName=url appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "192.168.40.158/123456.txt"}
${Content} Create Dictionary attributeType=string attributeName=content appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "123456789qwertyuiop"}
${Account} Create Dictionary attributeType=string attributeName=account appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "ftpuser"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${FTP_VID}"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${url} ${Content} ${Account} ${app_id} ${ipsource} ${ipdestination} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_ftp_policyId}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${deny_ftp_objectId13} ${deny_ftp_objectId14} ${deny_ftp_objectId15} ${deny_ftp_policyId} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Ftp-00002
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "huawei.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "192.168.40.158/test.txt"}
${Content} Create Dictionary attributeType=string attributeName=content appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "中文test"}
${Account} Create Dictionary attributeType=string attributeName=account appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "ftpuser"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${FTP_VID}"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${url} ${Content} ${Account} ${app_id} ${ipsource} ${ipdestination} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_ftp_policyId1}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${deny_ftp_objectId3} ${deny_ftp_objectId4} ${deny_ftp_objectId5} ${deny_ftp_policyId1} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Ftp-00003
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=ftp protocol=ftp attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=ftp protocol=ftp attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=ftp protocol=ftp attributeValue={"string": "huawei.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "ftp://192.168.40.158/wlcsy.txt"}
${Content} Create Dictionary attributeType=string attributeName=content appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "中文文件内容"}
${Account} Create Dictionary attributeType=string attributeName=account appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "ftpuser"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${FTP_VID}"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${url} ${Content} ${Account} ${app_id} ${ipsource} ${ipdestination} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_ftp_policyId2}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${deny_ftp_objectId6} ${deny_ftp_objectId7} ${deny_ftp_objectId8} ${deny_ftp_policyId2} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Ftp-00004
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=ftp protocol=ftp attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=ftp protocol=ftp attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=ftp protocol=ftp attributeValue={"string": "huawei.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "ftp://192.168.40.158/aewn.txt"}
${Content} Create Dictionary attributeType=string attributeName=content appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "завезенными"}
${Account} Create Dictionary attributeType=string attributeName=account appId=${FTP_VID} appName=ftp protocol=ftp attributeValue={"string": "ftpuser"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${FTP_VID}"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
# 合成attributes字典集
${attributes} Create List ${url} ${Content} ${Account} ${app_id} ${ipsource} ${ipdestination} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_ftp_policyId3}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${deny_ftp_objectId9} ${deny_ftp_objectId10} ${deny_ftp_objectId11} ${deny_ftp_policyId3} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true

View File

@@ -1,436 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
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_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Library json
Library DateTime
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Deny-Http-00001
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.lkong.net"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_http_policyId}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_http_objectId36} ${deny_http_policyId} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Http-00002
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "bellaircraftmuseum.org"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_http_policyId1}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_http_objectId1} ${deny_http_policyId1} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Http-00003
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.icbc.com.cn/"}
${url2} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.ccb.com/cn/home/indexv3.html"}
${url3} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.gotohoroscope.com/daily-horoscope.html"}
${url4} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "government.ru/news/"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url1} ${url2} ${url3} ${url4} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_http_policyId2}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_http_objectId2} ${deny_http_policyId2} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Http-00004
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.tsutmb.ru/sveden"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "afsfssfMozilla/5.0afsfsdafsafs","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_http_policyId3}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_http_objectId37} ${deny_http_objectId38} ${deny_http_policyId3} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Http-00005
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.abchina.com/cn/"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_http_policyId4}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_http_objectId5} ${deny_http_objectId6} ${deny_http_policyId4} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Http-00006
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "egypt.travel/ru"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_http_policyId5}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_http_objectId7} ${deny_http_objectId8} ${deny_http_policyId5} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Http-00007
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.gw.com.cn/download.shtml"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Safari/537.36","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_http_policyId6}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_http_objectId9} ${deny_http_objectId10} ${deny_http_policyId6} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Http-00008
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.cmbchina.com/CmbQuesInfo/index.aspx"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "utf-8aabnna","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_http_policyId7}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_http_objectId11} ${deny_http_objectId39} ${deny_http_policyId7} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Http-00009
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.skycn.com/soft/bangongruanjian.html"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_http_policyId8}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_http_objectId13} ${deny_http_objectId14} ${deny_http_policyId8} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Http-00011
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.finestquotes.com/quotesbyauthors.php"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_http_policyId10}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_http_objectId17} ${deny_http_objectId18} ${deny_http_policyId10} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Http-00015
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${res_body} Create Dictionary attributeType=string attributeName=res_body appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "华彤集团官网"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${res_body} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_http_policyId14}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_http_objectId41} ${deny_http_policyId14} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Http-00017
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "smspunch.net"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "smspunch.net/send-free-sms.aspx"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "_ym_isad=2","district": "Cookie"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "NET_SessionId","district": "Set-Cookie"}
${res_body} Create Dictionary attributeType=string attributeName=res_body appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Cell No"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ck} ${res_hdr_sc} ${res_body} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_http_policyId16}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_http_objectId28} ${deny_http_objectId29} ${deny_http_objectId30}
... ${deny_http_objectId31} ${deny_http_objectId32} ${deny_http_policyId16} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Http-00018
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.hebbank.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"192.168.50.18","port":"100","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_http_policyId17}
# 打印检查结果
${objectid_verify} Set Variable ${deny_http_objectId33}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_http_objectId34} ${deny_http_policyId17} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true

View File

@@ -1,471 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
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_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Library json
Library DateTime
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
SecurityPolicy-Deny-Mail-00001
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hahauawei.org"}
${content_id} Create Dictionary attributeType=string attributeName=content appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "Простопорно"}
${from_id} Create Dictionary attributeType=string attributeName=from appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hebingning2021@163.com"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "${MAIL_VID}"}
# 合成attributes字典集
${attributes} Create List ${content_id} ${from_id} ${app_id} ${ipsource} ${ipdestination} ${subscriberid} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_mail_policyId}
sleep ${policyModifySleepSeconds}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_mail_objectId33} ${deny_mail_policyId} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
#sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Mail-00002
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "huawei.com"}
${att_content_id} Create Dictionary attributeType=string attributeName=att_content appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "姬巍川测试文件内容Простопорно"}
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "BigTitle"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "${MAIL_VID}"}
# 合成attributes字典集
${attributes} Create List ${att_content_id} ${app_id} ${ipsource} ${ipdestination} ${subscriberid} ${subject_id} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_mail_policyId1}
sleep ${policyModifySleepSeconds}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_mail_objectId34} ${deny_mail_policyId1} ${deny_mail_objectId39} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
#sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Mail-00003
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "huawei.com"}
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "ПОРНОВИДЕО"}
${from_id} Create Dictionary attributeType=string attributeName=from appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hebingning2021@163.com"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "${MAIL_VID}"}
# 合成attributes字典集
${attributes} Create List ${subject_id} ${from_id} ${app_id} ${ipsource} ${ipdestination} ${subscriberid} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_mail_policyId2}
sleep ${policyModifySleepSeconds}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_mail_objectId35} ${deny_mail_objectId36} ${deny_mail_policyId2} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
#sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Mail-00004
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "huawei.com"}
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "明天周末"}
${from_id} Create Dictionary attributeType=string attributeName=from appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hebingning2021@163.com"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "${MAIL_VID}"}
# 合成attributes字典集
${attributes} Create List ${subject_id} ${from_id} ${app_id} ${ipsource} ${ipdestination} ${subscriberid} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_mail_policyId3}
sleep ${policyModifySleepSeconds}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_mail_objectId4} ${deny_mail_objectId5} ${deny_mail_policyId3} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
#sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Mail-00005
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hahauawei.org"}
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "1234567890"}
${from_id} Create Dictionary attributeType=string attributeName=from appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hebingning2021@163.com"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "${MAIL_VID}"}
# 合成attributes字典集
${attributes} Create List ${subject_id} ${from_id} ${app_id} ${ipsource} ${ipdestination} ${subscriberid} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_mail_policyId4}
sleep ${policyModifySleepSeconds}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_mail_objectId6} ${deny_mail_objectId7} ${deny_mail_policyId4} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
#sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Mail-00006
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "huawei.com"}
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "afternoon"}
${from_id} Create Dictionary attributeType=string attributeName=from appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hebingning2021@163.com"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "${MAIL_VID}"}
# 合成attributes字典集
${attributes} Create List ${subject_id} ${from_id} ${app_id} ${ipsource} ${ipdestination} ${subscriberid} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_mail_policyId5}
sleep ${policyModifySleepSeconds}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_mail_objectId8} ${deny_mail_objectId9} ${deny_mail_policyId5} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
#sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Mail-00007
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "huawei.com"}
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "Смотретьфильмыонлай"}
${to_id} Create Dictionary attributeType=string attributeName=to appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hebingning@geedgenetworks.com"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "${MAIL_VID}"}
# 合成attributes字典集
${attributes} Create List ${subject_id} ${to_id} ${app_id} ${ipsource} ${ipdestination} ${subscriberid} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_mail_policyId6}
sleep ${policyModifySleepSeconds}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_mail_objectId10} ${deny_mail_objectId11} ${deny_mail_policyId6} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
#sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Mail-00008
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "huawei.com"}
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "zxcvbnm"}
${to_id} Create Dictionary attributeType=string attributeName=to appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hebingning@geedgenetworks.com"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "${MAIL_VID}"}
# 合成attributes字典集
${attributes} Create List ${subject_id} ${to_id} ${app_id} ${ipsource} ${ipdestination} ${subscriberid} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_mail_policyId7}
sleep ${policyModifySleepSeconds}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_mail_objectId12} ${deny_mail_objectId13} ${deny_mail_policyId7} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
#sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Mail-00009
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "huawei.com"}
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "又是新的一天"}
${to_id} Create Dictionary attributeType=string attributeName=to appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hebingning@geedgenetworks.com"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "${MAIL_VID}"}
# 合成attributes字典集
${attributes} Create List ${subject_id} ${to_id} ${app_id} ${ipsource} ${ipdestination} ${subscriberid} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_mail_policyId8}
sleep ${policyModifySleepSeconds}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_mail_objectId14} ${deny_mail_objectId15} ${deny_mail_policyId8} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
#sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Mail-00010
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hahauawei.org"}
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "tomorrow"}
${to_id} Create Dictionary attributeType=string attributeName=to appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hebingning@geedgenetworks.com"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "${MAIL_VID}"}
# 合成attributes字典集
${attributes} Create List ${subject_id} ${to_id} ${app_id} ${ipsource} ${ipdestination} ${subscriberid} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_mail_policyId9}
sleep ${policyModifySleepSeconds}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_mail_objectId16} ${deny_mail_objectId17} ${deny_mail_policyId9} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
#sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Mail-00011
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "huawei.com"}
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "邮件发送失败"}
${account_id} Create Dictionary attributeType=string attributeName=account appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hebingning2021@163.com"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "${MAIL_VID}"}
# 合成attributes字典集
${attributes} Create List ${subject_id} ${account_id} ${app_id} ${ipsource} ${ipdestination} ${subscriberid} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_mail_policyId10}
sleep ${policyModifySleepSeconds}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_mail_objectId18} ${deny_mail_objectId19} ${deny_mail_policyId10} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
#sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Mail-00012
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "huawei.com"}
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "Онлайнфильмывхоро"}
${account_id} Create Dictionary attributeType=string attributeName=account appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hebingning2021@163.com"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "${MAIL_VID}"}
# 合成attributes字典集
${attributes} Create List ${subject_id} ${account_id} ${app_id} ${ipsource} ${ipdestination} ${subscriberid} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_mail_policyId11}
sleep ${policyModifySleepSeconds}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_mail_objectId20} ${deny_mail_objectId21} ${deny_mail_policyId11}
#sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Mail-00013
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "huawei.com"}
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "asdfghjkl"}
${account_id} Create Dictionary attributeType=string attributeName=account appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hebingning2021@163.com"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "${MAIL_VID}"}
# 合成attributes字典集
${attributes} Create List ${subject_id} ${account_id} ${app_id} ${ipsource} ${ipdestination} ${subscriberid} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_mail_policyId12}
sleep ${policyModifySleepSeconds}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_mail_objectId22} ${deny_mail_objectId23} ${deny_mail_policyId12} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
#sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Mail-00014
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hahauawei.org"}
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "马上就要下班了"}
${account_id} Create Dictionary attributeType=string attributeName=account appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hebingning2021@163.com"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "${MAIL_VID}"}
# 合成attributes字典集
${attributes} Create List ${subject_id} ${account_id} ${app_id} ${ipsource} ${ipdestination} ${subscriberid} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_mail_policyId13}
sleep ${policyModifySleepSeconds}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_mail_objectId24} ${deny_mail_objectId25} ${deny_mail_policyId13} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
#sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Mail-00015
# # 新增策略验证
# 创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "huawei.com"}
${subject_id} Create Dictionary attributeType=string attributeName=subject appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "人生路远及时行乐"}
${content_id} Create Dictionary attributeType=string attributeName=content appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "good"}
${att_content_id} Create Dictionary attributeType=string attributeName=att_content appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "Простопорно"}
${account_id} Create Dictionary attributeType=string attributeName=account appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hebingning2021@163.com"}
${from_id} Create Dictionary attributeType=string attributeName=from appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hebingning2021@163.com"}
${to_id} Create Dictionary attributeType=string attributeName=to appId=${MAIL_VID} appName=mail protocol=mail attributeValue={"string": "hebingning@geedgenetworks.com"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
${app_id} Create Dictionary attributeType=string attributeName=app_id protocol=mail attributeValue={"string": "${MAIL_VID}"}
# 合成attributes字典集
${attributes} Create List ${subject_id} ${content_id} ${att_content_id} ${from_id} ${to_id} ${app_id} ${ipsource} ${ipdestination}
... ${subscriberid} ${account_id} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_mail_policyId14}
sleep ${policyModifySleepSeconds}
# 打印检查结果
# 将 策略id 加入对象 id
${objectid_verify} set variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_mail_objectId26} ${deny_mail_objectId27} ${deny_mail_objectId28} ${deny_mail_objectId29} ${deny_mail_objectId30}
... ${deny_mail_objectId31} ${deny_mail_policyId14} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
#sleep 5
# 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} true

View File

@@ -1,150 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
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_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Library json
Library DateTime
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
SecurityPolicy-Deny-Ssl-00001
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "hahauawei.org"}
${sni} Create Dictionary attributeType=string attributeName=sni appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "www.cxwl.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${SSL_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${sni} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_ssl_policyId}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_ssl_objectId4} ${deny_ssl_policyId} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Ssl-00002
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "huawei.com"}
${sni1} Create Dictionary attributeType=string attributeName=sni appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "amesweb.info"}
${sni2} Create Dictionary attributeType=string attributeName=sni appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "rentar.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${SSL_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${sni2} ${sni1} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_ssl_policyId1}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_ssl_objectId1} ${deny_ssl_policyId1} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Ssl-00003
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "huawei.com"}
${sni1} Create Dictionary attributeType=string attributeName=sni appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "austinama.org"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${SSL_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${sni1} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_ssl_policyId2}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_ssl_objectId2} ${deny_ssl_policyId2} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Deny-Ssl-00004
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "huawei.com"}
${sni} Create Dictionary attributeType=string attributeName=sni appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "www.prlib.ru"}
${cn} Create Dictionary attributeType=string attributeName=cn appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "www.prlib.ru"}
${san} Create Dictionary attributeType=string attributeName=san appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "www.prlib.ru"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${SSL_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${sni} ${cn} ${san} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_ssl_policyId3}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_ssl_objectId3} ${deny_ssl_objectId6} ${deny_ssl_policyId3} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true

View File

@@ -1,556 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
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_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Library json
Library DateTime
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
Proxy-Policy-deny-00002
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.youku.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_policyId1}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId1} ${deny_policyId1} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-deny-00003
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.wimdu.de"}
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "creativetravelgroup.com"}
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.hinabian.com"}
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.smithsonianjourneys.org"}
${url1} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.wimdu.de/"}
${url2} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "creativetravelgroup.com/"}
${url3} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.hinabian.com/"}
${url4} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.smithsonianjourneys.org/"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn1} ${fqdn2} ${fqdn3} ${fqdn4}
... ${url1} ${url2} ${url3} ${url4} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_policyId2}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId2} ${deny_objectId3} ${deny_policyId2} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-deny-00004
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "bbs.nga.cn"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "bbs.nga.cn/"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "afsfssfMozilla/5.0afsfsdafsafs","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${req_hdr_ua} ${fqdn} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_policyId3}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId48} ${deny_objectId49} ${deny_objectId50} ${deny_policyId3} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-deny-00005
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "americantesol.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "americantesol.com/tesol-register.html"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_policyId4}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId7} ${deny_objectId8} ${deny_objectId9} ${deny_policyId4} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-deny-00006
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.playgroundsessions.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.playgroundsessions.com/about/software-features"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "AppleWebKit","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_policyId5}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId10} ${deny_objectId11} ${deny_objectId12} ${deny_policyId5} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-deny-00007
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "peoplestalkradio.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "peoplestalkradio.com/forums/register.php"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahahahsfeSafari/537.36","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_policyId6}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId13} ${deny_objectId14} ${deny_objectId15} ${deny_policyId6} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-deny-00008
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "bbs.tianya.cn"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "bbs.tianya.cn/list-16-1.shtml"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_policyId7}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId51} ${deny_objectId52} ${deny_objectId53} ${deny_policyId7} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-deny-00009
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.cuctv.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.cuctv.com/"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html; charset=utf-8","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_policyId8}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId20} ${deny_objectId21} ${deny_policyId8} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-deny-000010
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.duckduckmoose.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.duckduckmoose.com/"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_policyId9}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId22} ${deny_objectId23} ${deny_objectId24} ${deny_policyId9} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-deny-000011
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "tutcandy.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "tutcandy.com/2009/04/ai-sketch-to-vector-tutorial"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_policyId10}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId25} ${deny_objectId26} ${deny_objectId27} ${deny_policyId10} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-deny-000012
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.youqulu.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.youqulu.com/category/zixun"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "saltkeyfafghlh","district": "Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ck} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_policyId11}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId28} ${deny_objectId29} ${deny_objectId30} ${deny_policyId11} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-deny-000013
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.nypl.org"}
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.thailand.com.co"}
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "bj.zu.ke.com"}
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "nationalbank.kz"}
${url1} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.nypl.org/books-music-movies"}
${url2} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.thailand.com.co/category-207-b0.html"}
${url3} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "bj.zu.ke.com/zufang"}
${url4} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "nationalbank.kz/?switch=kazakh"}
${res_hdr_sc1} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "incap_sesafss23456","district": "Set-Cookie"}
${res_hdr_sc2} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1111ssssMax-Age=604800","district": "Set-Cookie"}
${res_hdr_sc3} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "domain=.ke.com","district": "Set-Cookie"}
${res_hdr_sc4} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "irkzadmin_sessionfsf22345","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn1} ${fqdn2} ${fqdn3} ${fqdn4} ${url1} ${url2} ${url3} ${url4}
... ${res_hdr_sc1} ${res_hdr_sc2} ${res_hdr_sc3} ${res_hdr_sc4} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId31} ${deny_objectId32} ${deny_objectId46} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-deny-000014
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "open.node.com:180"}
${req_body} Create Dictionary attributeType=string attributeName=req_body appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "ProxydenyTest001402"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${req_body} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_policyId13}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId34} ${deny_objectId54} ${deny_policyId13} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-deny-000015
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${res_body} Create Dictionary attributeType=string attributeName=res_body appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Proxydeny001502"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${res_body} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_policyId14}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId55} ${deny_policyId14} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-deny-000016
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "mt.meipai.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "mt.meipai.com/"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_policyId17}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId58} ${deny_objectId47} ${deny_policyId17} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-deny-000018
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.umusicpub.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.umusicpub.com/au/"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "timezoneoffset","district": "Cookie"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Domain=.umusicpub.com","district": "Set-Cookie"}
${res_body} Create Dictionary attributeType=string attributeName=res_body appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "NOFOLLOW"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ck} ${res_hdr_sc} ${res_body} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${deny_policyId16}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId41} ${deny_objectId42} ${deny_objectId43} ${deny_objectId44} ${deny_objectId45} ${deny_policyId16} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true

View File

@@ -1,239 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp proxy_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
Proxy-Policy-hijack-00001
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00001.bat
... ELSE set variable curl -kv https://vator.tv/news
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00001.bat
... ELSE set variable curl -kv https://vator.tv/news
${stringlist} run keyword if '${systemType}'=='Windows' Create List 6b72:f91d:6f81:bfcd:5b0f:e81d:f827:e075 Tango Secure Gateway CA
... ELSE Create List 6b72:f91d:6f81:bfcd:5b0f:e81d:f827:e075 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变拦截策略
${policyDict} Create Dictionary policyId=${intercept_hijack_policyId} source=${hijack_objectId42}|TSG_SECURITY_SOURCE_LOCATION policyName=SecurityPolicy-Intercept-hijack-1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${hijack_objectId43}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
Comment 改变Hijack策略
${policyDict} Create Dictionary policyId=${hijack_policyId} source=${hijack_objectId42}|TSG_SECURITY_SOURCE_LOCATION policyName=Proxy-Policy-hijack-00001-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${hijack_profileId},"protocol":"HTTP"} filterList=${hijack_objectId43}|TSG_FIELD_HTTP_HOST,${hijack_objectId39}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00001.bat
... ELSE set variable curl -kv https://vator.tv/news
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00001.bat
... ELSE set variable curl -kv https://vator.tv/news
${stringlist} run keyword if '${systemType}'=='Windows' Create List 6b72:f91d:6f81:bfcd:5b0f:e81d:f827:e075 Tango Secure Gateway CA
... ELSE Create List 6b72:f91d:6f81:bfcd:5b0f:e81d:f827:e075 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 失效拦截策略
${policyDict} Create Dictionary policyId=${intercept_hijack_policyId} source=${hijack_objectId42}|TSG_SECURITY_SOURCE_LOCATION policyName=SecurityPolicy-Intercept-hijack-1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${hijack_objectId43}|TSG_FIELD_SSL_SNI isValid=${0} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 失效hijack策略
${policyDict} Create Dictionary policyId=${hijack_policyId} source=${hijack_objectId42}|TSG_SECURITY_SOURCE_LOCATION policyName=Proxy-Policy-hijack-00001-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${hijack_profileId},"protocol":"HTTP"} filterList=${hijack_objectId43}|TSG_FIELD_HTTP_HOST,${hijack_objectId39}|TSG_FIELD_HTTP_URL isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Proxy-Policy-hijack-00002
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00002.bat
... ELSE set variable curl -kv https://www.uqur.cn/index_0.shtml
${stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA
... ELSE Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00003
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00003.bat
... ELSE set variable curl -kv https://www.lexus.ru/
${stringlist} run keyword if '${systemType}'=='Windows' Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
... ELSE Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00003_1.bat
... ELSE set variable curl -kv https://oktrucking.org/
${stringlist} run keyword if '${systemType}'=='Windows' Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
... ELSE Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00003_2.bat
... ELSE set variable curl -kv https://www.federalsignal.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
... ELSE Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00003_3.bat
... ELSE set variable curl -kv https://peasedev.org/
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00003_3.bat
... ELSE set variable curl -kv https://peasedev.org/
${stringlist} run keyword if '${systemType}'=='Windows' Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
... ELSE Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00004
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.huoshan.com/greenlive/union_hall/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA
... ELSE Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变重Hijack策略
${policyDict} Create Dictionary policyId=${hijack_policyId3} policyName=Proxy-Policy-hijack-00004-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${hijack_profileId3},"protocol":"HTTP"} filterList=${hijack_objectId44}|TSG_FIELD_HTTP_URL,${hijack_objectId45}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.huoshan.com/greenlive/union_hall/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA
... ELSE Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00005
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00005.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_hijack_00005_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List bFiles-test-5.png Tango Secure Gateway CA
... ELSE Create List bFiles-test-5.png Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00006
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_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.dcdapp.com/?zt=dongchediapp
${stringlist} run keyword if '${systemType}'=='Windows' Create List test-4.jpeg Tango Secure Gateway CA
... ELSE Create List test-4.jpeg Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00007
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00007.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_hijack_00007_L.bat
${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
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00008
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00008.bat
... ELSE set variable curl http://www.mafengwo.cn/mdd/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动
... ELSE Create List 控制小蛇在地图范围内移动
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变Hijack策略
${policyDict} Create Dictionary policyId=${hijack_policyId7} policyName=Proxy-Policy-hijack-00008-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${hijack_profileId7},"protocol":"HTTP"} filterList=${hijack_objectId17}|TSG_FIELD_HTTP_URL,${hijack_objectId46}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00008.bat
... ELSE set variable curl http://www.mafengwo.cn/mdd/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动
... ELSE Create List 控制小蛇在地图范围内移动
Proxy-Policy-hijack-00009
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00009.bat
... ELSE set variable curl -kv http://quote.hexun.com/default.htm#forex
${stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动
... ELSE Create List 控制小蛇在地图范围内移动
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 关闭安全策略
${policyDict} Create Dictionary policyId=${intercept_hijack_policyId8} policyName=SecurityPolicy-Intercept-hijack policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${hijack_objectId19}|TSG_FIELD_HTTP_HOST isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Proxy-Policy-hijack-00010
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00010.bat
... ELSE set variable curl http://chaxun.1616.net/jiemeng.htm
${stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动
... ELSE Create List 控制小蛇在地图范围内移动
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00011
Comment 做策略验证时再开启拦截策略因为与SecurityPolicy-Monitor-Http-00017可组合验证条件优先级
${policyDict} Create Dictionary policyId=${intercept_hijack_policyId10} policyName=SecurityPolicy-Intercept-hijack-011 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${hijack_objectId25}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00011.bat
... ELSE set variable curl http://www.airwargame.com/eng/start/
${stringlist} run keyword if '${systemType}'=='Windows' Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac
... ELSE Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 昨晚策略验证关闭
${policyDict} Create Dictionary policyId=${intercept_hijack_policyId10} policyName=SecurityPolicy-Intercept-hijack-011 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${hijack_objectId25}|TSG_FIELD_HTTP_HOST isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Proxy-Policy-hijack-00012
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00012.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_hijack_00012_L.bat
sleep 3
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00012.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_hijack_00012_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List bFiles-test-5.png Tango Secure Gateway CA
... ELSE Create List bFiles-test-5.png Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00013
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00013.bat
... ELSE set variable curl -kv https://nsscreencast.com/episodes
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00013.bat
... ELSE set variable curl -kv https://nsscreencast.com/episodes
${stringlist} run keyword if '${systemType}'=='Windows' Create List test-4.jpeg Tango Secure Gateway CA
... ELSE Create List test-4.jpeg Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00013_1.bat
... ELSE set variable curl -kv https://www.edreams.net/merch/trends/
${stringlist} run keyword if '${systemType}'=='Windows' Create List test-4.jpeg Tango Secure Gateway CA
... ELSE Create List test-4.jpeg Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00013_2.bat
... ELSE set variable curl -kv https://boutiquehotel.me/paris/
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00013_2.bat
... ELSE set variable curl -kv https://boutiquehotel.me/paris/
${stringlist} run keyword if '${systemType}'=='Windows' Create List test-4.jpeg Tango Secure Gateway CA
... ELSE Create List test-4.jpeg Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00013_3.bat
... ELSE set variable curl -kv https://www.united.com/zh-hans/cn
${stringlist} run keyword if '${systemType}'=='Windows' Create List test-4.jpeg Tango Secure Gateway CA
... ELSE Create List test-4.jpeg Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00014
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00014.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_hijack_00014_L.bat
${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
${rescode} SystemCommands ${commandstr} ${stringlist}
# _ym_uid=1618469095499323558; _ym_d=1618469095; _ga=GA1.2.408342155.1618469095; _gid=GA1.2.1120402817.1618469095; _ym_isad=2; _ym_visorc=b; XSRF-TOKEN=eyJpdiI6Iks4WHdkV2JKUDVtR1g1Q0paaktJdmc9PSIsInZhbHVlIjoiOUY0Rys5cWVnWk9JbWM1NVpCU3FPTFoyWVQwbE1wSXJraEhSMDFaTm9VVkdrWHQ4XC96VWVvUTY5WmFVZG1XeU9PYVJrcGFLWEFcL0lxSGpCQytrcHFtaGFWcUZlOTQ1cUVIZTlyUmlabU5lOVpuRGhQaHM0UjU3UTZSV2EwRENVRSIsIm1hYyI6ImM0ZjUwN2NlYTExYmViZjljMjBiZTNlZjlhYjI5ZDA4YWI5NTE5ZTNhYWMyMDU3MDViNjM0MWMxYTA1ZmY4MzQifQ%3D%3D; megaserver2_session=eyJpdiI6IkRUUnRwb2c1WXd0TDBXeWdUeVhOdlE9PSIsInZhbHVlIjoieHVsZUhNVkUzbmZmaFB5bVRTNlhVUG0rcWlLZEk0YTVLXC9sQ09BK0xwSGxkQ2JcL2I1dVZKWjBIeG9JWnRGYTZoaWRNeGNwUExWT3VOaE9wXC9wK1krZ1c3bEtUNCtITCt3a1NQOVppMEpIdFlDbitxU3IwU2szeXJcL2tHUU92bjBxIiwibWFjIjoiNmNhOTIwZTZmMmEzNGIwNmYxOGJhYjcxMTFkMjBmMzk2OTgxZmJiMmVhNzJlMDJhOTVkYzA4MWIzM2ViMjY1NSJ9; __gads=ID=3966e5fd6a75b4f6-228b6eea6ac70067:T=1618469109:S=ALNI_Ma9PG_KvtVsBcIaQyD2jO9gO2UBSQ
Proxy-Policy-hijack-00015
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00015.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://tengrinews.kz/
${stringlist} run keyword if '${systemType}'=='Windows' Create List bFiles-test-5.png Tango Secure Gateway CA
... ELSE Create List bFiles-test-5.png Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}

View File

@@ -1,440 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
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_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Library json
Library DateTime
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
Proxy-Policy-hijack-00002
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.uqur.cn"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.uqur.cn/index_0.shtml"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${hijack_policyId1}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId1} ${hijack_objectId40} ${hijack_policyId1} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-hijack-00003
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.lexus.ru"}
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "oktrucking.org"}
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.federalsignal.com"}
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "peasedev.org"}
${url1} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.lexus.ru/"}
${url2} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "oktrucking.org/"}
${url3} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.federalsignal.com/"}
${url4} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "peasedev.org/"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn1} ${fqdn2} ${fqdn3} ${fqdn4} ${url1}
... ${url2} ${url3} ${url4} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${hijack_policyId2}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId2} ${hijack_objectId3} ${hijack_policyId2} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-hijack-00004
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.huoshan.com/greenlive/union_hall/"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "afsfssfMozilla/5.0afsfsdafsafs","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${hijack_policyId3}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId44} ${hijack_objectId45} ${hijack_policyId3} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-hijack-00005
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.ixigua.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.ixigua.com/channel/dianying/"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${hijack_policyId4}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId7} ${hijack_objectId8} ${hijack_objectId9} ${hijack_policyId4} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-hijack-00006
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.dcdapp.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.dcdapp.com/?zt=dongchediapp"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "AppleWebKit","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${hijack_policyId5}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId10} ${hijack_objectId11} ${hijack_objectId12} ${hijack_policyId5} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-hijack-00007
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.gogokid.com.cn"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.gogokid.com.cn/teacher"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahahahsfeSafari/537.36","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${hijack_policyId6}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId13} ${hijack_objectId14} ${hijack_objectId15} ${hijack_policyId6} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-hijack-00008
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.mafengwo.cn/mdd/"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "utf-8aabnna","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${hijack_policyId7}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId17} ${hijack_objectId46} ${hijack_policyId7} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-hijack-00009
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "quote.hexun.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "quote.hexun.com/default.htm#forex"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${hijack_policyId8}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId19} ${hijack_objectId20} ${hijack_objectId21} ${hijack_policyId8} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-hijack-000010
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "chaxun.1616.net"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "chaxun.1616.net/jiemeng.htm"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${hijack_policyId9}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId22} ${hijack_objectId23} ${hijack_objectId24} ${hijack_policyId9} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-hijack-000012
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.reval.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.reval.com/corporates/"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "saltkeyfafghlh","district": "Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ck} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${hijack_policyId11}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId28} ${hijack_objectId29} ${hijack_objectId30} ${hijack_policyId11} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-hijack-000013
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "nsscreencast.com"}
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.edreams.net"}
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "boutiquehotel.me"}
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.united.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "nsscreencast.com/episodes"}
${url2} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.edreams.net/merch/trends/"}
${url3} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "boutiquehotel.me/paris/"}
${url4} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.united.com/zh-hans/cn"}
${res_hdr_sc1} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "_nsscreencast_session_afswrew3321","district": "Set-Cookie"}
${res_hdr_sc2} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "123131afsfSecure; SameSite=None","district": "Set-Cookie"}
${res_hdr_sc3} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "232456Domain=.boutiquehotel.meafsfsf","district": "Set-Cookie"}
${res_hdr_sc4} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "HOME1JSESSIONIDafsfsg","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn1} ${fqdn2} ${fqdn3} ${fqdn4} ${url1} ${url2} ${url3} ${url4}
... ${res_hdr_sc1} ${res_hdr_sc2} ${res_hdr_sc3} ${res_hdr_sc4} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${hijack_policyId12}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId31} ${hijack_objectId32} ${hijack_objectId41} ${hijack_policyId12} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-hijack-000014
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.travelzoo.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.travelzoo.com/cn/collections/hotels/ihg-group-meta/"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "charset=text","district": "Content-Type"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Mozilla/5.0fsfwhh","district": "User-Agent"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "__stripe_sidafdsvxvx","district": "Cookie"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "domain=travelzoo.com","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ck} ${res_hdr_sc} ${res_hdr_ct} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${hijack_policyId13}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId33} ${hijack_objectId34} ${hijack_objectId35} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
... ${hijack_objectId36} ${hijack_objectId37} ${hijack_objectId38} ${hijack_policyId13}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true

View File

@@ -1,179 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp proxy_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
Proxy-Policy-insert-00001
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00001.bat
... ELSE set variable curl -kv https://www.costcotravel.com/Vacation-Packages
${stringlist} run keyword if '${systemType}'=='Windows' Create List X-TG-Construct-By: tfe Tango Secure Gateway CA
... ELSE Create List X-TG-Construct-By: tfe Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变拦截策略
${policyDict} Create Dictionary policyId=${intercept_insert_policyId} source=${insert_objectId41}|TSG_SECURITY_SOURCE_LOCATION policyName=SecurityPolicy-Intercept-insert-1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${insert_objectId42}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 改变Insert策略
${policyDict} Create Dictionary policyId=${insert_policyId} source=${insert_objectId41}|TSG_SECURITY_SOURCE_LOCATION policyName=Proxy-Policy-insert-00001-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${insert_profileId},"protocol":"HTTP"} filterList=${insert_objectId42}|TSG_FIELD_HTTP_HOST,${insert_objectId39}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00001.bat
... ELSE set variable curl -kv https://www.costcotravel.com/Vacation-Packages
${stringlist} run keyword if '${systemType}'=='Windows' Create List X-TG-Construct-By: tfe Tango Secure Gateway CA
... ELSE Create List X-TG-Construct-By: tfe Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 失效拦截策略
${policyDict} Create Dictionary policyId=${intercept_insert_policyId} source=${insert_objectId41}|TSG_SECURITY_SOURCE_LOCATION policyName=SecurityPolicy-Intercept-insert-1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${insert_objectId42}|TSG_FIELD_SSL_SNI isValid=${0} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 失效Insert策略
${policyDict} Create Dictionary policyId=${insert_policyId} source=${insert_objectId41}|TSG_SECURITY_SOURCE_LOCATION policyName=Proxy-Policy-insert-00001-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${insert_profileId},"protocol":"HTTP"} filterList=${insert_objectId42}|TSG_FIELD_HTTP_HOST,${insert_objectId39}|TSG_FIELD_HTTP_URL isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Proxy-Policy-insert-00002
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00002.bat
... ELSE set variable curl -kv https://www.meilleurmobile.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List alert Tango Secure Gateway CA
... ELSE Create List alert Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-insert-00003
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00003.bat
... ELSE set variable curl -kv https://scottsdalepublicart.org/
${stringlist} run keyword if '${systemType}'=='Windows' Create List alert Tango Secure Gateway CA
... ELSE Create List alert Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00003_1.bat
... ELSE set variable curl -kv https://www.troop508.org/
${stringlist} run keyword if '${systemType}'=='Windows' Create List alert Tango Secure Gateway CA
... ELSE Create List Troop Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00003_2.bat
... ELSE set variable curl -kv https://dreamdayoncapecod.wordpress.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List alert Tango Secure Gateway CA
... ELSE Create List alert Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00003_3.bat
... ELSE set variable curl -kv https://www.doctorpoo.net/
${stringlist} run keyword if '${systemType}'=='Windows' Create List alert Tango Secure Gateway CA
... ELSE Create List alert Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-insert-00004
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.viator.com/login?login_redirect=%2Faccount%2Fbookings
${stringlist} run keyword if '${systemType}'=='Windows' Create List select_language Tango Secure Gateway CA
... ELSE Create List select_language Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变Insert策略
${policyDict} Create Dictionary policyId=${insert_policyId3} policyName=Proxy-Policy-insert-00004-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${insert_profileId3},"protocol":"HTTP"} filterList=${insert_objectId43}|TSG_FIELD_HTTP_URL,${insert_objectId44}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.viator.com/login?login_redirect=%2Faccount%2Fbookings
${stringlist} run keyword if '${systemType}'=='Windows' Create List select_language Tango Secure Gateway CA
... ELSE Create List select_language Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-insert-00005
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00005.bat
... ELSE set variable curl -kv -L --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://matadornetwork.com/destinations/north-america/united-states/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Roboto Tango Secure Gateway CA
... ELSE Create List Roboto Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-insert-00006
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_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.farecompare.com/hotels/
${stringlist} run keyword if '${systemType}'=='Windows' Create List farecompare Tango Secure Gateway CA
... ELSE Create List farecompare Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-insert-00007
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_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.tripit.com/web
${stringlist} run keyword if '${systemType}'=='Windows' Create List Supported Booking Tango Secure Gateway CA
... ELSE Create List Supported Booking Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-insert-00008
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00008.bat
... ELSE set variable curl -kv http://www.waikikibeachwalk.com/Shops.htm
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00008.bat
... ELSE set variable curl -kv http://www.waikikibeachwalk.com/Shops.htm
${stringlist} run keyword if '${systemType}'=='Windows' Create List alert
... ELSE Create List alert
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变Insert策略
${policyDict} Create Dictionary policyId=${insert_policyId7} policyName=Proxy-Policy-insert-00008-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"insert","insert_profile":${insert_profileId7},"protocol":"HTTP"} filterList=${insert_objectId17}|TSG_FIELD_HTTP_URL,${insert_objectId45}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00008.bat
... ELSE set variable curl -kv http://www.waikikibeachwalk.com/Shops.htm
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00008.bat
... ELSE set variable curl -kv http://www.waikikibeachwalk.com/Shops.htm
${stringlist} run keyword if '${systemType}'=='Windows' Create List alert
... ELSE Create List alert
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-insert-00009
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00009.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_insert_00009_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List X-TG-Construct-By: tfe
... ELSE Create List X-TG-Construct-By: tfe
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-insert-00010
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00010.bat
... ELSE set variable ${curlbatpath}/command/ProxyPolicy_insert_00010_L.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List tfe/4.5.01-91facad
... ELSE Create List tfe/4.3.30
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-insert-00011
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00011.bat
... ELSE set variable curl -kv http://otc.newone.com.cn/cwyw
${stringlist} run keyword if '${systemType}'=='Windows' Create List X-TG-Construct-By: tfe
... ELSE Create List X-TG-Construct-By: tfe
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-insert-00012
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_00012.bat
... ELSE set variable curl -kv --cookie "lQfQ_2132_saltkey=t8WY1oPe; lQfQ_2132_lastvisit=1595381790; lQfQ_2132_sid=vqXOg6; lQfQ_2132_lastact=1595385400%09forum.php%09image" --referer 'https://www.baidu.com/' \ https://petapixel.com/topic/equipment/
${stringlist} run keyword if '${systemType}'=='Windows' Create List petapixel Tango Secure Gateway CA
... ELSE Create List petapixel Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-insert-00013
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_insert_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.intervalworld.com/web/my/home
${stringlist} run keyword if '${systemType}'=='Windows' Create List alert Tango Secure Gateway CA
... ELSE Create List alert Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}

View File

@@ -1,70 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp security_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
SecurityPolicy-Intercept-Http-00001
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_HTTP_00001.bat
... ELSE set variable curl http://www.yumi.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 玉米
... ELSE Create List 玉米
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 修改policy的source
${policyDict} Create Dictionary policyId=${intercept_http_policyId} policyName=SecurityPolicy-Intercept-Http-00001_1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${intercept_http_objectId1}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID} source=${intercept_http_objectId}|TSG_SECURITY_SOURCE_LOCATION
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_HTTP_00001.bat
... ELSE set variable curl http://www.yumi.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 玉米
... ELSE Create List 玉米
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Intercept-Http-00002
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_HTTP_00002.bat
... ELSE set variable curl http://mbzponton.org/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Mercedes
... ELSE Create List Mercedes
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Intercept-Http-00003
Comment 防止安全策略互相影响,策略验证时候再打开
${policyDict} Create Dictionary policyId=${intercept_http_policyId2} policyName=SecurityPolicy-Intercept-Http-00003-1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} destination=${intercept_http_objectId3}|TSG_SECURITY_DESTINATION_ADDR filterList=${intercept_http_objectId2}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_HTTP_00003.bat
... ELSE set variable curl http://open.node.com:180/
${stringlist} run keyword if '${systemType}'=='Windows' Create List POST
... ELSE Create List POST
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 为保证之后使用open.node.com的Monitor用例正常生效做完验证后失效该策略
${policyDict} Create Dictionary policyId=${intercept_http_policyId2} policyName=SecurityPolicy-Intercept-Http-00003-1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} destination=${intercept_http_objectId3}|TSG_SECURITY_DESTINATION_ADDR filterList=${intercept_http_objectId2}|TSG_FIELD_HTTP_HOST isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
SecurityPolicy-Intercept-Http-00004
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_HTTP_00004.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Intercept_HTTP_00004.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 纵横中文网
... ELSE Create List 纵横中文网
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-Http-00004-1 policyId=${intercept_http_policyId3} policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${intercept_http_objectId5}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_HTTP_00004.bat
... ELSE set variable ${curlbatpath}/command/SecurityPolicy_Intercept_HTTP_00004.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List 纵横中文网
... ELSE Create List 纵横中文网
${rescode} SystemCommands ${commandstr} ${stringlist}

View File

@@ -1,62 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp security_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
SecurityPolicy-Intercept-Ssl-00001
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_SSL_00001.bat
... ELSE set variable curl -kv https://www.reviewpro.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List reviewpro Tango Secure Gateway CA
... ELSE Create List reviewpro Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变安全策略
${policyDict} Create Dictionary policyId=${intercept_ssl_policyId} policyName=SecurityPolicy-Intercept-Ssl-00001_1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} source=${intercept_ssl_objectId1}|TSG_SECURITY_SOURCE_LOCATION filterList=${intercept_ssl_objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_SSL_00001.bat
... ELSE set variable curl -kv https://www.reviewpro.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List reviewpro Tango Secure Gateway CA
... ELSE Create List reviewpro Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 范围性质的ip做完策略验证后置为失效防止影响其他策略
${policyDict} Create Dictionary policyId=${intercept_ssl_policyId} policyName=SecurityPolicy-Intercept-Ssl-00001_1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} source=${intercept_ssl_objectId1}|TSG_SECURITY_SOURCE_LOCATION filterList=${intercept_ssl_objectId}|TSG_FIELD_SSL_SNI isValid=${0} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
SecurityPolicy-Intercept-Ssl-00002
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_SSL_00002.bat
... ELSE set variable curl -kv https://fenopy.se/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Fenopy Tango Secure Gateway CA
... ELSE Create List Fenopy Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Intercept-Http-00003
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_SSL_00002_2.bat
... ELSE set variable curl -kv https://www.xs8.cn/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 言情小说吧 CA TRUST
... ELSE Create List Book
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变安全策略
${policyDict} Create Dictionary policyId=${intercept_ssl_policyId2} policyName=SecurityPolicy-Intercept-Ssl-00003_1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":87,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${intercept_ssl_objectId4}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_SSL_00002_2.bat
... ELSE set variable curl -kv https://www.xs8.cn/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 言情小说吧 CA TRUST
SecurityPolicy-Intercept-Ssl-00004
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_SSL_00002_3.bat
... ELSE set variable curl -kv https://worldweapon.info/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Энциклопедия CA TRUST
... ELSE Create List Camp Chippewa for Boys CA TRUST
${rescode} SystemCommands ${commandstr} ${stringlist}

View File

@@ -1,422 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
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_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Library json
Library DateTime
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
Proxy-Policy-insert-00002
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.meilleurmobile.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.meilleurmobile.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${insert_policyId1}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${insert_objectId40} ${insert_policyId1} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-insert-00003
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "scottsdalepublicart.org"}
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.troop508.org"}
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "dreamdayoncapecod.wordpress.com"}
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.doctorpoo.net"}
${url1} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "scottsdalepublicart.org/"}
${url2} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.troop508.org/"}
${url3} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "dreamdayoncapecod.wordpress.com/"}
${url4} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.doctorpoo.net/"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn1} ${fqdn2} ${fqdn3} ${fqdn4} ${url1} ${url2} ${url3} ${url4} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${insert_policyId2}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${insert_objectId2} ${insert_objectId3} ${insert_policyId2} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-insert-00004
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.viator.com/login?login_redirect=%2Faccount%2Fbookings"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "afsfssfMozilla/5.0afsfsdafsafs","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${insert_policyId3}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${insert_objectId43} ${insert_objectId44} ${insert_policyId3} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-insert-00005
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "matadornetwork.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "matadornetwork.com/destinations/north-america/united-states/"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${insert_policyId4}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${insert_objectId7} ${insert_objectId8} ${insert_objectId9} ${insert_policyId4} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-insert-00006
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.farecompare.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.farecompare.com/hotels/"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Mozillasssaaa","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${insert_policyId5}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${insert_objectId10} ${insert_objectId11} ${insert_objectId12} ${insert_policyId5} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-insert-00007
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.tripit.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.tripit.com/web"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahahahsfeSafari/537.36","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${insert_policyId6}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${insert_objectId13} ${insert_objectId14} ${insert_objectId15} ${insert_policyId6} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-insert-00008
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.waikikibeachwalk.com/Shops.htm"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "utf-8aabnna","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${insert_policyId7}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${insert_objectId17} ${insert_objectId45} ${insert_policyId7} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-insert-00009
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.world-guides.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.world-guides.com/north-america/usa/nevada/las-vegas/"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${insert_policyId8}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${insert_objectId19} ${insert_objectId20} ${insert_objectId21} ${insert_policyId8} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-insert-00010
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "news.cnstock.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "news.cnstock.com/kcb"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${insert_policyId9}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${insert_objectId22} ${insert_objectId23} ${insert_objectId24} ${insert_policyId9} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-insert-00011
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "otc.newone.com.cn"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "otc.newone.com.cn/cwyw"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${insert_policyId10}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${insert_objectId25} ${insert_objectId26} ${insert_objectId27} ${insert_policyId10} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-insert-00012
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "petapixel.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "petapixel.com/topic/equipment/"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "saltkey","district": "Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ck} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${insert_policyId11}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${insert_objectId28} ${insert_objectId29} ${insert_objectId30} ${insert_policyId11} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
Proxy-Policy-insert-00013
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.intervalworld.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.intervalworld.com/web/my/home"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "charset=text","district": "Content-Type"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Mozilla/5.0fsfwhh","district": "User-Agent"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "__stripe_sidafdsvxvx","district": "Cookie"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Domain=.intervalworld.com","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ck} ${res_hdr_sc} ${imsi_id} ${phone_number_id} ${apn_id}
... ${res_hdr_ct} ${req_hdr_ua}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${insert_policyId13}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${insert_objectId33} ${insert_objectId34} ${insert_objectId35} ${insert_objectId36}
... ${insert_objectId37} ${insert_policyId13} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true

View File

@@ -1,88 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
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_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Library json
Library DateTime
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
SecurityPolicy-Intercept-Http-00001
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.yumi.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${intercept_http_policyId}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${intercept_http_objectId1} ${intercept_http_policyId} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true
SecurityPolicy-Intercept-Http-00002
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "mbzponton.org"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${intercept_http_policyId1}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${intercept_http_objectId6} ${intercept_http_policyId1} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true

View File

@@ -1,61 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
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_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Library json
Library DateTime
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
SecurityPolicy-Intercept-Ssl-00002
#新增策略验证
#创建attributes中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${SSL_VID} appName=http protocol=ssl attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${SSL_VID} appName=http protocol=ssl attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${SSL_VID} appName=http protocol=ssl attributeValue={"string": "hahauawei.org"}
${sni} Create Dictionary attributeType=string attributeName=sni appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "fenopy.se"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${SSL_VID}"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${sni} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${intercept_http_policyId1}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${intercept_ssl_objectId2} ${intercept_ssl_policyId1} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log ${objectid_verify}
${testType} Evaluate type($objectid_verify)
${testType} Evaluate type($resData)
log ${resData}
sleep 5
${ok} VerifyProxy ${resData} ${objectid_verify}
Should Be Equal As Strings ${ok} true

View File

@@ -1,84 +0,0 @@
*** Settings ***
Force Tags tsg_adc_wp security_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../05-Other/AllFlowCaseVariable.txt
*** Test Cases ***
SecurityPolicy-Monitor-Dns-00001
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d travelgam.com
... ELSE set variable nslookup travelgam.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List travelgam.com
... ELSE Create List travelgam.com
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d flyaurora.ru
... ELSE set variable nslookup -d flyaurora.ru
${stringlist} run keyword if '${systemType}'=='Windows' Create List flyaurora.ru
... ELSE Create List flyaurora.ru
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变监控策略
${policyDict} Create Dictionary policyId=${monitor_dns_policyId} source=${monitor_dns_objectId2}|TSG_SECURITY_SOURCE_LOCATION policyName=SecurityPolicy-Monitor-Dns-00001-1 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"DNS"} filterList=${monitor_dns_objectId1}|TSG_FIELD_DNS_QNAME isValid=${1} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d travelgam.com
... ELSE set variable nslookup travelgam.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List travelgam.com
... ELSE Create List travelgam.com
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Monitor-Dns-00002
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.ohotniki.ru
... ELSE set variable nslookup -d www.ohotniki.ru
${stringlist} run keyword if '${systemType}'=='Windows' Create List ohotniki.ru
... ELSE Create List ohotniki.ru
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.slmmm.com
... ELSE set variable nslookup -d www.slmmm.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List slmmm
... ELSE Create List slmmm
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Monitor-Dns-00003
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.u17.com
... ELSE set variable nslookup -d www.u17.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List www.u17.com
... ELSE Create List www.u17.com
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变监控策略
${policyDict} Create Dictionary policyId=${monitor_dns_policyId2} policyName=SecurityPolicy-Monitor-Dns-00003_1 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"DNS"} filterList=${monitor_dns_objectId3}|TSG_FIELD_DNS_QNAME isValid=${1} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.u17.com
... ELSE set variable nslookup -d www.u17.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List www.u17.com
... ELSE Create List www.u17.com
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Monitor-Dns-00004
Comment 开启监控策略
${policyDict} Create Dictionary policyId=${monitor_dns_policyId3} policyName=SecurityPolicy-Monitor-Dns-00004 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"DNS"} isValid=${1} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep ${policyModifySleepSeconds}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d travelgam.com
... ELSE set variable nslookup travelgam.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List travelgam.com
... ELSE Create List travelgam.com
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 关闭监控策略
${policyDict} Create Dictionary policyId=${monitor_dns_policyId3} policyName=SecurityPolicy-Monitor-Dns-00004 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"DNS"} isValid=${0} appIdObjects=${DNS_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update

Some files were not shown because too many files have changed in this diff Show More