Merge branch 'develop' of https://git.mesalab.cn/dongxiaoyan/tsg_autotest.git into develop
This commit is contained in:
57
01-TestCase/tsg_adc/multi_step/a_Deny_Dns_Tests.robot
Normal file
57
01-TestCase/tsg_adc/multi_step/a_Deny_Dns_Tests.robot
Normal file
@@ -0,0 +1,57 @@
|
||||
*** 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
|
||||
|
||||
*** Test Cases ***
|
||||
SecurityPolicy-Deny-Dns-00001
|
||||
[Tags] fqdn
|
||||
Comment 创建fqdn
|
||||
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.facebook.com,*ok.ru
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Dns-00001 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"DNS","method":"drop"} referenceObject=${objectId}|TSG_FIELD_DNS_QNAME isValid=${1} appObjectIdArray=4
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_dns_objectId ${objectId}
|
||||
insert_policyId_to_file1 deny_dns_policyId ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Dns-00002
|
||||
[Tags] cat
|
||||
Comment 创建cat
|
||||
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*yhd.com,$www.vk.com
|
||||
${rescode} ${objectId} AddObject2 ${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}}]}]} referenceObject=${objectId}|TSG_FIELD_DNS_QNAME isValid=${1} appObjectIdArray=4
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_dns_objectId1 ${objectId}
|
||||
insert_policyId_to_file1 deny_dns_policyId1 ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Dns-00003
|
||||
[Tags] cat
|
||||
Comment 创建cat
|
||||
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*ya.ru
|
||||
${rescode} ${objectId} AddObject2 ${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}}]}]} referenceObject=${objectId}|TSG_FIELD_DNS_QNAME isValid=${1} appObjectIdArray=4
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_dns_objectId2 ${objectId}
|
||||
insert_policyId_to_file1 deny_dns_policyId2 ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Dns-00004
|
||||
[Tags] 最大重定向
|
||||
Comment 创建fqdn
|
||||
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*youtube.com
|
||||
${rescode} ${objectId} AddObject2 ${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}}]}]} referenceObject=${objectId}|TSG_FIELD_DNS_QNAME isValid=${1} appObjectIdArray=4
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_dns_objectId3 ${objectId}
|
||||
insert_policyId_to_file1 deny_dns_policyId3 ${policyId}
|
||||
220
01-TestCase/tsg_adc/multi_step/a_Deny_Http_Tests.robot
Normal file
220
01-TestCase/tsg_adc/multi_step/a_Deny_Http_Tests.robot
Normal file
@@ -0,0 +1,220 @@
|
||||
*** 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
|
||||
|
||||
*** Variables ***
|
||||
${url} /v1/policy/profile/responsepages
|
||||
|
||||
*** Test Cases ***
|
||||
SecurityPolicy-Deny-Http-00001
|
||||
[Tags] fqdn
|
||||
Comment 创建fqdn
|
||||
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$webalta.ru
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00001 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} referenceObject=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_http_objectId ${objectId}
|
||||
insert_policyId_to_file1 deny_http_policyId ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Http-00002
|
||||
[Tags] cat
|
||||
Comment 创建cat
|
||||
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*nymbler.com
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00002 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"rst"} referenceObject=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_http_objectId1 ${objectId}
|
||||
insert_policyId_to_file1 deny_http_policyId1 ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Http-00003
|
||||
[Tags] url
|
||||
Comment 创建url
|
||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*/news/,$http://www.icbc.com.cn/icbc/,www.gotohoroscope*,indexv
|
||||
${rescode} ${objectId} AddObject2 ${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}} referenceObject=${objectId}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
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] 请求头
|
||||
Comment 创建请求头
|
||||
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
|
||||
${rescode} ${objectId} AddObject2 ${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"} referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appObjectIdArray=2
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_http_objectId3 ${objectId}
|
||||
insert_policyId_to_file1 deny_http_policyId3 ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Http-00005
|
||||
[Tags] 请求头
|
||||
Comment 创建请求头
|
||||
${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/78.0.3904.70 Safari/537.36|User-Agent
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00005 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appObjectIdArray=2
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_http_objectId4 ${objectId}
|
||||
insert_policyId_to_file1 deny_http_policyId4 ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Http-00006
|
||||
[Tags] 请求头
|
||||
Comment 创建请求头
|
||||
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=AppleWebKit|User-Agent
|
||||
${rescode} ${objectId} AddObject2 ${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":"网站被阻断"} referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appObjectIdArray=2
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_http_objectId5 ${objectId}
|
||||
insert_policyId_to_file1 deny_http_policyId5 ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Http-00007
|
||||
[Tags] 请求头
|
||||
Comment 创建请求头
|
||||
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
|
||||
${rescode} ${objectId} AddObject2 ${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}} referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appObjectIdArray=2
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_http_objectId6 ${objectId}
|
||||
insert_policyId_to_file1 deny_http_policyId6 ${policyId}
|
||||
insert_policyId_to_file1 deny_http_profiledId1 ${profiledId}
|
||||
|
||||
SecurityPolicy-Deny-Http-00008
|
||||
[Tags] 应答头
|
||||
Comment 创建应答头
|
||||
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*utf-8|Content-Type
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00008 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"rst"} referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_http_objectId7 ${objectId}
|
||||
insert_policyId_to_file1 deny_http_policyId7 ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Http-00009
|
||||
[Tags] 应答头
|
||||
Comment 创建应答头
|
||||
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=utf-8|Content-Type
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00009 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"alert","code":204,"message":"123456"} referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_http_objectId8 ${objectId}
|
||||
insert_policyId_to_file1 deny_http_policyId8 ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Http-00010
|
||||
[Tags] 应答头
|
||||
Comment 创建应答头
|
||||
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
#创建引用文件
|
||||
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404english.html resPages
|
||||
${profiledId} Get From Dictionary ${response} profileId
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00010 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"alert","code":204,"html_profile":${profiledId}} referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_http_objectId9 ${objectId}
|
||||
insert_policyId_to_file1 deny_http_policyId9 ${policyId}
|
||||
insert_policyId_to_file1 deny_http_profiledId2 ${profiledId}
|
||||
|
||||
SecurityPolicy-Deny-Http-00011
|
||||
[Tags] 应答头
|
||||
Comment 创建应答头
|
||||
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text*|Content-Type
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
#创建引用文件
|
||||
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404english.html resPages
|
||||
${profiledId} Get From Dictionary ${response} profileId
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00011 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"block","code":404,"html_profile":${profiledId}} referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_http_objectId10 ${objectId}
|
||||
insert_policyId_to_file1 deny_http_policyId10 ${policyId}
|
||||
insert_policyId_to_file1 deny_http_profiledId3 ${profiledId}
|
||||
|
||||
SecurityPolicy-Deny-Http-00012
|
||||
[Tags] cookie
|
||||
Comment 创建cookie
|
||||
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
|
||||
${rescode} ${objectId} AddObject2 ${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":"马上到周末"} referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appObjectIdArray=2
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_http_objectId11 ${objectId}
|
||||
insert_policyId_to_file1 deny_http_policyId11 ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Http-00013
|
||||
[Tags] set-cookie
|
||||
Comment 创建set-cookie
|
||||
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$startDate=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; domain=.xiaozhu.com|Set-Cookie,*httponly|Set-Cookie,domain=.kiss.ru|Set-Cookie,*oKD0_802a|Set-Cookie
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00013 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"alert","code":200,"message":"Главная страница"} referenceObject=${objectId}|TSG_FIELD_SSL_SAN,${objectId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=2
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_http_objectId12 ${objectId}
|
||||
insert_policyId_to_file1 deny_http_policyId12 ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Http-00014
|
||||
[Tags] 请求体
|
||||
Comment 创建请求体
|
||||
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*mail.ru
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00014 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"drop"} referenceObject=${objectId}|TSG_FIELD_SSL_SAN,${objectId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=2
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_http_objectId13 ${objectId}
|
||||
insert_policyId_to_file1 deny_http_policyId13 ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Http-00015
|
||||
[Tags] 应答体
|
||||
Comment 创建应答体
|
||||
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*mail.ru
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00015 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"drop"} referenceObject=${objectId}|TSG_FIELD_SSL_SAN,${objectId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=2
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_http_objectId14 ${objectId}
|
||||
insert_policyId_to_file1 deny_http_policyId14 ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Http-00016
|
||||
[Tags] 最大组合
|
||||
Comment 创建fqdn
|
||||
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*mail.ru
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Http-00016 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"drop"} referenceObject=${objectId}|TSG_FIELD_SSL_SAN,${objectId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=2
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_http_objectId15 ${objectId}
|
||||
insert_policyId_to_file1 deny_http_policyId15 ${policyId}
|
||||
57
01-TestCase/tsg_adc/multi_step/a_Deny_Ssl_Tests.robot
Normal file
57
01-TestCase/tsg_adc/multi_step/a_Deny_Ssl_Tests.robot
Normal file
@@ -0,0 +1,57 @@
|
||||
*** 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
|
||||
|
||||
*** Test Cases ***
|
||||
SecurityPolicy-Deny-Ssl-00001
|
||||
[Tags] sni fqdn
|
||||
Comment 创建fqdn
|
||||
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.cxwl.com,*freestockimages.ru
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Ssl-00001 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"rst"} referenceObject=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_ssl_objectId ${objectId}
|
||||
insert_policyId_to_file1 deny_ssl_policyId ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Ssl-00002
|
||||
[Tags] cn cat
|
||||
Comment 创建cat
|
||||
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*vip.com,*berkeleygroup.co.uk
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Ssl-00002 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"rst"} referenceObject=${objectId}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_ssl_objectId1 ${objectId}
|
||||
insert_policyId_to_file1 deny_ssl_policyId1 ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Ssl-00003
|
||||
[Tags] san cat
|
||||
Comment 创建cat
|
||||
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*pulitzer.org,*nastol.com.ua
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Ssl-00003 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"drop"} referenceObject=${objectId}|TSG_FIELD_SSL_SAN isValid=${1} appObjectIdArray=3
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_ssl_objectId2 ${objectId}
|
||||
insert_policyId_to_file1 deny_ssl_policyId2 ${policyId}
|
||||
|
||||
SecurityPolicy-Deny-Ssl-00004
|
||||
[Tags] 最大组合
|
||||
Comment 创建fqdn
|
||||
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*mail.ru
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Ssl-00004 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"drop"} referenceObject=${objectId}|TSG_FIELD_SSL_SAN,${objectId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
insert_policyId_to_file1 deny_ssl_objectId3 ${objectId}
|
||||
insert_policyId_to_file1 deny_ssl_policyId3 ${policyId}
|
||||
101
01-TestCase/tsg_adc/multi_step/b-Deny_Dns_Tests.robot
Normal file
101
01-TestCase/tsg_adc/multi_step/b-Deny_Dns_Tests.robot
Normal file
@@ -0,0 +1,101 @@
|
||||
*** 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
|
||||
|
||||
*** Test Cases ***
|
||||
SecurityPolicy-Deny-Dns-00001
|
||||
[Tags] fqdn
|
||||
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 canonical name = www.facebook.com
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_dns_starttime ${starttime} deny_dns_endtime ${endtime}
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d ok.ru
|
||||
... ELSE set variable nslookup ok.ru
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List 超时
|
||||
... ELSE Create List canonical name = ok.ru
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_dns_starttime1 ${starttime} deny_dns_endtime1 ${endtime}
|
||||
|
||||
SecurityPolicy-Deny-Dns-00002
|
||||
[Tags] cat
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.yhd.com
|
||||
... ELSE set variable nslookup -debug -query=A \ www.yhd.com
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List 192.168.41.186 www.jd.com ttl = 500
|
||||
... ELSE Create List 192.168.41.186 www.jd.com ttl = 500
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_dns_starttime2 ${starttime} deny_dns_endtime2 ${endtime}
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.vk.com
|
||||
... ELSE set variable nslookup -debug -query=A \ www.vk.com
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List 192.168.41.186 www.jd.com ttl = 500
|
||||
... ELSE Create List 192.168.41.186 www.jd.com ttl = 500
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_dns_starttime3 ${starttime} deny_dns_endtime3 ${endtime}
|
||||
|
||||
SecurityPolicy-Deny-Dns-00003
|
||||
[Tags] cat
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d ya.ru
|
||||
... ELSE set variable nslookup -debug -query=AAAA ya.ru
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List fc00::2:11 www.taobao.com ttl = 400
|
||||
... ELSE Create List fc00::2:11 www.taobao.com ttl = 400
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_dns_starttime4 ${starttime} deny_dns_endtime4 ${endtime}
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d ya.ru
|
||||
... ELSE set variable nslookup -debug -query=AAAA ya.ru
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List fc00::2:11 www.taobao.com ttl = 400
|
||||
... ELSE Create List fc00::2:11 www.taobao.com ttl = 400
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_dns_starttime5 ${starttime} deny_dns_endtime5 ${endtime}
|
||||
|
||||
SecurityPolicy-Deny-Dns-00004
|
||||
[Tags] 最大重定向
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.youtube.com
|
||||
... ELSE set variable nslookup -debug -query=A www.youtube.com
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List 192.168.40.110 www.facebook.com ttl = 400 www.ok.ru fc00::2:22
|
||||
... ELSE Create List 192.168.40.110 www.ok.ru ttl = 400
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.youtube.com
|
||||
... ELSE set variable nslookup -debug -query=AAAA www.youtube.com
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List fc00::2:22 www.facebook.com ttl = 400 www.ok.ru 192.168.40.110
|
||||
... ELSE Create List ttl = 400 www.facebook.com fc00::2:22
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_dns_starttime6 ${starttime} deny_dns_endtime6 ${endtime}
|
||||
195
01-TestCase/tsg_adc/multi_step/b_Deny_Http_Tests.robot
Normal file
195
01-TestCase/tsg_adc/multi_step/b_Deny_Http_Tests.robot
Normal file
@@ -0,0 +1,195 @@
|
||||
*** 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
|
||||
|
||||
*** Test Cases ***
|
||||
SecurityPolicy-Deny-Http-00001
|
||||
[Tags] fqdn
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00001.bat
|
||||
... ELSE set variable curl http://webalta.ru/
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... ELSE Create List Connection reset by peer
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_http_starttime ${starttime} deny_http_endtime ${endtime}
|
||||
|
||||
SecurityPolicy-Deny-Http-00002
|
||||
[Tags] cat
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00002.bat
|
||||
... ELSE set variable curl http://www.nymbler.com/
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... ELSE Create List Connection reset by peer
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_http_starttime1 ${starttime} deny_http_endtime1 ${endtime}
|
||||
|
||||
SecurityPolicy-Deny-Http-00003
|
||||
[Tags] url
|
||||
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/icbc/
|
||||
${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
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_http_starttime2 ${starttime} deny_http_endtime2 ${endtime}
|
||||
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
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_http_starttime3 ${starttime} deny_http_endtime3 ${endtime}
|
||||
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
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_http_starttime4 ${starttime} deny_http_endtime4 ${endtime}
|
||||
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
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_http_starttime5 ${starttime} deny_http_endtime5 ${endtime}
|
||||
|
||||
SecurityPolicy-Deny-Http-00004
|
||||
[Tags] 请求头
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00004.bat
|
||||
... ELSE set variable curl http://www.tsutmb.ru/sveden
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List yyyyy
|
||||
... ELSE Create List yyyyy
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_http_starttime6 ${starttime} deny_http_endtime6 ${endtime}
|
||||
|
||||
SecurityPolicy-Deny-Http-00005
|
||||
[Tags] 请求头
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00005.bat
|
||||
... ELSE set variable curl http://www.abchina.com/cn/
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... ELSE Create List Connection reset by peer
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_http_starttime7 ${starttime} deny_http_endtime7 ${endtime}
|
||||
|
||||
SecurityPolicy-Deny-Http-00006
|
||||
[Tags] 请求头
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00006.bat
|
||||
... ELSE set variable curl http://egypt.travel/ru
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List 网站被阻断
|
||||
... ELSE Create List 网站被阻断
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_http_starttime8 ${starttime} deny_http_endtime8 ${endtime}
|
||||
|
||||
SecurityPolicy-Deny-Http-00007
|
||||
[Tags] 请求头
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00007.bat
|
||||
... ELSE set variable curl http://www.destination360.com/travel/destinations
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
|
||||
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_http_starttime9 ${starttime} deny_http_endtime9 ${endtime}
|
||||
|
||||
SecurityPolicy-Deny-Http-00008
|
||||
[Tags] 应答头
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00001.bat
|
||||
... ELSE set variable curl http://www.cmbchina.com/CmbQuesInfo/index.aspx
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... ELSE Create List Connection reset by peer
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_http_starttime10 ${starttime} deny_http_endtime10 ${endtime}
|
||||
|
||||
SecurityPolicy-Deny-Http-00009
|
||||
[Tags] 应答头
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00001.bat
|
||||
... ELSE set variable curl http://www.bankcomm.com/BankCommSite/default.shtml
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... ELSE Create List Connection reset by peer
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_http_starttime11 ${starttime} deny_http_endtime11 ${endtime}
|
||||
|
||||
SecurityPolicy-Deny-Http-00010
|
||||
[Tags] 应答头
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00001.bat
|
||||
... ELSE set variable curl http://www.thg.ru/technews/hot_news.html
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... ELSE Create List Connection reset by peer
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_http_starttime12 ${starttime} deny_http_endtime12 ${endtime}
|
||||
|
||||
SecurityPolicy-Deny-Http-00011
|
||||
[Tags] 应答头
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00001.bat
|
||||
... ELSE set variable curl http://www.hitlistapp.com/about/
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... ELSE Create List Connection reset by peer
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_http_starttime13 ${starttime} deny_http_endtime13 ${endtime}
|
||||
97
01-TestCase/tsg_adc/multi_step/b_Deny_Ssl_Tests.robot
Normal file
97
01-TestCase/tsg_adc/multi_step/b_Deny_Ssl_Tests.robot
Normal file
@@ -0,0 +1,97 @@
|
||||
*** 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
|
||||
|
||||
*** Test Cases ***
|
||||
SecurityPolicy-Deny-Ssl-00001
|
||||
[Tags] sni
|
||||
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 Connection reset by peer
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_ssl_starttime ${starttime} deny_ssl_endtime ${endtime}
|
||||
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 Connection reset by peer
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_ssl_starttime1 ${starttime} deny_ssl_endtime1 ${endtime}
|
||||
|
||||
SecurityPolicy-Deny-Ssl-00002
|
||||
[Tags] cn
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00002.bat
|
||||
... ELSE set variable curl https://www.berkeleygroup.co.uk/
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... ELSE Create List Connection reset by peer
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_ssl_starttime2 ${starttime} deny_ssl_endtime2 ${endtime}
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00002_2.bat
|
||||
... ELSE set variable curl https://www.vip.com/
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... ELSE Create List Connection reset by peer
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_ssl_starttime3 ${starttime} deny_ssl_endtime3 ${endtime}
|
||||
|
||||
SecurityPolicy-Deny-Ssl-00003
|
||||
[Tags] san
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00003.bat
|
||||
... ELSE set variable curl https://www.nastol.com.ua/
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... ELSE Create List Connection reset by peer
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_ssl_starttime4 ${starttime} deny_ssl_endtime4 ${endtime}
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00003_3.bat
|
||||
... ELSE set variable curl https://www.pulitzer.org/
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... ELSE Create List Connection reset by peer
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_ssl_starttime5 ${starttime} deny_ssl_endtime5 ${endtime}
|
||||
|
||||
SecurityPolicy-Deny-Ssl-00004
|
||||
[Tags] 最大组合
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_SSL_00004.bat
|
||||
... ELSE set variable curl https://mail.ru/
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... ELSE Create List Connection reset by peer
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
insert_time_to_file1 deny_ssl_starttime6 ${starttime} deny_ssl_endtime6 ${endtime}
|
||||
53
01-TestCase/tsg_adc/multi_step/c_Deny_Dns_Tests.robot
Normal file
53
01-TestCase/tsg_adc/multi_step/c_Deny_Dns_Tests.robot
Normal file
@@ -0,0 +1,53 @@
|
||||
*** 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-Deny-Dns-00001
|
||||
[Tags] sni
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_dns_objectId}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_dns_policyId}]}
|
||||
${s} Convert to String ${deny_dns_policyId}
|
||||
GetLogList security_event_log ${deny_dns_starttime} ${deny_dns_endtime} ${testClentIP} ${s} dns_qname facebook.com
|
||||
GetLogList security_event_log ${deny_dns_starttime1} ${deny_dns_endtime1} ${testClentIP} ${s} dns_qname ok.ru
|
||||
|
||||
SecurityPolicy-Deny-Dns-00002
|
||||
[Tags] cn
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_dns_objectId1}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_dns_policyId1}]}
|
||||
${s} Convert to String ${deny_dns_policyId1}
|
||||
GetLogList security_event_log ${deny_dns_starttime2} ${deny_dns_endtime2} ${testClentIP} ${s} dns_qname yhd.com
|
||||
GetLogList security_event_log ${deny_dns_starttime3} ${deny_dns_endtime3} ${testClentIP} ${s} dns_qname vk.com
|
||||
|
||||
SecurityPolicy-Deny-Dns-00003
|
||||
[Tags] san
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_dns_objectId2}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_dns_policyId2}]}
|
||||
${s} Convert to String ${deny_dns_policyId2}
|
||||
GetLogList security_event_log ${deny_dns_starttime4} ${deny_dns_endtime4} ${testClentIP} ${s} dns_qname ya.ru
|
||||
|
||||
SecurityPolicy-Deny-Dns-00004
|
||||
[Tags] 最大组合
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_dns_objectId3}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_dns_policyId3}]}
|
||||
${s} Convert to String ${deny_dns_policyId3}
|
||||
GetLogList security_event_log ${deny_dns_starttime6} ${deny_dns_endtime6} ${testClentIP} ${s} dns_qname youtube.com
|
||||
83
01-TestCase/tsg_adc/multi_step/c_Deny_Http_Tests.robot
Normal file
83
01-TestCase/tsg_adc/multi_step/c_Deny_Http_Tests.robot
Normal file
@@ -0,0 +1,83 @@
|
||||
*** Settings ***
|
||||
Test Teardown DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
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}
|
||||
${url} /v1/policy/profile/responsepages
|
||||
${profiledId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
SecurityPolicy-Deny-Http-00001
|
||||
[Tags] fqdn
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_http_objectId}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_http_policyId}]}
|
||||
${s} Convert to String ${deny_http_policyId}
|
||||
GetLogList security_event_log ${deny_http_starttime} ${deny_http_endtime} ${testClentIP} ${s} http_host webalta.ru
|
||||
|
||||
SecurityPolicy-Deny-Http-00002
|
||||
[Tags] cat
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_http_objectId1}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_http_policyId1}]}
|
||||
${s} Convert to String ${deny_http_policyId1}
|
||||
GetLogList security_event_log ${deny_http_starttime1} ${deny_http_endtime1} ${testClentIP} ${s} http_host nymbler.com
|
||||
|
||||
SecurityPolicy-Deny-Http-00003
|
||||
[Tags] url
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_http_objectId2}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_http_policyId2}]}
|
||||
${s} Convert to String ${deny_http_policyId2}
|
||||
GetLogList security_event_log ${deny_http_starttime3} ${deny_http_endtime3} ${testClentIP} ${s} http_host icbc.com.cn
|
||||
GetLogList security_event_log ${deny_http_starttime4} ${deny_http_endtime4} ${testClentIP} ${s} http_host ccb.com
|
||||
GetLogList security_event_log ${deny_http_starttime5} ${deny_http_endtime5} ${testClentIP} ${s} http_host gotohoroscope.com
|
||||
GetLogList security_event_log ${deny_http_starttime6} ${deny_http_endtime6} ${testClentIP} ${s} http_host government.ru
|
||||
|
||||
SecurityPolicy-Deny-Http-00004
|
||||
[Tags] 请求头
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_http_objectId3}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_http_policyId3}]}
|
||||
${s} Convert to String ${deny_http_policyId3}
|
||||
GetLogList security_event_log ${deny_http_starttime7} ${deny_http_endtime7} ${testClentIP} ${s} http_host tsutmb.ru
|
||||
|
||||
SecurityPolicy-Deny-Http-00005
|
||||
[Tags] 请求头
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_http_objectId4}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_http_policyId4}]}
|
||||
${s} Convert to String ${deny_http_policyId4}
|
||||
GetLogList security_event_log ${deny_http_starttime8} ${deny_http_endtime8} ${testClentIP} ${s} http_host abchina.com
|
||||
|
||||
SecurityPolicy-Deny-Http-00006
|
||||
[Tags] 请求头
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_http_objectId5}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_http_policyId5}]}
|
||||
${s} Convert to String ${deny_http_policyId5}
|
||||
GetLogList security_event_log ${deny_http_starttime9} ${deny_http_endtime9} ${testClentIP} ${s} http_host egypt.travel
|
||||
|
||||
SecurityPolicy-Deny-Http-00007
|
||||
[Tags] 请求头
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_http_objectId6}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_http_policyId6}]}
|
||||
${s} Convert to String ${deny_http_policyId6}
|
||||
GetLogList security_event_log ${deny_http_starttime10} ${deny_http_endtime10} ${testClentIP} ${s} http_host destination360.com
|
||||
54
01-TestCase/tsg_adc/multi_step/c_Deny_Ssl_Tests.robot
Normal file
54
01-TestCase/tsg_adc/multi_step/c_Deny_Ssl_Tests.robot
Normal file
@@ -0,0 +1,54 @@
|
||||
*** 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-Deny-Ssl-00001
|
||||
[Tags] sni
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_ssl_objectId}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_ssl_policyId}]}
|
||||
${s} Convert to String ${deny_ssl_policyId}
|
||||
GetLogList security_event_log ${deny_ssl_starttime} ${deny_ssl_endtime} ${testClentIP} ${s} ssl_sni freestockimages.ru
|
||||
GetLogList security_event_log ${deny_ssl_starttime1} ${deny_ssl_endtime1} ${testClentIP} ${s} ssl_sni cxwl.com
|
||||
|
||||
SecurityPolicy-Deny-Ssl-00002
|
||||
[Tags] cn
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_ssl_objectId1}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_ssl_policyId1}]}
|
||||
${s} Convert to String ${deny_ssl_policyId1}
|
||||
GetLogList security_event_log ${deny_ssl_starttime2} ${deny_ssl_endtime2} ${testClentIP} ${s} ssl_sni berkeleygroup.co.uk
|
||||
GetLogList security_event_log ${deny_ssl_starttime3} ${deny_ssl_endtime3} ${testClentIP} ${s} ssl_sni vip.com
|
||||
|
||||
SecurityPolicy-Deny-Ssl-00003
|
||||
[Tags] san
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_ssl_objectId2}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_ssl_policyId2}]}
|
||||
${s} Convert to String ${deny_ssl_policyId2}
|
||||
GetLogList security_event_log ${deny_ssl_starttime4} ${deny_ssl_endtime4} ${testClentIP} ${s} ssl_sni nastol.com.ua
|
||||
GetLogList security_event_log ${deny_ssl_starttime5} ${deny_ssl_endtime5} ${testClentIP} ${s} ssl_sni pulitzer.org
|
||||
|
||||
SecurityPolicy-Deny-Ssl-00004
|
||||
[Tags] 最大组合
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_ssl_objectId3}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_ssl_policyId3}]}
|
||||
${s} Convert to String ${deny_ssl_policyId3}
|
||||
GetLogList security_event_log ${deny_ssl_starttime6} ${deny_ssl_endtime6} ${testClentIP} ${s} ssl_sni mail.ru
|
||||
@@ -3,6 +3,7 @@ Test Teardown DeletePolicyAndObjectAndProfile ${policyIds} ${objectIds
|
||||
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
|
||||
*** Variables ***
|
||||
@@ -336,14 +337,12 @@ Policy-Post-v1-00013
|
||||
${rescode} ${itemIds} ${itemList} GetObjectItems ${params}
|
||||
Log To Console ${itemIds}
|
||||
Comment 更新IP
|
||||
${len} Get Length ${itemList}
|
||||
FOR ${index} IN ${len}
|
||||
${index1} Evaluate int(${index})-1
|
||||
Set To Dictionary ${itemList}[${index1}] clientIp1 192.168.41.67
|
||||
Set To Dictionary ${itemList}[${index1}] clientIp2 192.168.41.67
|
||||
Remove From Dictionary ${itemList}[${index1}] isInitialize
|
||||
Set To Dictionary ${itemList}[${index1}] serverIp1 192.168.41.68
|
||||
Set To Dictionary ${itemList}[${index1}] serverIp2 192.168.41.68
|
||||
FOR ${item} IN @{itemList}
|
||||
Set To Dictionary ${item} clientIp1 192.168.41.67
|
||||
Set To Dictionary ${item} clientIp2 192.168.41.67
|
||||
Remove From Dictionary ${item} isInitialize
|
||||
Set To Dictionary ${item} serverIp1 192.168.41.68
|
||||
Set To Dictionary ${item} serverIp2 192.168.41.68
|
||||
END
|
||||
${objectDict} Create Dictionary objectId=${objectId1} objectType=ip
|
||||
... updateItemList=${itemList}
|
||||
@@ -395,7 +394,7 @@ Policy-Delete-v1-00016
|
||||
${rescode} ${policyIds} AddPolicies 1 ${policy} v2
|
||||
Log ${rescode}
|
||||
Comment 删除安全策略
|
||||
${rescode} WxDeletePolicy1 ${policyIds[0]['policyIds']} tsg_security
|
||||
${rescode} DeletePolicy1 ${policyIds[0]['policyIds']} tsg_security
|
||||
${policyIds} Create List
|
||||
Log ${rescode}
|
||||
Policy-Delete-v1-00017
|
||||
@@ -434,4 +433,113 @@ Policy-Export-v1-00019
|
||||
Comment 导 出json
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
${response} ExportPolicy tsg_security ${EMPTY} ${EMPTY}
|
||||
WriteFile downloads download.json ${response}
|
||||
WriteFile downloads download.json ${response}
|
||||
Policy-Verify-v1-00020
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
Comment 创建对象
|
||||
${ipValue} Create Dictionary clientIp=192.168.41.67 clientPort=${1} serverIp=192.168.41.67 serverPort=${1}
|
||||
... addrType=${4} protocol=${6}
|
||||
${ipObj} Create Dictionary attributeType=ip tableName=TSG_OBJ_IP_ADDR protocol=HTTP attributeName=ip
|
||||
... attributeValue=${ipValue}
|
||||
${stringValue} Create Dictionary string=*baidu.com
|
||||
${stringObj} Create Dictionary attributeType=string tableName=TSG_OBJ_URL protocol=HTTP attributeName=url
|
||||
... attributeValue=${stringValue}
|
||||
${appIdValue} Create Dictionary string=http.
|
||||
${appIdObj} Create Dictionary attributeType=string protocol=HTTP attributeName=app_id
|
||||
... attributeValue=${appIdValue}
|
||||
${attributes} Create List ${ipObj} ${stringObj} ${appIdObj}
|
||||
${verifySession} Create Dictionary attributes=${attributes}
|
||||
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
|
||||
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||
Policy-Verify-v1-00021
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
Comment 创建对象
|
||||
${ipObj} Create Dictionary attributeType=ip tableName=TSG_OBJ_IP_ADDR protocol=HTTP attributeName=ip
|
||||
... attributeValue={"clientIp":"192.168.41.67","clientPort":1,"serverIp":"192.168.41.67","serverPort":1,"addrType":4,"protocol":6}
|
||||
${stringValue} Create Dictionary string=*baidu.com
|
||||
${stringObj} Create Dictionary attributeType=string tableName=TSG_OBJ_URL protocol=HTTP attributeName=url
|
||||
... attributeValue=${stringValue}
|
||||
${appIdValue} Create Dictionary string=http.
|
||||
${appIdObj} Create Dictionary attributeType=string protocol=HTTP attributeName=app_id
|
||||
... attributeValue=${appIdValue}
|
||||
${attributes} Create List ${ipObj} ${stringObj} ${appIdObj}
|
||||
${verifySession} Create Dictionary attributes=${attributes}
|
||||
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
|
||||
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||
Policy-Verify-v1-00022
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
Comment 创建对象
|
||||
${ipObj} Create Dictionary attributeType=ip tableName=TSG_OBJ_IP_ADDR protocol=HTTP attributeName=ip
|
||||
... attributeValue={"clientIp":"192.168.41.67","clientPort":1,"serverIp":"192.168.41.67","serverPort":1,"addrType":4,"protocol":6}
|
||||
${stringObj} Create Dictionary attributeType=string tableName=TSG_OBJ_URL protocol=HTTP attributeName=url
|
||||
... attributeValue={'string':'*baidu.com'}
|
||||
${appIdValue} Create Dictionary string=http.
|
||||
${appIdObj} Create Dictionary attributeType=string protocol=HTTP attributeName=app_id
|
||||
... attributeValue=${appIdValue}
|
||||
${attributes} Create List ${ipObj} ${stringObj} ${appIdObj}
|
||||
${verifySession} Create Dictionary attributes=${attributes}
|
||||
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
|
||||
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||
|
||||
Policy-Verify-v1-00023
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
Comment 创建对象
|
||||
${ipObj} Create Dictionary attributeType=ip tableName=TSG_OBJ_IP_ADDR protocol=HTTP attributeName=ip
|
||||
... attributeValue=192.168.41.67|1|192.168.41.67|1|4|6
|
||||
${stringObj} Create Dictionary attributeType=string tableName=TSG_OBJ_URL protocol=HTTP attributeName=url
|
||||
... attributeValue=*baidu.com
|
||||
${appIdObj} Create Dictionary attributeType=string protocol=HTTP attributeName=app_id
|
||||
... attributeValue=http.
|
||||
${signatureObj} Create Dictionary attributeType=signature protocol=HTTP attributeName=req_body
|
||||
... attributeValue=Content-Type|application/json
|
||||
${attributes} Create List ${ipObj} ${stringObj} ${appIdObj} ${signatureObj}
|
||||
${verifySession} Create Dictionary attributes=${attributes}
|
||||
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
|
||||
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||
Policy-log-v1-00024
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
Comment 查询schema
|
||||
${schema_query} ${schema_type} ${default_columns} ${fields} GetLogSchema security_event_log
|
||||
${queryFieldList} Create List
|
||||
FOR ${field} IN @{fields}
|
||||
${return} ${doc} Run Keyword And Ignore Error Get From Dictionary ${field} doc
|
||||
Continue For Loop If "${return}"=="FAIL"
|
||||
${return} ${allow_query} Run Keyword And Ignore Error Get From Dictionary ${doc} allow_query
|
||||
Continue For Loop If "${allow_query}"=="false" or "${return}"=="FAIL"
|
||||
${fieldDict} Create Dictionary name=${field['name']} type=${field['type']}
|
||||
Append To List ${queryFieldList} ${fieldDict}
|
||||
END
|
||||
Log ${queryFieldList}
|
||||
Policy-log-v1-00025
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
Comment 查询schema
|
||||
${schema_query} ${schema_type} ${default_columns} ${fields} GetLogSchema security_event_log
|
||||
|
||||
${filters} Get From Dictionary ${schema_query} filters
|
||||
Log ${filters}
|
||||
Policy-log-v1-00026
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
Comment 查询schema
|
||||
${schema_query} ${schema_type} ${default_columns} ${fields} GetLogSchema security_event_log
|
||||
Comment 处理schema,构造查询条件
|
||||
${params} Create Dictionary pageSize=${10} logType=security_event_log
|
||||
... start_common_recv_time=2020-06-01 00:00:00
|
||||
... end_common_recv_time=2020-06-24 00:00:00
|
||||
... fields=common_log_id|long,http_url|string,common_client_ip|string,common_client_port|int,common_server_ip|string,common_server_port|int
|
||||
... conditions=common_server_port|int|in|${80}^${8080}
|
||||
... orderBy=common_server_ip|true
|
||||
... common_log_ids=162273027957354498
|
||||
${resData} QueryLogs ${params} list
|
||||
Policy-log-v1-00027
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
Comment 查询schema
|
||||
${schema_query} ${schema_type} ${default_columns} ${fields} GetLogSchema security_event_log
|
||||
Comment 处理schema,构造查询条件
|
||||
${params} Create Dictionary pageSize=${10} logType=security_event_log
|
||||
... start_common_recv_time=2020-06-01 00:00:00
|
||||
... end_common_recv_time=2020-06-24 00:00:00
|
||||
... fields=common_log_id|long,http_url|string,common_client_ip|string,common_client_port|int,common_server_ip|string,common_server_port|int
|
||||
... conditions=common_server_port|int|in|${80}^${8080}
|
||||
... orderBy=common_server_ip|true
|
||||
... common_log_ids=162273027957354498
|
||||
${resData} QueryLogs ${params} count
|
||||
Reference in New Issue
Block a user