2020-07-01 17:29:16 +08:00
|
|
|
*** 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
|
2021-05-17 13:24:29 +06:00
|
|
|
# Resource ../../../03-Variable/ApplicationID.txt
|
2021-01-27 16:22:07 +08:00
|
|
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
2020-07-01 17:29:16 +08:00
|
|
|
|
2020-07-06 10:31:24 +08:00
|
|
|
*** Variables ***
|
|
|
|
|
|
2020-07-01 17:29:16 +08:00
|
|
|
*** Test Cases ***
|
2020-07-06 10:31:24 +08:00
|
|
|
SecurityPolicy-Intercept-Ssl-00001
|
2021-01-26 20:54:31 +08:00
|
|
|
[Tags] fqdn完整匹配 update policy:source geo
|
2020-07-01 17:29:16 +08:00
|
|
|
Comment 创建fqdn
|
2021-05-17 13:24:29 +06:00
|
|
|
${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}
|
2021-01-26 20:54:31 +08:00
|
|
|
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}
|
2021-05-17 13:24:29 +06:00
|
|
|
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
|
2020-07-01 17:29:16 +08:00
|
|
|
Comment 创建安全策略
|
2021-05-17 13:24:29 +06:00
|
|
|
${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}
|
2020-07-01 17:29:16 +08:00
|
|
|
log ${policyDict}
|
|
|
|
|
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
|
2021-01-27 16:22:07 +08:00
|
|
|
${policyId} Get-Pids ${policyId}
|
|
|
|
|
${policyId} Set Variable ${policyId}[0]
|
2020-07-06 10:31:24 +08:00
|
|
|
insert_policyId_to_file1 intercept_ssl_objectId ${objectId}
|
2021-02-22 10:43:44 +08:00
|
|
|
insert_policyId_to_file1 intercept_ssl_objectId1 ${objectId1}
|
2021-05-17 13:24:29 +06:00
|
|
|
insert_policyId_to_file1 intercept_ssl_categoryId ${categoryId}
|
2020-07-06 10:31:24 +08:00
|
|
|
insert_policyId_to_file1 intercept_ssl_policyId ${policyId}
|
2020-07-01 17:29:16 +08:00
|
|
|
|
2020-07-06 10:31:24 +08:00
|
|
|
SecurityPolicy-Intercept-Ssl-00002
|
2021-01-20 20:23:15 +08:00
|
|
|
[Tags] category
|
2021-05-17 13:24:29 +06:00
|
|
|
${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}
|
2020-07-01 17:29:16 +08:00
|
|
|
Comment 创建安全策略
|
2021-05-17 13:24:29 +06:00
|
|
|
${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}
|
2020-07-01 17:29:16 +08:00
|
|
|
log ${policyDict}
|
|
|
|
|
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
|
2021-01-27 16:22:07 +08:00
|
|
|
${policyId} Get-Pids ${policyId}
|
|
|
|
|
${policyId} Set Variable ${policyId}[0]
|
2021-02-22 10:43:44 +08:00
|
|
|
insert_policyId_to_file1 intercept_ssl_objectId2 ${objectId}
|
2020-07-06 10:31:24 +08:00
|
|
|
insert_policyId_to_file1 intercept_ssl_policyId1 ${policyId}
|
2021-01-20 20:23:15 +08:00
|
|
|
|
|
|
|
|
SecurityPolicy-Intercept-Ssl-00003
|
2021-01-26 20:54:31 +08:00
|
|
|
[Tags] fqdn other Certificate update policy:fqdn
|
2021-05-17 13:24:29 +06:00
|
|
|
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}
|
2021-01-26 20:54:31 +08:00
|
|
|
Comment 创建安全策略
|
2021-05-17 13:24:29 +06:00
|
|
|
${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}
|
2021-01-20 20:23:15 +08:00
|
|
|
log ${policyDict}
|
|
|
|
|
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
|
2021-01-27 16:22:07 +08:00
|
|
|
${policyId} Get-Pids ${policyId}
|
|
|
|
|
${policyId} Set Variable ${policyId}[0]
|
2021-02-22 10:43:44 +08:00
|
|
|
insert_policyId_to_file1 intercept_ssl_objectId3 ${objectId}
|
|
|
|
|
insert_policyId_to_file1 intercept_ssl_objectId4 ${objectId1}
|
2021-01-20 20:23:15 +08:00
|
|
|
insert_policyId_to_file1 intercept_ssl_policyId2 ${policyId}
|
|
|
|
|
|
|
|
|
|
SecurityPolicy-Intercept-Ssl-00004
|
|
|
|
|
[Tags] category Other Certificate to replace
|
2021-05-17 13:24:29 +06:00
|
|
|
${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}
|
2021-01-20 20:23:15 +08:00
|
|
|
Comment 创建安全策略
|
2021-05-17 13:24:29 +06:00
|
|
|
${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}
|
2021-01-20 20:23:15 +08:00
|
|
|
log ${policyDict}
|
|
|
|
|
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
|
2021-01-27 16:22:07 +08:00
|
|
|
${policyId} Get-Pids ${policyId}
|
|
|
|
|
${policyId} Set Variable ${policyId}[0]
|
2021-02-22 10:43:44 +08:00
|
|
|
insert_policyId_to_file1 intercept_ssl_objectId5 ${objectId}
|
2021-01-20 20:23:15 +08:00
|
|
|
insert_policyId_to_file1 intercept_ssl_policyId3 ${policyId}
|