针对自建服务器的case调整为一引用applicationid变量,适应20.09appid调整。

This commit is contained in:
dongxiaoyan
2020-09-07 19:38:05 +08:00
parent 33d77fa392
commit 14a9465518
32 changed files with 916 additions and 882 deletions

View File

@@ -8,6 +8,7 @@ Resource ../../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../../03-Variable/ApplicationID.txt
*** Variables ***
${policyIds} ${EMPTY}
@@ -23,7 +24,7 @@ SecurityPolicy-Intercept-SSL-00001
${rescode} ${objectId} AddObjects ${1} ${objectDict}
${objectIds} Set Variable ${objectId}
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}} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appIdObjects=3
${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}} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appIdObjects=${SSL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -54,7 +55,7 @@ SecurityPolicy-Intercept-SSL-00002
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
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=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=3 destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR
${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=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -85,7 +86,7 @@ SecurityPolicy-Intercept-SSL-00003
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=3 destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 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} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -120,7 +121,7 @@ SecurityPolicy-Intercept-SSL-00004
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_cat_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=3 destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 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} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -138,7 +139,7 @@ SecurityPolicy-Intercept-SSL-00004
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${object_cat_Id}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=3 policyId=${policyId} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${object_cat_Id}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID} policyId=${policyId} destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0002.bat