提交:1、新增安全策略用例2、修改安全策略关键字3、提交离开提示关键字
This commit is contained in:
@@ -153,7 +153,7 @@ SecurityPolicy-Deny-HTTP-Host-Block403ProfileCreate
|
||||
Create-Application-Button
|
||||
ApplicationSearch HTTP
|
||||
Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname}
|
||||
Deny-subaction action=deny subaction=Block code=403 SearchorCreate=Create ProfileName=zdhprofilehtml file=${path}response_pages_files\\Create-ResponsePages-test.html
|
||||
Deny-subaction action=deny subaction=Block code=403 Content=Profile SearchorCreate=Create ProfileName=zdhprofilehtml file=${path}response_pages_files\\Create-ResponsePages-test.html
|
||||
LogSession 1
|
||||
Enabled open
|
||||
Security-Policies-OK
|
||||
@@ -177,7 +177,7 @@ SecurityPolicy-Deny-HTTP-Host-Block403ProfileSearch
|
||||
Create-Application-Button
|
||||
ApplicationSearch HTTP
|
||||
Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname}
|
||||
Deny-subaction action=deny subaction=Block code=403 SearchorCreate=Search ProfileName=zdhprofilehtml
|
||||
Deny-subaction action=deny subaction=Block code=403 Content=Profile SearchorCreate=Search ProfileName=zdhprofilehtml
|
||||
LogSession 1
|
||||
Enabled open
|
||||
Security-Policies-OK
|
||||
@@ -225,7 +225,7 @@ SecurityPolicy-Deny-HTTP-Host-Block404ProfileCreate
|
||||
Create-Application-Button
|
||||
ApplicationSearch HTTP
|
||||
Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname}
|
||||
Deny-subaction action=deny subaction=Block code=404 SearchorCreate=Create ProfileName=zdhprofilehtml file=${path}response_pages_files\\Create-ResponsePages-test.html
|
||||
Deny-subaction action=deny subaction=Block code=404 Content=Profile SearchorCreate=Create ProfileName=zdhprofilehtml file=${path}response_pages_files\\Create-ResponsePages-test.html
|
||||
LogSession 1
|
||||
Enabled open
|
||||
Security-Policies-OK
|
||||
@@ -249,8 +249,108 @@ SecurityPolicy-Deny-HTTP-Host-Block404ProfileSearch
|
||||
Create-Application-Button
|
||||
ApplicationSearch HTTP
|
||||
Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname}
|
||||
Deny-subaction action=deny subaction=Block code=404 SearchorCreate=Search ProfileName=zdhprofilehtml
|
||||
Deny-subaction action=deny subaction=Block code=404 Content=Profile SearchorCreate=Search ProfileName=zdhprofilehtml
|
||||
LogSession 1
|
||||
Enabled open
|
||||
Security-Policies-OK
|
||||
|
||||
SecurityPolicy-Deny-HTTP-Host-Alert200TEXT
|
||||
#新建对象fqdn
|
||||
Comment 新建对象fqdn
|
||||
CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com
|
||||
#新建策略
|
||||
Comment 新建策略
|
||||
Menu policys Security Policy
|
||||
SecurityPolicy.CreateButton
|
||||
SecurityPolicy.Create-name SecurityPolicy-Deny-HTTP-MaxCombination
|
||||
SecurityPolicy.Create-action deny
|
||||
SecurityPolicy.Create-Source-Button
|
||||
SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1
|
||||
#SecurityPolicy.Create-Destination-Button
|
||||
#SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1
|
||||
${hostname} create list zdhfqdn
|
||||
${filter} create list Host
|
||||
Create-Application-Button
|
||||
ApplicationSearch HTTP
|
||||
Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname}
|
||||
Deny-subaction action=deny subaction=Alert code=200 Content=TEXT block-text=123456
|
||||
LogSession 1
|
||||
Enabled open
|
||||
Security-Policies-OK
|
||||
|
||||
SecurityPolicy-Deny-HTTP-Host-Alert200ProfileCreate
|
||||
#新建对象fqdn
|
||||
Comment 新建对象fqdn
|
||||
CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com
|
||||
#新建策略
|
||||
Comment 新建策略
|
||||
Menu policys Security Policy
|
||||
SecurityPolicy.CreateButton
|
||||
SecurityPolicy.Create-name SecurityPolicy-Deny-HTTP-MaxCombination
|
||||
SecurityPolicy.Create-action deny
|
||||
SecurityPolicy.Create-Source-Button
|
||||
SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1
|
||||
#SecurityPolicy.Create-Destination-Button
|
||||
#SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1
|
||||
${hostname} create list zdhfqdn
|
||||
${filter} create list Host
|
||||
Create-Application-Button
|
||||
ApplicationSearch HTTP
|
||||
Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname}
|
||||
Deny-subaction action=deny subaction=Alert code=200 Content=Profile SearchorCreate=Create ProfileName=zdhprofilehtml file=${path}response_pages_files\\Create-ResponsePages-test.html
|
||||
LogSession 1
|
||||
Enabled open
|
||||
Security-Policies-OK
|
||||
|
||||
SecurityPolicy-Deny-HTTP-Host-Alert200ProfileSearch
|
||||
#新建对象fqdn
|
||||
Comment 新建对象fqdn
|
||||
CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com
|
||||
#新建策略
|
||||
Comment 新建策略
|
||||
Menu policys Security Policy
|
||||
SecurityPolicy.CreateButton
|
||||
SecurityPolicy.Create-name SecurityPolicy-Deny-HTTP-MaxCombination
|
||||
SecurityPolicy.Create-action deny
|
||||
SecurityPolicy.Create-Source-Button
|
||||
SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1
|
||||
#SecurityPolicy.Create-Destination-Button
|
||||
#SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1
|
||||
${hostname} create list zdhfqdn
|
||||
${filter} create list Host
|
||||
Create-Application-Button
|
||||
ApplicationSearch HTTP
|
||||
Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname}
|
||||
Deny-subaction action=deny subaction=Alert code=200 Content=Profile SearchorCreate=Search ProfileName=zdhprofilehtml
|
||||
LogSession 1
|
||||
Enabled open
|
||||
Security-Policies-OK
|
||||
|
||||
SecurityPolicy-Deny-HTTP-Host-Alert204
|
||||
#新建对象fqdn
|
||||
Comment 新建对象fqdn
|
||||
CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com
|
||||
#新建策略
|
||||
Comment 新建策略
|
||||
Menu policys Security Policy
|
||||
SecurityPolicy.CreateButton
|
||||
SecurityPolicy.Create-name SecurityPolicy-Deny-HTTP-MaxCombination
|
||||
SecurityPolicy.Create-action deny
|
||||
SecurityPolicy.Create-Source-Button
|
||||
SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1
|
||||
#SecurityPolicy.Create-Destination-Button
|
||||
#SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1
|
||||
${hostname} create list zdhfqdn
|
||||
${filter} create list Host
|
||||
Create-Application-Button
|
||||
ApplicationSearch HTTP
|
||||
Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname}
|
||||
Deny-subaction action=deny subaction=Alert code=204
|
||||
LogSession 1
|
||||
Enabled open
|
||||
Security-Policies-OK
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ Library Selenium2Library
|
||||
|
||||
*** Keywords ***
|
||||
Menu
|
||||
[Arguments] ${menuOne} ${menuTwo}
|
||||
[Arguments] ${menuOne} ${menuTwo} ${OkorCancel}=OK
|
||||
Wait Until Element Is Enabled id=children0 10
|
||||
# 一级菜单
|
||||
${dict} create dictionary dashboard=children0 policys=children1 objects=children2 log=children3 report=children4 device=children5 settings=children6 administration=children7
|
||||
@@ -17,10 +17,37 @@ Menu
|
||||
FOR ${list} ${num} IN ENUMERATE @{dict}
|
||||
run keyword if "${num}"=="${menuOne}" run keywords sleep 5
|
||||
... AND click element id=${dict}[${num}]
|
||||
... AND LeavePrompt ${OkorCancel}
|
||||
END
|
||||
# 遍历二级菜单
|
||||
FOR ${list} ${num} IN ENUMERATE @{${menuOne}}
|
||||
run keyword if "${num}"=="dashboard" Exit For Loop
|
||||
... ELSE IF "${num}"=="${menuTwo}" run keywords sleep 3
|
||||
... AND click element id=${${menuOne}}[${num}]
|
||||
... AND LeavePrompt ${OkorCancel}
|
||||
END
|
||||
|
||||
LeavePrompt
|
||||
[Arguments] ${OkorCancel}
|
||||
[Documentation] 调用次关键字前需要添加必填参数:
|
||||
... ${OkorCancel}:填入OK或Cancel
|
||||
sleep 1
|
||||
${status} Run Keyword And Return Status Page Should Contain Changes you made are not saved. #判断页面是否包含该文本
|
||||
sleep 1
|
||||
run keyword if "${status}"=="True" Existence ${OkorCancel}
|
||||
run keyword if "${status}"=="False" log go on
|
||||
Existence
|
||||
[Arguments] ${OkorCancel}
|
||||
[Documentation] 调用次关键字前需要添加必填参数:
|
||||
... ${OkorCancel}:填入OK或Cancel
|
||||
${style}= Get Element Attribute xpath=//div[@class="el-message-box__wrapper"] style
|
||||
${c} Evaluate "display: none" in """${style}"""
|
||||
run keyword if "${c}"=="False" ClickOkorCancel ${OkorCancel}
|
||||
run keyword if "${c}"=="True" log go on
|
||||
ClickOkorCancel
|
||||
[Arguments] ${OkorCancel}
|
||||
[Documentation] 调用次关键字前需要添加必填参数:
|
||||
... ${OkorCancel}:填入OK或Cancel
|
||||
sleep 1
|
||||
run keyword if "${OkorCancel}"=="OK" click element xpath=//button[@class='el-button el-button--default el-button--small el-button--primary ']
|
||||
run keyword if "${OkorCancel}"=="Cancel" click element xpath=/html/body/div/div/div[3]/button[1]
|
||||
@@ -37,11 +37,11 @@ Create-Source-Button
|
||||
|
||||
Create-Destination-Button
|
||||
[Documentation] 点击Destination的加号
|
||||
sleep 2
|
||||
Wait Until Element Is Enabled xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[1]/div/div 10
|
||||
click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[1]/div/div
|
||||
Create-Application-Button
|
||||
[Documentation] 点击Application的加号
|
||||
sleep 2
|
||||
Wait Until Element Is Enabled id=interceptionadd_application 10
|
||||
click element id=interceptionadd_application
|
||||
|
||||
ApplicationSearch
|
||||
@@ -196,14 +196,20 @@ Deny-Block
|
||||
click element id=denyUserRegionBlock_code
|
||||
run keyword if "${code}"=="403" or "${code}"=="200" run keywords sleep 1
|
||||
... AND click element id=denyUserRegionBlock_code_select0
|
||||
... ELSE IF "${code}"=="404" or "${code}"=="204" run keywords sleep 1
|
||||
... AND sleep 1
|
||||
... AND click element id=blockselect
|
||||
... ELSE IF "${code}"=="404" run keywords sleep 1
|
||||
... AND click element id=denyUserRegionBlock_code_select1
|
||||
... AND sleep 1
|
||||
... AND click element id=blockselect
|
||||
... ELSE IF "${code}"=="204" run keywords sleep 1
|
||||
... AND click element id=denyUserRegionBlock_code_select1
|
||||
run keyword if "${Content}"=="TEXT" run keywords sleep 1
|
||||
... AND click element id=blockselect_select0
|
||||
... AND sleep 1
|
||||
... AND input text id=denyUserRegionBlock_message ${block-text}
|
||||
... ELSE IF "${Content}"=="Profile" run keywords sleep 1
|
||||
... AND click element id=html_profile
|
||||
... AND click element id=blockselect_select1
|
||||
... AND sleep 1
|
||||
... AND Profile-SearchorCreate ${SearchorCreate} ${ProfileName} ${file}
|
||||
Profile-SearchorCreate
|
||||
@@ -546,20 +552,20 @@ Create-Source
|
||||
... ${object_name}:列表形式,列表中是对象的名字
|
||||
... ${keywordtext}:填入新建subid的内容
|
||||
... 判断新建source选择用什么样的类型数据
|
||||
run keyword if "${type1}"=="Ip" run keywords sleep 1
|
||||
run keyword if "${type1}"=="Ip" run keywords sleep 2
|
||||
... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[1]
|
||||
... AND sleep 1
|
||||
... AND sleep 1
|
||||
... AND SourceIPCreateOrSearch ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
|
||||
... ELSE IF "${type1}"=="SUBID" run keywords sleep 1
|
||||
... ELSE IF "${type1}"=="SUBID" run keywords sleep 2
|
||||
... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[2]
|
||||
... AND sleep 1
|
||||
... AND SUBIDCreateOrSearch ${name} ${keywordtext} ${object_name}
|
||||
... ELSE IF "${type1}"=="Geography" run keywords sleep 1
|
||||
... ELSE IF "${type1}"=="Geography" run keywords sleep 2
|
||||
... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[3]
|
||||
... AND sleep 1
|
||||
... AND SourceIPCreateOrSearch ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
|
||||
... ELSE IF "${type1}"=="IPLearning" run keywords sleep 1
|
||||
... ELSE IF "${type1}"=="IPLearning" run keywords sleep 2
|
||||
... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[4]
|
||||
... AND sleep 1
|
||||
... AND SourceIPCreateOrSearch ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
|
||||
@@ -787,6 +793,7 @@ SourceIPAddress
|
||||
... AND sleep 1
|
||||
... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[5]/div/div[1]/input ${limits}
|
||||
... AND sleep 1
|
||||
sleep 1
|
||||
SourceCreate-ok
|
||||
|
||||
DestinationIPAdd
|
||||
@@ -873,7 +880,7 @@ Learning-Depth
|
||||
run keyword if "${Degree}"=="2Degree" run keywords sleep 1
|
||||
... AND click element xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[2]/div/div/label[2]
|
||||
|
||||
IPGroupAdd
|
||||
SourceIPGroupAdd
|
||||
[Arguments] ${name} ${ip_type} ${object_name}
|
||||
[Documentation] 调用次关键字前需要添加必填参数:
|
||||
... ${name}:名称
|
||||
|
||||
Reference in New Issue
Block a user