diff --git a/01-TestCase/tsg_adc/selfserver/Api_Security/Deny_FTP_Tests.robot b/01-TestCase/tsg_adc/selfserver/Api_Security/Deny_FTP_Tests.robot index 7cecf2e..17c405b 100644 --- a/01-TestCase/tsg_adc/selfserver/Api_Security/Deny_FTP_Tests.robot +++ b/01-TestCase/tsg_adc/selfserver/Api_Security/Deny_FTP_Tests.robot @@ -115,18 +115,18 @@ SecurityPolicy-Deny-Ftp-00005 Comment 功能端验证 ${starttime} Get Time Sleep ${policyVerificationSleepSeconds}s - ${FTP} FTP_login ftp://192.168.100.5/ -u"ftp_user:qazXSW@edc" english + ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test should contain ${FTP} ftp_fail Sleep ${policyLogVerificationSleepSeconds}s ${endtime} Get Time #日志验证 ${s} Convert to String ${policyId} - GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user + GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt SecurityPolicy-Deny-Ftp-00006 [Tags] selfserver deny ftp url右匹配 Comment 创建url - ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*100.5 + ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*t.txt ${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict} ${objectids} set Variable ${object_url_Id} Comment 创建安全策略 @@ -137,13 +137,13 @@ SecurityPolicy-Deny-Ftp-00006 Comment 功能端验证 ${starttime} Get Time Sleep ${policyVerificationSleepSeconds}s - ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english + ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test should contain ${FTP} ftp_fail Sleep ${policyLogVerificationSleepSeconds}s ${endtime} Get Time #日志验证 ${s} Convert to String ${policyId} - GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user + GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt SecurityPolicy-Deny-Ftp-00007 [Tags] selfserver deny ftp url完整匹配 @@ -159,18 +159,18 @@ SecurityPolicy-Deny-Ftp-00007 Comment 功能端验证 ${starttime} Get Time Sleep ${policyVerificationSleepSeconds}s - ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english + ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test should contain ${FTP} ftp_fail Sleep ${policyLogVerificationSleepSeconds}s ${endtime} Get Time #日志验证 ${s} Convert to String ${policyId} - GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user + GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt SecurityPolicy-Deny-Ftp-00008 [Tags] selfserver deny ftp url左匹配 Comment 创建url - ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=192.168* + ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=192.168.100* ${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict} ${objectids} set Variable ${object_url_Id} Comment 创建安全策略 @@ -181,18 +181,18 @@ SecurityPolicy-Deny-Ftp-00008 Comment 功能端验证 ${starttime} Get Time Sleep ${policyVerificationSleepSeconds}s - ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english + ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test should contain ${FTP} ftp_fail Sleep ${policyLogVerificationSleepSeconds}s ${endtime} Get Time #日志验证 ${s} Convert to String ${policyId} - GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user + GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt SecurityPolicy-Deny-Ftp-00009 [Tags] selfserver deny ftp content子串匹配 Comment 创建content - ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=中文文件 + ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=中文test ${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict} ${objectids} set Variable ${object_content_Id} Comment 创建安全策略 @@ -203,18 +203,18 @@ SecurityPolicy-Deny-Ftp-00009 Comment 功能端验证 ${starttime} Get Time Sleep ${policyVerificationSleepSeconds}s - ${FTP} FTP_login ftp://192.168.100.5/中文文件.txt -u"ftp_user:qazXSW@edc" 中文文件 + ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test should contain ${FTP} ftp_fail Sleep ${policyLogVerificationSleepSeconds}s ${endtime} Get Time #日志验证 ${s} Convert to String ${policyId} - GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/中文文件.txt + GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt SecurityPolicy-Deny-Ftp-00010 [Tags] selfserver deny ftp content右匹配 Comment 创建content - ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=*文件.txt + ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=*test.txt ${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict} ${objectids} set Variable ${object_content_Id} Comment 创建安全策略 @@ -225,18 +225,18 @@ SecurityPolicy-Deny-Ftp-00010 Comment 功能端验证 ${starttime} Get Time Sleep ${policyVerificationSleepSeconds}s - ${FTP} FTP_login ftp://192.168.100.5/中文文件.txt -u"ftp_user:qazXSW@edc" 中文文件 + ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test should contain ${FTP} ftp_fail Sleep ${policyLogVerificationSleepSeconds}s ${endtime} Get Time #日志验证 ${s} Convert to String ${policyId} - GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/中文文件.txt + GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt SecurityPolicy-Deny-Ftp-00011 [Tags] selfserver deny ftp content完整匹配 Comment 创建content - ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=$中文文件.txt + ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=$中文test.txt ${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict} ${objectids} set Variable ${object_content_Id} Comment 创建安全策略 @@ -247,18 +247,18 @@ SecurityPolicy-Deny-Ftp-00011 Comment 功能端验证 ${starttime} Get Time Sleep ${policyVerificationSleepSeconds}s - ${FTP} FTP_login ftp://192.168.100.5/中文文件.txt -u"ftp_user:qazXSW@edc" 中文文件 + ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test should contain ${FTP} ftp_fail Sleep ${policyLogVerificationSleepSeconds}s ${endtime} Get Time #日志验证 ${s} Convert to String ${policyId} - GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/中文文件.txt + GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt SecurityPolicy-Deny-Ftp-00012 [Tags] selfserver deny ftp content左匹配 Comment 创建content - ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=中文文件* + ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=中文te* ${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict} ${objectids} set Variable ${object_content_Id} Comment 创建安全策略 @@ -269,13 +269,13 @@ SecurityPolicy-Deny-Ftp-00012 Comment 功能端验证 ${starttime} Get Time Sleep ${policyVerificationSleepSeconds}s - ${FTP} FTP_login ftp://192.168.100.5/中文文件.txt -u"ftp_user:qazXSW@edc" 中文文件 + ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test should contain ${FTP} ftp_fail Sleep ${policyLogVerificationSleepSeconds}s ${endtime} Get Time #日志验证 ${s} Convert to String ${policyId} - GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/中文文件.txt + GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt SecurityPolicy-Deny-Ftp-00013 [Tags] selfserver deny ftp 多ip+修改 @@ -288,7 +288,7 @@ SecurityPolicy-Deny-Ftp-00013 ${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict} ${objectids} Catenate SEPARATOR=, ${objectids} ${object_Account_Id} Comment 创建content - ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test* + ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=中文te* ${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict} ${objectids} Catenate SEPARATOR=, ${objectids} ${object_content_Id} Comment 创建安全策略 @@ -299,20 +299,20 @@ SecurityPolicy-Deny-Ftp-00013 Comment 功能端验证 ${starttime} Get Time Sleep ${policyVerificationSleepSeconds}s - ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" test + ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test should contain ${FTP} ftp_fail Sleep ${policyLogVerificationSleepSeconds}s ${endtime} Get Time #日志验证 ${s} Convert to String ${policyId} - GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user + GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt Comment 修改策略 ${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00013 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_SOURCE_ADDR,${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT isValid=${1} appObjectIdArray=6 policyId=${policyId} ${rescode} ${policyId} EditPolicy ${policyDict} update Comment 功能端验证 ${starttime} Get Time Sleep ${policyVerificationSleepSeconds}s - ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english + ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test should contain ${FTP} ftp_fail Sleep ${policyLogVerificationSleepSeconds}s ${endtime} Get Time @@ -320,30 +320,26 @@ SecurityPolicy-Deny-Ftp-00013 SecurityPolicy-Deny-Ftp-00014 [Tags] selfserver deny ftp 最大组合 - Comment 创建Account - ${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=ftp_user - ${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict} - ${objectids} set Variable ${object_Account_Id} Comment 创建url - ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=192.168* + ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=168.100 ${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict} - ${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id} + ${objectids} set Variable ${object_url_Id} Comment 创建content - ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test* + ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=中文test ${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict} ${objectids} Catenate SEPARATOR=, ${objectids} ${object_content_Id} Comment 创建安全策略 - ${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00014 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_content_Id}|TSG_FIELD_FTP_CONTENT,${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT,${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appObjectIdArray=6 + ${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00014 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_content_Id}|TSG_FIELD_FTP_CONTENT,${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appObjectIdArray=6 ${rescode} ${policyId} AddPolicy2 ${1} ${policyDict} #删除策略 ${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]} Comment 功能端验证 ${starttime} Get Time Sleep ${policyVerificationSleepSeconds}s - ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english + ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test should contain ${FTP} ftp_fail Sleep ${policyLogVerificationSleepSeconds}s ${endtime} Get Time #日志验证 ${s} Convert to String ${policyId} - GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user + GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt