Replace Deny_FTP_Tests.robot

This commit is contained in:
姬巍川
2020-05-13 17:27:43 +08:00
parent 2861fd42b1
commit bf78d75754

View File

@@ -115,7 +115,7 @@ SecurityPolicy-Deny-Ftp-00005
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/ -u"ftp_user:qazXSW@edc" test.txt
${FTP} FTP_login ftp://192.168.100.5/ -u"ftp_user:qazXSW@edc" english
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
@@ -137,7 +137,7 @@ SecurityPolicy-Deny-Ftp-00006
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/ -u"ftp_user:qazXSW@edc" test.txt
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
@@ -159,7 +159,7 @@ SecurityPolicy-Deny-Ftp-00007
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5 -u"ftp_user:qazXSW@edc" test.txt
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
@@ -181,7 +181,7 @@ SecurityPolicy-Deny-Ftp-00008
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5 -u"ftp_user:qazXSW@edc" test.txt
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
@@ -192,7 +192,7 @@ SecurityPolicy-Deny-Ftp-00008
SecurityPolicy-Deny-Ftp-00009
[Tags] selfserver deny ftp content子串匹配
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=中文文件
${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/ -u"ftp_user:qazXSW@edc" test.txt
${FTP} FTP_login ftp://192.168.100.5/中文文件.txt -u"ftp_user:qazXSW@edc" 中文文件
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/中文文件.txt
SecurityPolicy-Deny-Ftp-00010
[Tags] selfserver deny ftp content右匹配
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=*t.txt
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=*文件.txt
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_content_Id}
Comment 创建安全策略
@@ -225,13 +225,13 @@ SecurityPolicy-Deny-Ftp-00010
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/ -u"ftp_user:qazXSW@edc" test.txt
${FTP} FTP_login ftp://192.168.100.5/中文文件.txt -u"ftp_user:qazXSW@edc" 中文文件
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/中文文件.txt
SecurityPolicy-Deny-Ftp-00011
[Tags] selfserver deny ftp content完整匹配
@@ -247,18 +247,18 @@ SecurityPolicy-Deny-Ftp-00011
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5 -u"ftp_user:qazXSW@edc" 中文文件.txt
${FTP} FTP_login ftp://192.168.100.5/中文文件.txt -u"ftp_user:qazXSW@edc" 中文文件
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/中文文件.txt
SecurityPolicy-Deny-Ftp-00012
[Tags] selfserver deny ftp content左匹配
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test*
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=中文文件*
${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 -u"ftp_user:qazXSW@edc" test.txt
${FTP} FTP_login ftp://192.168.100.5/中文文件.txt -u"ftp_user:qazXSW@edc" 中文文件
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/中文文件.txt
SecurityPolicy-Deny-Ftp-00013
[Tags] selfserver deny ftp 多ip+修改
@@ -299,7 +299,7 @@ SecurityPolicy-Deny-Ftp-00013
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5 -u"ftp_user:qazXSW@edc" test.txt
${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
@@ -312,7 +312,7 @@ SecurityPolicy-Deny-Ftp-00013
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5 -u"ftp_user:qazXSW@edc" test.txt
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
@@ -340,29 +340,7 @@ SecurityPolicy-Deny-Ftp-00014
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5 -u"ftp_user:qazXSW@edc" test.txt
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
SecurityPolicy-Deny-Ftp-00015
[Tags] selfserver deny ftp account子串匹配
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 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00013 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT 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_down ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 435814 zmmtext123.txt
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time