提交安全策略关键字

This commit is contained in:
lyf
2021-01-25 18:41:02 +08:00
parent 66c81865c8
commit 328c284496

View File

@@ -49,13 +49,254 @@ ApplicationSearch
[Documentation] 调用次关键字前需要添加必填参数:
... ${Application}:填入是Application的内容例如SSL或HTTP
... 选择search对象
input text xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[5]/div[2]/div[2]/div/div[1]/input ${i}
input text xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[5]/div[2]/div[2]/div/div[1]/input ${Application}
sleep 1
press keys xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[5]/div[2]/div[2]/div/div[1]/input ENTER
sleep 1
click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[5]/div[2]/div[2]/div/div[2]/div/div/ul/li[1]
sleep 1
Create-Filter-judge
[Arguments] ${Application} ${Filter} ${Hostname} ${URLname} ${Request Headername} ${Response Headername} ${Request Contentname}
... ${Response Contentname} ${SSLSNIname} ${CNname} ${SANname} ${QNAMEname} ${Subjectname} ${MAILContentname} ${Attachment Namename}
... ${Attachment Contentname} ${Fromname} ${Toname} ${MAILAccountname} ${URIname} ${FTPContentname} ${FTPAccountname} ${QUICSNIname}
[Documentation] 调用次关键字前需要添加必填参数:
... ${Application}:填入是Application的内容例如SSL或HTTP
... ${Filter}:是一个列表列表中填入filter类型例如Host或URL等
... name:各个对象名称的列表
... 判断filter是否可以点击
${class}= Get Element Attribute xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[8]/div[1]/div/div[1] class
run keyword if "${class}"=="addobject addobject-long-list obj-content-null filter-width-style cursor addobject-long-list-disabled" log filter不可点击不可添加filter
run keyword if "${class}"=="addobject addobject-long-list obj-content-null filter-width-style cursor" run keywords sleep 1
... AND click element Create-Filter ${Application} ${Filter} ${Hostname} ${URLname} ${Request Headername} ${Response Headername} ${Request Contentname}
... ${Response Contentname} ${SSLSNIname} ${CNname} ${SANname} ${QNAMEname} ${Subjectname} ${MAILContentname} ${Attachment Namename}
... ${Attachment Contentname} ${Fromname} ${Toname} ${MAILAccountname} ${URIname} ${FTPContentname} ${FTPAccountname} ${QUICSNIname}
Create-Filter
[Arguments] ${Application} ${Filter} ${Hostname} ${URLname} ${Request Headername} ${Response Headername} ${Request Contentname}
... ${Response Contentname} ${SSLSNIname} ${CNname} ${SANname} ${QNAMEname} ${Subjectname} ${MAILContentname} ${Attachment Namename}
... ${Attachment Contentname} ${Fromname} ${Toname} ${MAILAccountname} ${URIname} ${FTPContentname} ${FTPAccountname} ${QUICSNIname}
[Documentation] 调用次关键字前需要添加必填参数:
... ${Application}:填入是Application的内容例如SSL或HTTP
... ${Filter}:是一个列表列表中填入filter类型例如Host或URL等
... name:各个对象名称的列表
... 判断添加filter类型
sleep 2
FOR ${i} IN @{Filter}
sleep 1
click element id=interceptionadd_add_filter
sleep 1
run keyword if "${Application}"=="HTTP" and "${i}"=="Host" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1]
... AND Create-Object-Search ${Hostname} ${i}
run keyword if "${Application}"=="HTTP" and "${i}"=="URL" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[2]
... AND Create-Object-Search ${URLname} ${i}
run keyword if "${Application}"=="HTTP" and "${i}"=="Request Header" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[3]
... AND Create-Object-Search ${Request Headername} ${i}
run keyword if "${Application}"=="HTTP" and "${i}"=="Response Header" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[4]
... AND Create-Object-Search ${Response Headername} ${i}
run keyword if "${Application}"=="HTTP" and "${i}"=="Request Content" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[5]
... AND Create-Object-Search ${Request Contentname} ${i}
run keyword if "${Application}"=="HTTP" and "${i}"=="Response Content" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[6]
... AND Create-Object-Search ${Response Contentname} ${i}
run keyword if "${Application}"=="SSL" and "${i}"=="SNI" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1]
... AND Create-Object-Search ${SSLSNIname} ${i}
run keyword if "${Application}"=="SSL" and "${i}"=="CN" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[2]
... AND Create-Object-Search ${CNname} ${i}
run keyword if "${Application}"=="SSL" and "${i}"=="SAN" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[3]
... AND Create-Object-Search ${SANname} ${i}
run keyword if "${Application}"=="DNS" and "${i}"=="QNAME" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1]
... AND Create-Object-Search ${QNAMEname} ${i}
run keyword if "${Application}"=="MAIL" and "${i}"=="Subject" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1]
... AND Create-Object-Search ${Subjectname} ${i}
run keyword if "${Application}"=="MAIL" and "${i}"=="Content" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[2]
... AND Create-Object-Search ${MAILContentname} ${i}
run keyword if "${Application}"=="MAIL" and "${i}"=="Attachment Name" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[3]
... AND Create-Object-Search ${Attachment Namename} ${i}
run keyword if "${Application}"=="MAIL" and "${i}"=="Attachment Content" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[4]
... AND Create-Object-Search ${Attachment Contentname} ${i}
run keyword if "${Application}"=="MAIL" and "${i}"=="From" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[5]
... AND Create-Object-Search ${Fromname} ${i}
run keyword if "${Application}"=="MAIL" and "${i}"=="To" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[6]
... AND Create-Object-Search ${Toname} ${i}
run keyword if "${Application}"=="MAIL" and "${i}"=="Account" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[7]
... AND Create-Object-Search ${MAILAccountname} ${i}
run keyword if "${Application}"=="FTP" and "${i}"=="URI" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1]
... AND Create-Object-Search ${URIname} ${i}
run keyword if "${Application}"=="FTP" and "${i}"=="Content" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[2]
... AND Create-Object-Search ${FTPContentname} ${i}
run keyword if "${Application}"=="FTP" and "${i}"=="Account" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[3]
... AND Create-Object-Search ${FTPAccountname} ${i}
run keyword if "${Application}"=="QUIC" and "${i}"=="SNI" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1]
... AND Create-Object-Search ${QUICSNIname} ${i}
END
Deny-subaction
[Arguments] ${action} ${subaction} ${code} ${Content} ${block-text} ${SearchorCreate} ${ProfileName} ${file} ${QType} ${Avalue} ${Attl} ${CNAMEvalue} ${CNAMEttl}
[Documentation] 调用次关键字前需要添加必填参数:
... ${code}:填入403或404
... ${Content}:填入TEXT或Profile
... ${SearchorCreate}:填入Search或Create
... ${block-text}:填入TEXT文本框内容
... ${ProfileName}:Profile的名字
... ${file}:上传文件路径
... ${QType}:填入A或AAAA
... ${Avalue}:根据${QType}填入IPV4或IPV6的值
... ${Attl}:根据${QType}填入A的ttl值或AAAA的ttl值
... ${CNAMEvalue}:根据${QType}填入A的CNAME的域名值或AAAA的CNAME域名值
... ${CNAMEttl}:根据${QType}填入A的CNAME的ttl值或AAAA的CNAME的ttl值
... 添加subaction
run keyword if "${action}"=="deny" and "${subaction}"=="Drop" run keywords sleep 1
... AND click element id=denyUserRegionBlock_method0
run keyword if "${action}"=="deny" and "${subaction}"=="RST" run keywords sleep 1
... AND click element id=denyUserRegionBlock_method1
run keyword if "${action}"=="deny" and "${subaction}"=="Block" run keywords sleep 1
... AND click element id=denyUserRegionBlock_method2
... AND Deny-Block ${code} ${Content} ${block-text} ${SearchorCreate} ${ProfileName} ${file}
run keyword if "${action}"=="deny" and "${subaction}"=="Alert" run keywords sleep 1
... AND click element id=denyUserRegionBlock_method3
... AND Deny-Block ${code} ${Content} ${block-text} ${SearchorCreate} ${ProfileName} ${file}
run keyword if "${action}"=="deny" and "${subaction}"=="Redirect" run keywords sleep 1
... AND click element id=denyUserRegionBlock_method4
... AND sleep 1
... AND click element id=interceptionadd_rightdetails
... AND sleep 1
... AND Deny-Redirect ${QType} ${Avalue} ${Attl} ${CNAMEvalue} ${CNAMEttl}
Deny-Block
[Arguments] ${code} ${Content} ${block-text} ${SearchorCreate} ${ProfileName} ${file}
[Documentation] 调用次关键字前需要添加必填参数:
... ${code}:填入403或404
... ${Content}:填入TEXT或Profile
... ${SearchorCreate}:填入Search或Create
... ${block-text}:填入TEXT文本框内容
... ${ProfileName}:Profile的名字
... ${file}:上传文件路径
... 添加block数据内容
sleep 1
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 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 sleep 1
... AND Profile-SearchorCreate ${SearchorCreate} ${ProfileName} ${file}
Profile-SearchorCreate
[Arguments] ${SearchorCreate} ${ProfileName} ${file}
[Documentation] 调用次关键字前需要添加必填参数:
... ${SearchorCreate}:填入Search或Create
... ${ProfileName}:Profile的名字
... ${file}:上传文件路径
... 判断是新建还是搜索profile
sleep 1
run keyword if "${SearchorCreate}"=="Search" run keywords sleep 1
... AND input text id=filedata_profileName ${ProfileName}
... AND sleep 1
... AND press keys id=filedata_profileName
... AND sleep 1
... AND click element id=filelist_select0
... ELSE IF "${SearchorCreate}"=="Create" run keywords sleep 1
... AND click element id=interceptionadd_fileadd
... AND sleep 1
... AND input text id=responsepages_profileName ${ProfileName}
... AND sleep 1
... AND Choose File xpath=//*[@id="policy_Manipulation_create6"]/div[2]/form/div[2]/div/div/div/input ${file} #上传文件
... AND sleep 1
... AND clcik element id=responseAddOk1
... ELSE log 传入参数错误
Deny-Redirect
[Arguments] ${QType} ${Avalue} ${Attl} ${CNAMEvalue} ${CNAMEttl}
[Documentation] 调用次关键字前需要添加必填参数:
... ${QType}:填入A或AAAA
... ${Avalue}:根据${QType}填入IPV4或IPV6的值
... ${Attl}:根据${QType}填入A的ttl值或AAAA的ttl值
... ${CNAMEvalue}:根据${QType}填入A的CNAME的域名值或AAAA的CNAME域名值
... ${CNAMEttl}:根据${QType}填入A的CNAME的ttl值或AAAA的CNAME的ttl值
... 新建Redirect
run keyword if "${QType}"=="A" run keywords sleep 1
... AND input text id=A00 ${Avalue}
... AND sleep 1
... AND input text id=ttl00 ${Attl}
... AND sleep 1
... AND click element id=interceptionadd_addForm
... AND sleep 1
... AND input text id=Cname01 ${CNAMEvalue}
... AND sleep 1
... AND input text id=ttl01 ${CNAMEttl}
run keyword if "${QType}"=="AAAA" run keywords sleep 1
... AND click element id=dns_qtype_radio01
... AND input text id=AAAA00 ${Avalue}
... AND sleep 1
... AND input text id=ttl00 ${Attl}
... AND sleep 1
... AND click element id=interceptionadd_addForm
... AND sleep 1
... AND input text id=Cname01 ${CNAMEvalue}
... AND sleep 1
... AND input text id=ttl01 ${CNAMEttl}
sleep 1
click element id=interceptionadd_shezhidns
LogSession
[Arguments] ${LogSession}
[Documentation] 调用次关键字前需要添加必填参数:
... ${LogSession}:填入clcos或其他
run keyword if "${LogSession}"=="close" run keywords sleep 1
... AND click element id=addlabel_labels_log
... ELSE log 开启日志
Enabled
[Arguments] ${Enabled}
[Documentation] 调用次关键字前需要添加必填参数:
... ${Enabled}:填入open或其他
run keyword if "${Enabled}"=="open" run keywords sleep 1
... AND click element id=enablencheck
... AND sleep 1
... AND click element xpath=/html/body/div[6]/div/div[3]/button[2]
... ELSE log 开启日志
Security-Policies-OK
sleep 1
click element id=interceptionadd_sub
Create-Object-Search
[Arguments] ${name} ${filter}
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:填入是一个列表列表内容为object的name
... 选择search对象
sleep 1
click element xpath=//*[@id="policy_paper_left"]/div[8]/div[1]/div[1]/label[contains(text(), "${filter}")]/following-sibling::div/div
sleep 1
FOR ${i} IN @{name}
input text xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[1]/input ${i}
sleep 1
press keys xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[1]/input ENTER
sleep 1
click element xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[2]/div/div/ul/li[1]
sleep 1
END
Create-Source
[Arguments] ${type1}=null ${CreateOrSearch}=null ${Add}=null ${name}=null
... ${object_name}=null ${ipclienttext1}=null ${post}=null ${Country}=null ${City}=null
@@ -220,6 +461,7 @@ DestinationSearch
click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[1]/div[2]/div[2]/div/div[2]/div/div/ul/li[1]
sleep 1
END
SUBIDAdd
[Arguments] ${Add} ${name} ${keywordtext} ${object_name}
[Documentation] 调用次关键字前需要添加必填参数:
@@ -268,11 +510,11 @@ SourceIPAdd
run keyword if "${Add}"=="Address" run keywords sleep 1
... AND click element xpath=/html/body/ul/li[1]
... AND sleep 1
... AND IPAddress ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
... AND SourceIPAddress ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
... ELSE IF "${Add}"=="Group" run keywords sleep 1
... AND click element xpath=/html/body/ul/li[2]
... AND sleep 1
... AND IPGroupAdd ${name} ${ip_type} ${object_name}
... AND SourceIPGroupAdd ${name} ${ip_type} ${object_name}
SourceIPAddress
[Arguments] ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
[Documentation] 调用次关键字前需要添加必填参数:
@@ -436,6 +678,8 @@ DestinationCreate-ok
click button xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[2]/button[1]
Create-Conditions
sleep 2