安全策略Mail协议用例调整,安全策略Allow动作用例补充

This commit is contained in:
hebingning
2021-02-09 15:30:49 +08:00
parent c6e36ba3ee
commit a2edbb93be
8 changed files with 140 additions and 53 deletions

View File

@@ -10,42 +10,60 @@ Resource ../../../03-Variable/ApplicationID.txt
*** Test Cases ***
SecurityPolicy-Allow-Http-00001
[Tags] fqdn右匹配
[Tags] fqdn右匹配 url完全匹配 update policy: ip geo,fqdn完全匹配,url子串匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*clintonairport.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$clintonairport.com/airlines-flights/covid/
${rescode} ${objectId1} AddObject2 ${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
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.66rpg.com
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
Comment 创建url2
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=66rpg
${rescode} ${objectId4} AddObject2 ${1} ${objectDict}
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 isValid=${1} appIdObjects=${HTTP_ID}
${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 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}
SecurityPolicy-Allow-Http-00002
[Tags] cat
[Tags] cat,fqdn 完全匹配,url左匹配 update policy:url右匹配
Comment 创建fqdn
# ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.airpano.com
# ${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$scoutbahamas.org
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=scoutbah*
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建fqdn2
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*ang5.com
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
Comment 创建url2
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*w.xiang5.com/
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Http-00002 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"HTTP"} filterList=109|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Http-00002 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"HTTP"} filterList=109|TSG_FIELD_HTTP_HOST,${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_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] cat完整匹配
# Comment 创建fqdn
# ${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$192.168.40.120
# ${rescode} ${objectId} AddObject2 ${1} ${objectDict}
# Comment 创建安全策略
# ${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Http-00003 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${SSL_ID}
# log ${policyDict}
# ${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
# insert_policyId_to_file1 allow_http_objectId2 ${objectId}
# insert_policyId_to_file1 allow_http_policyId2 ${policyId}