diff --git a/01-TestCase/tsg_ui/ui_security/Security.robot b/01-TestCase/tsg_ui/ui_security/Security.robot index b480c3d..e854214 100644 --- a/01-TestCase/tsg_ui/ui_security/Security.robot +++ b/01-TestCase/tsg_ui/ui_security/Security.robot @@ -1,5 +1,7 @@ *** Settings *** -Force Tags tsg-ui objects tags +Test Teardown run keywords Delete-Security-estimate ${PolicyName} +... AND Delete-object-estimate ${ObjName} +Force Tags tsg-ui objects security Resource ../../../02-Keyword/tsg_ui/securityPolicy/SecurityPolicy.robot Library OperatingSystem Resource ../../../02-Keyword/tsg_ui/Menu.robot @@ -7,14 +9,13 @@ Resource ../../../02-Keyword/tsg_ui/objects/NewObjectPages.robot Resource ../../../02-Keyword/tsg_ui/objects/NewObject.robot Resource ../../../03-Variable/bifangapivariable.txt - *** Test Cases *** SecurityPolicy-Deny-HTTP-MaxCombination-Drop #新建对象fqdn Comment 新建对象fqdn CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com #新建对象url - Comment 新建对象url + Comment 新建对象url CreatePage URL single zdhurl keywordtext=*.com #新建Request Header Comment Request Header @@ -42,548 +43,530 @@ SecurityPolicy-Deny-HTTP-MaxCombination-Drop 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 + ${ipname} create list zdhip001 zdhip001 ${hostname} create list zdhfqdn ${urlname} create list zdhurl ${RequestHeadername} create list zdhreqck zdhrequa ${ResponseHeadername} create list zdhressck zdhresct ${RequestContentname} create list zdhreqcontent + ${ObjName} create dictionary FQDN=${hostname} URL=${urlname} HTTPSignature=${RequestHeadername} HTTPSignature=${ResponseHeadername} Key=${RequestContentname} IP=${ipname} + ${PolicyName} set variable SecurityPolicy-Deny-HTTP-MaxCombination ${filter} create list Host URL Request Header Response Header Request Content Create-Application-Button ApplicationSearch HTTP - Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname} URLname=${urlname} Request Headername=${RequestHeadername} - ... Response Headername=${ResponseHeadername} Request Contentname=${RequestContentname} + Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname} URLname=${urlname} Request Headername=${RequestHeadername} Response Headername=${ResponseHeadername} + ... Request Contentname=${RequestContentname} Deny-subaction action=deny subaction=Drop LogSession 1 Enabled open Security-Policies-OK sleep 1 - #修改策略,修改策略相当于再进行一遍新增 - Comment 修改策略 + # #修改策略,修改策略相当于再进行一遍新增 + # Comment 修改策略 + # Security-Source Name SecurityPolicy-Deny-HTTP-MaxCombination + # EditButton + # Initialize-Policie Deny + # #新建策略 + # SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop + # SecurityPolicy.Create-action deny + # SecurityPolicy.Create-Source-Button + # SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.2 post=1 + # SecurityPolicy.Create-Destination-Button + # SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.3 post=1 + # ${fqdnname} create list zdhfqdn + # ${filter} create list SNI CN SAN + # Create-Application-Button + # ApplicationSearch SSL + # Create-Filter-judge Application=SSL Filter=${filter} SSLSNIname=${fqdnname} CNname=${fqdnname} SANname=${fqdnname} + # Deny-subaction action=deny subaction=RST + # LogSession 1 + # Enabled open + # Security-Policies-OK Security-Source Name SecurityPolicy-Deny-HTTP-MaxCombination - EditButton - Initialize-Policie Deny - #新建策略 - SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop - SecurityPolicy.Create-action deny - SecurityPolicy.Create-Source-Button - SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.2 post=1 - SecurityPolicy.Create-Destination-Button - SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.3 post=1 - ${fqdnname} create list zdhfqdn - ${filter} create list SNI CN SAN - Create-Application-Button - ApplicationSearch SSL - Create-Filter-judge Application=SSL Filter=${filter} SSLSNIname=${fqdnname} CNname=${fqdnname} SANname=${fqdnname} - Deny-subaction action=deny subaction=RST - LogSession 1 - Enabled open - Security-Policies-OK - Security-Source Name SecurityPolicy-Deny-SSL-MaxCombination-Drop ${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/p - Should Be Equal As Strings ${text} SecurityPolicy-Deny-SSL-MaxCombination-Drop + Should Be Equal As Strings ${text} SecurityPolicy-Deny-HTTP-MaxCombination -SecurityPolicy-Deny-HTTP-MaxCombination-RST - #新建对象fqdn - Comment 新建对象fqdn - CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com - #新建对象url - Comment 新建对象url - CreatePage URL single zdhurl keywordtext=*.com - #新建Request Header - Comment Request Header - #新建cookie - CreatePage HTTPSignature single zdhreqck reqrestype=req reqresheader=ck keywordtext=1234@#% - #新建ua - CreatePage HTTPSignature single zdhrequa reqrestype=req reqresheader=ua keywordtext=*скрипцияк - #新建Response Header - Comment Response Header - #新建set cookie - CreatePage HTTPSignature single zdhressck reqrestype=res reqresheader=sck keywordtext=1234@#% - #新建ct - CreatePage HTTPSignature single zdhresct reqrestype=res reqresheader=ct keywordtext=text* - #新建Request Content - Comment Request Content - #新建Request Content - CreatePage Key single zdhreqcontent keywordtext=*pppp - #Response Content - Comment Response Content - #新建Response Content - CreatePage Key single zdhrescontent keywordtext=*pppp - #新建策略 - 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 - ${urlname} create list zdhurl - ${RequestHeadername} create list zdhreqck zdhrequa - ${ResponseHeadername} create list zdhressck zdhresct - ${RequestContentname} create list zdhreqcontent - ${ResponseContentname} create list zdhrescontent - ${filter} create list Host URL Request Header Response Header Request Content - Create-Application-Button - ApplicationSearch HTTP - Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname} URLname=${urlname} Request Headername=${RequestHeadername} - ... Response Headername=${ResponseHeadername} Request Contentname=${RequestContentname} Response Contentname=${ResponseContentname} - Deny-subaction action=deny subaction=RST - LogSession 1 - Enabled open - Security-Policies-OK - -SecurityPolicy-Deny-HTTP-Host-Block403TEXT - #新建对象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=Block code=403 Content=TEXT block-text=123456 - LogSession 1 - Enabled open - Security-Policies-OK - -SecurityPolicy-Deny-HTTP-Host-Block403ProfileCreate - #新建对象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=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 - -SecurityPolicy-Deny-HTTP-Host-Block403ProfileSearch - #新建对象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=Block code=403 Content=Profile SearchorCreate=Search ProfileName=zdhprofilehtml - LogSession 1 - Enabled open - Security-Policies-OK - -SecurityPolicy-Deny-HTTP-Host-Block404TEXT - #新建对象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=Block code=404 Content=TEXT block-text=123456 - LogSession 1 - Enabled open - Security-Policies-OK - -SecurityPolicy-Deny-HTTP-Host-Block404ProfileCreate - #新建对象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=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 - -SecurityPolicy-Deny-HTTP-Host-Block404ProfileSearch - #新建对象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=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 - +#一下用例没有进行Teardown清理,可以根据上面用例完善一下 +# SecurityPolicy-Deny-HTTP-MaxCombination-RST + # #新建对象fqdn + # Comment 新建对象fqdn + # CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + # #新建对象url + # Comment 新建对象url + # CreatePage URL single zdhurl keywordtext=*.com + # #新建Request Header + # Comment Request Header + # #新建cookie + # CreatePage HTTPSignature single zdhreqck reqrestype=req reqresheader=ck keywordtext=1234@#% + # #新建ua + # CreatePage HTTPSignature single zdhrequa reqrestype=req reqresheader=ua keywordtext=*скрипцияк + # #新建Response Header + # Comment Response Header + # #新建set cookie + # CreatePage HTTPSignature single zdhressck reqrestype=res reqresheader=sck keywordtext=1234@#% + # #新建ct + # CreatePage HTTPSignature single zdhresct reqrestype=res reqresheader=ct keywordtext=text* + # #新建Request Content + # Comment Request Content + # #新建Request Content + # CreatePage Key single zdhreqcontent keywordtext=*pppp + # #Response Content + # Comment Response Content + # #新建Response Content + # CreatePage Key single zdhrescontent keywordtext=*pppp + # #新建策略 + # 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 + # ${urlname} create list zdhurl + # ${RequestHeadername} create list zdhreqck zdhrequa + # ${ResponseHeadername} create list zdhressck zdhresct + # ${RequestContentname} create list zdhreqcontent + # ${ResponseContentname} create list zdhrescontent + # ${filter} create list Host URL Request Header Response Header Request Content + # Create-Application-Button + # ApplicationSearch HTTP + # Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname} URLname=${urlname} Request Headername=${RequestHeadername} Response Headername=${ResponseHeadername} + # ... Request Contentname=${RequestContentname} Response Contentname=${ResponseContentname} + # Deny-subaction action=deny subaction=RST + # LogSession 1 + # Enabled open + # Security-Policies-OK -SecurityPolicy-Deny-SSL-MaxCombination-Drop - #新建对象fqdn - Comment 新建对象fqdn - CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com - #新建策略 - Comment 新建策略 - Menu policys Security Policy - SecurityPolicy.CreateButton - SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop - 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 - ${fqdnname} create list zdhfqdn - ${filter} create list SNI CN SAN - Create-Application-Button - ApplicationSearch SSL - Create-Filter-judge Application=SSL Filter=${filter} SSLSNIname=${fqdnname} CNname=${fqdnname} SANname=${fqdnname} - Deny-subaction action=deny subaction=Drop - LogSession 1 - Enabled open - Security-Policies-OK +# SecurityPolicy-Deny-HTTP-Host-Block403TEXT + # #新建对象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=Block code=403 Content=TEXT block-text=123456 + # LogSession 1 + # Enabled open + # Security-Policies-OK -SecurityPolicy-Deny-SSL-MaxCombination-RST - #新建对象fqdn - Comment 新建对象fqdn - CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com - #新建策略 - Comment 新建策略 - Menu policys Security Policy - SecurityPolicy.CreateButton - SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop - 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 - ${fqdnname} create list zdhfqdn - ${filter} create list SNI CN SAN - Create-Application-Button - ApplicationSearch SSL - Create-Filter-judge Application=SSL Filter=${filter} SSLSNIname=${fqdnname} CNname=${fqdnname} SANname=${fqdnname} - Deny-subaction action=deny subaction=RST - LogSession 1 - Enabled open - Security-Policies-OK +# SecurityPolicy-Deny-HTTP-Host-Block403ProfileCreate + # #新建对象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=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 -SecurityPolicy-Deny-DNS-MaxCombination-Drop - #新建对象fqdn - Comment 新建对象fqdn - CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com - #新建策略 - Comment 新建策略 - Menu policys Security Policy - SecurityPolicy.CreateButton - SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop - 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 - ${fqdnname} create list zdhfqdn - ${filter} create list QNAME - Create-Application-Button - ApplicationSearch DNS - Create-Filter-judge Application=DNS Filter=${filter} QNAMEname=${fqdnname} - Deny-subaction action=deny subaction=Drop - LogSession 1 - Enabled open - Security-Policies-OK - -SecurityPolicy-Deny-DNS-MaxCombination-Redirect-A - #新建对象fqdn - Comment 新建对象fqdn - CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com - #新建策略 - Comment 新建策略 - Menu policys Security Policy - SecurityPolicy.CreateButton - SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop - 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 - ${fqdnname} create list zdhfqdn - ${filter} create list QNAME - Create-Application-Button - ApplicationSearch DNS - Create-Filter-judge Application=DNS Filter=${filter} QNAMEname=${fqdnname} - Deny-subaction action=deny subaction=Redirect QType=A Avalue=5.5.5.5 Attl=100 CNAMEvalue=www.a.b CNAMEttl=1000 - LogSession 1 - Enabled open - Security-Policies-OK - -SecurityPolicy-Deny-DNS-MaxCombination-Redirect-AAAA - #新建对象fqdn - Comment 新建对象fqdn - CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com - #新建策略 - Comment 新建策略 - Menu policys Security Policy - SecurityPolicy.CreateButton - SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop - 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 - ${fqdnname} create list zdhfqdn - ${filter} create list QNAME - Create-Application-Button - ApplicationSearch DNS - Create-Filter-judge Application=DNS Filter=${filter} QNAMEname=${fqdnname} - Deny-subaction action=deny subaction=Redirect QType=AAAA Avalue=1234::ABCD Attl=100 CNAMEvalue=www.a.b CNAMEttl=1000 - LogSession 1 - Enabled open - Security-Policies-OK - -SecurityPolicy-Deny-FTP-MaxCombination-Drop - #新建对象url - Comment 新建对象url - CreatePage URL single zdhftpurl keywordtext=*.com - #新建Content - Comment Content - CreatePage Key single zdhftpContent keywordtext=*pppp - #新建Account - Comment Account - CreatePage Account single zdhftpAccount keywordtext=0000 - #新建策略 - Comment 新建策略 - Menu policys Security Policy - SecurityPolicy.CreateButton - SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop - 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 - ${URIname} create list zdhftpurl - ${FTPContentname} create list zdhftpContent - ${FTPAccountname} create list zdhftpAccount - ${filter} create list URI Content Account - Create-Application-Button - ApplicationSearch FTP - Create-Filter-judge Application=FTP Filter=${filter} URIname=${URIname} FTPContentname=${FTPContentname} FTPAccountname=${FTPAccountname} - Deny-subaction action=deny subaction=Drop - LogSession 1 - Enabled open - Security-Policies-OK - -SecurityPolicy-Deny-FTP-MaxCombination-RST - #新建对象url - Comment 新建对象url - CreatePage URL single zdhftpurl keywordtext=*.com - #新建Content - Comment Content - CreatePage Key single zdhftpContent keywordtext=*pppp - #新建Account - Comment Account - CreatePage Key single zdhftpAccount keywordtext=*pppp - #新建策略 - Comment 新建策略 - Menu policys Security Policy - SecurityPolicy.CreateButton - SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop - 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 - ${URIname} create list zdhftpurl - ${FTPContentname} create list zdhftpContent - ${FTPAccountname} create list zdhftpAccount - ${filter} create list URI Content Account - Create-Application-Button - ApplicationSearch FTP - Create-Filter-judge Application=FTP Filter=${filter} URIname=${URIname} FTPContentname=${FTPContentname} FTPAccountname=${FTPAccountname} - Deny-subaction action=deny subaction=RST - LogSession 1 - Enabled open - Security-Policies-OK - -testq-2 - Menu policys Security Policy - #修改策略,修改策略相当于再进行一遍新增 - Comment 修改策略 - Security-Source Name SecurityPolicy-Deny-HTTP-MaxCombination - EditButton - Initialize-Policie Deny - #新建策略 - SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop - SecurityPolicy.Create-action deny - SecurityPolicy.Create-Source-Button - SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.2 post=1 - SecurityPolicy.Create-Destination-Button - SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.3 post=1 - ${fqdnname} create list zdhfqdn - ${filter} create list SNI CN SAN - Create-Application-Button - ApplicationSearch SSL - Create-Filter-judge Application=SSL Filter=${filter} SSLSNIname=${fqdnname} CNname=${fqdnname} SANname=${fqdnname} - Deny-subaction action=deny subaction=RST - LogSession 1 - Enabled open - Security-Policies-OK - Security-Source Name SecurityPolicy-Deny-SSL-MaxCombination-Drop - ${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/p - Should Be Equal As Strings ${text} SecurityPolicy-Deny-SSL-MaxCombination-Drop +# SecurityPolicy-Deny-HTTP-Host-Block403ProfileSearch + # #新建对象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=Block code=403 Content=Profile SearchorCreate=Search ProfileName=zdhprofilehtml + # LogSession 1 + # Enabled open + # Security-Policies-OK + +# SecurityPolicy-Deny-HTTP-Host-Block404TEXT + # #新建对象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=Block code=404 Content=TEXT block-text=123456 + # LogSession 1 + # Enabled open + # Security-Policies-OK + # [Teardown] run keyword if test passed + +# SecurityPolicy-Deny-HTTP-Host-Block404ProfileCreate + # #新建对象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=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 + +# SecurityPolicy-Deny-HTTP-Host-Block404ProfileSearch + # #新建对象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=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 + +# SecurityPolicy-Deny-SSL-MaxCombination-Drop + # #新建对象fqdn + # Comment 新建对象fqdn + # CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + # #新建策略 + # Comment 新建策略 + # Menu policys Security Policy + # SecurityPolicy.CreateButton + # SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop + # 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 + # ${fqdnname} create list zdhfqdn + # ${filter} create list SNI CN SAN + # Create-Application-Button + # ApplicationSearch SSL + # Create-Filter-judge Application=SSL Filter=${filter} SSLSNIname=${fqdnname} CNname=${fqdnname} SANname=${fqdnname} + # Deny-subaction action=deny subaction=Drop + # LogSession 1 + # Enabled open + # Security-Policies-OK + +# SecurityPolicy-Deny-SSL-MaxCombination-RST + # #新建对象fqdn + # Comment 新建对象fqdn + # CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + # #新建策略 + # Comment 新建策略 + # Menu policys Security Policy + # SecurityPolicy.CreateButton + # SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop + # 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 + # ${fqdnname} create list zdhfqdn + # ${filter} create list SNI CN SAN + # Create-Application-Button + # ApplicationSearch SSL + # Create-Filter-judge Application=SSL Filter=${filter} SSLSNIname=${fqdnname} CNname=${fqdnname} SANname=${fqdnname} + # Deny-subaction action=deny subaction=RST + # LogSession 1 + # Enabled open + # Security-Policies-OK + +# SecurityPolicy-Deny-DNS-MaxCombination-Drop + # #新建对象fqdn + # Comment 新建对象fqdn + # CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + # #新建策略 + # Comment 新建策略 + # Menu policys Security Policy + # SecurityPolicy.CreateButton + # SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop + # 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 + # ${fqdnname} create list zdhfqdn + # ${filter} create list QNAME + # Create-Application-Button + # ApplicationSearch DNS + # Create-Filter-judge Application=DNS Filter=${filter} QNAMEname=${fqdnname} + # Deny-subaction action=deny subaction=Drop + # LogSession 1 + # Enabled open + # Security-Policies-OK + +# SecurityPolicy-Deny-DNS-MaxCombination-Redirect-A + # #新建对象fqdn + # Comment 新建对象fqdn + # CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + # #新建策略 + # Comment 新建策略 + # Menu policys Security Policy + # SecurityPolicy.CreateButton + # SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop + # 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 + # ${fqdnname} create list zdhfqdn + # ${filter} create list QNAME + # Create-Application-Button + # ApplicationSearch DNS + # Create-Filter-judge Application=DNS Filter=${filter} QNAMEname=${fqdnname} + # Deny-subaction action=deny subaction=Redirect QType=A Avalue=5.5.5.5 Attl=100 CNAMEvalue=www.a.b + # ... CNAMEttl=1000 + # LogSession 1 + # Enabled open + # Security-Policies-OK + +# SecurityPolicy-Deny-DNS-MaxCombination-Redirect-AAAA + # #新建对象fqdn + # Comment 新建对象fqdn + # CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + # #新建策略 + # Comment 新建策略 + # Menu policys Security Policy + # SecurityPolicy.CreateButton + # SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop + # 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 + # ${fqdnname} create list zdhfqdn + # ${filter} create list QNAME + # Create-Application-Button + # ApplicationSearch DNS + # Create-Filter-judge Application=DNS Filter=${filter} QNAMEname=${fqdnname} + # Deny-subaction action=deny subaction=Redirect QType=AAAA Avalue=1234::ABCD Attl=100 CNAMEvalue=www.a.b + # ... CNAMEttl=1000 + # LogSession 1 + # Enabled open + # Security-Policies-OK + +# SecurityPolicy-Deny-FTP-MaxCombination-Drop + # #新建对象url + # Comment 新建对象url + # CreatePage URL single zdhftpurl keywordtext=*.com + # #新建Content + # Comment Content + # CreatePage Key single zdhftpContent keywordtext=*pppp + # #新建Account + # Comment Account + # CreatePage Account single zdhftpAccount keywordtext=0000 + # #新建策略 + # Comment 新建策略 + # Menu policys Security Policy + # SecurityPolicy.CreateButton + # SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop + # 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 + # ${URIname} create list zdhftpurl + # ${FTPContentname} create list zdhftpContent + # ${FTPAccountname} create list zdhftpAccount + # ${filter} create list URI Content Account + # Create-Application-Button + # ApplicationSearch FTP + # Create-Filter-judge Application=FTP Filter=${filter} URIname=${URIname} FTPContentname=${FTPContentname} FTPAccountname=${FTPAccountname} + # Deny-subaction action=deny subaction=Drop + # LogSession 1 + # Enabled open + # Security-Policies-OK + +# SecurityPolicy-Deny-FTP-MaxCombination-RST + # #新建对象url + # Comment 新建对象url + # CreatePage URL single zdhftpurl keywordtext=*.com + # #新建Content + # Comment Content + # CreatePage Key single zdhftpContent keywordtext=*pppp + # #新建Account + # Comment Account + # CreatePage Key single zdhftpAccount keywordtext=*pppp + # #新建策略 + # Comment 新建策略 + # Menu policys Security Policy + # SecurityPolicy.CreateButton + # SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop + # 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 + # ${URIname} create list zdhftpurl + # ${FTPContentname} create list zdhftpContent + # ${FTPAccountname} create list zdhftpAccount + # ${filter} create list URI Content Account + # Create-Application-Button + # ApplicationSearch FTP + # Create-Filter-judge Application=FTP Filter=${filter} URIname=${URIname} FTPContentname=${FTPContentname} FTPAccountname=${FTPAccountname} + # Deny-subaction action=deny subaction=RST + # LogSession 1 + # Enabled open + # Security-Policies-OK diff --git a/02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot b/02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot index e176f12..0ae83f4 100644 --- a/02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot +++ b/02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot @@ -241,10 +241,87 @@ Deny-Redirect sleep 1 click element id=interceptionadd_shezhidns -Replace-Action-Parameters +Replace-Action-Parameters-for1 + [Arguments] ${ParametersType} ${RequestURIFind}=null ${RequestURIReplacewith}=null ${RequestBodyFind}=null ${RequestBodyReplacewith}=null ${ResponseBodyFind}=null + ... ${ResponseBodyReplacewith}=null ${RequestHeaderFind}=null ${RequestHeaderReplacewith}=null ${ResponseHeaderFind}=null ${ResponseHeaderReplacewith}=null + [Documentation] 调用次关键字前需要添加必填参数: + ... ${ParametersType}:列表格式,Search 下拉框中内容 + ... ${i}:索引值 + ... ${xxxFind}:是Find输入框输入的值 + ... ${XXXReplacewith} :是 Replacewith输入框中输入的值 + ${len} Get Length ${ParametersType} + ${len1} evaluate ${len}+1 + FOR ${i} IN RANGE 1 ${len1} + Replace-Action-Parameters-for1 ${ParametersType} ${i} ${RequestURIFind} ${RequestURIReplacewith} ${RequestBodyFind} ${RequestBodyReplacewith} ${ResponseBodyFind} + ... ${ResponseBodyReplacewith} ${RequestHeaderFind} ${RequestHeaderReplacewith} ${ResponseHeaderFind} ${ResponseHeaderReplacewith} + sleep 1 + run keyword if "${len}"!="1" run keywords sleep 1 + ... AND clcik element id=replaceadd_btn + ... AND sleep 1 + END sleep 1 - run keyword if "${ParametersNumber}"=="Search" run keywords sleep 1 - ... AND input text xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ${ProfileName} + +Replace-Action-Parameters-for2 + [Arguments] ${ParametersType} ${i} ${RequestURIFind} ${RequestURIReplacewith} ${RequestBodyFind} ${RequestBodyReplacewith} ${ResponseBodyFind} + ... ${ResponseBodyReplacewith} ${RequestHeaderFind} ${RequestHeaderReplacewith} ${ResponseHeaderFind} ${ResponseHeaderReplacewith} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${ParametersType}:列表格式,Search 下拉框中内容 + ... ${i}:索引值 + ... ${xxxFind}:是Find输入框输入的值 + ... ${XXXReplacewith} :是 Replacewith输入框中输入的值 + FOR ${j} IN @{ParametersType} + run keyword if "${j}"=="RequestURI" run keywords sleep 1 + ... AND click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[1]/div/div/div[1]/input + ... AND sleep 1 + ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[2]/div/div/input ${RequestURIFind} + ... AND sleep 1 + ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[3]/div/div/input ${RequestURIReplacewith} + ... AND sleep 1 + run keyword if "${j}"=="RequestBody" run keywords sleep 1 + ... AND click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[1]/div/div/div[1]/input + ... AND sleep 1 + ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[2]/div/div/input ${RequestBodyFind} + ... AND sleep 1 + ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[3]/div/div/input ${RequestBodyReplacewith} + ... AND sleep 1 + run keyword if "${j}"=="ResponseBody" run keywords sleep 1 + ... AND click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[1]/div/div/div[1]/input + ... AND sleep 1 + ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[2]/div/div/input ${ResponseBodyFind} + ... AND sleep 1 + ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[3]/div/div/input ${ResponseBodyReplacewith} + ... AND sleep 1 + run keyword if "${j}"=="RequestHeader" run keywords sleep 1 + ... AND click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[1]/div/div/div[1]/input + ... AND sleep 1 + ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[2]/div/div/input ${RequestHeaderFind} + ... AND sleep 1 + ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[3]/div/div/input ${RequestHeaderReplacewith} + ... AND sleep 1 + run keyword if "${j}"=="ResponseHeader" run keywords sleep 1 + ... AND click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[1]/div/div/div[1]/input + ... AND sleep 1 + ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[2]/div/div/input ${ResponseHeaderFind} + ... AND sleep 1 + ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[3]/div/div/input ${ResponseHeaderReplacewith} + ... AND sleep 1 + END + +HijackFile-SearchorCreate + [Arguments] ${SearchorCreate} ${Hijackname} ${Hijackfile} ${dow_name} ${input} ${Hijackname} ${Hijacktype} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${SearchorCreate}:填入Search或Create + ... ${Hijackname}:填入新建hijack的name + ... ${Hijackfile}:填入新建hijack文件的路径 + ... ${dow_name}:根据情况填入close或open或其他 + ... ${input};填入shuru或其他 + ... ${Hijacktype}:填入选择文件类型的元素 + ... 判断是新建还是搜索HijackFile + sleep 1 + click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[4]/div/div/div/div + sleep 1 + run keyword if "${SearchorCreate}"=="Search" run keywords sleep 1 + ... AND input text xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ${Hijackname} ... AND sleep 1 ... AND press keys xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ENTER ... AND sleep 1 @@ -253,253 +330,116 @@ Replace-Action-Parameters ... ELSE IF "${SearchorCreate}"=="Create" run keywords sleep 1 ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/div[1]/div/div/button ... AND sleep 1 + ... AND HijackFile-Create ${Hijackname} ${Hijackfile} ${dow_name} ${input} ${Hijackname} ${Hijacktype} + ... ELSE log 传入参数错误 -Intercept-SSL-Keyring-SearchorCreate - [Arguments] ${KeySearchorCreate} ${keyname} ${file}=null ${file1}=null ${ExpiryHours1or2}=null ${type}=null ${type1}=null - ... ${shift}=close ${PrivateKeyType}=PrivateKeyFile - [Documentation] 引用次关键字,填入必填参数 - ... 必填参数: - ... ${KeySearchorCreate}:填入Create或Search - ... ${name}:新建页面name输入框里的内容 - ... ${file}:上传文件所在本地的路径 - ... ${file1}:上传文件所在本地的路径 - ... ${ExpiryHours1or2}:根证书时间填入1:自定义定义 2:原时间 - ... ${type}:上传证书类型的元素 - ... ${type1}:上传证书加密解密算法的元素 - ... ${shift}:是否打开客户端包含证书按钮 - ... ${PrivateKeyType}:私钥类型 - sleep 1 - click element id=interceptionadd_eventkeying1 - sleep 1 - run keyword if "${KeySearchorCreate}"=="Create" run keywords sleep 1 - ... AND click element id=interceptionadd_keyadd - ... AND sleep 2 - ... AND Create-Keyring ${keyname} ${file} ${file1} ${ExpiryHours1or2} ${type} ${type1} - ... ${shift}=close ${PrivateKeyType}=PrivateKeyFile - run keyword if "${KeySearchorCreate}"=="Search" run keywords sleep 1 - ... AND input text id=card_keyringName1 ${keyname} - ... AND sleep 1 - ... AND press keys id=card_keyringName1 ENTER - ... AND sleep 1 - ... AND clcik element id=card_keylist0 - -Create-Keyring - [Arguments] ${name} ${file} ${file1} ${ExpiryHours1or2} ${type} ${type1} - ... ${shift}=close ${PrivateKeyType}=PrivateKeyFile - [Documentation] 引用次关键字,填入必填参数 - ... 必填参数: - ... ${name}:新建页面name输入框里的内容 - ... ${file}:上传文件所在本地的路径 - ... ${file1}:上传文件所在本地的路径 - ... ${ExpiryHours1or2}:根证书时间填入1:自定义定义 2:原时间 - ... ${type}:上传证书类型的元素 - ... ${type1}:上传证书加密解密算法的元素 - ... ${shift}:是否打开客户端包含证书按钮 - ... ${PrivateKeyType}:私钥类型 +HijackFile-Create + [Arguments] ${Hijackname} ${Hijackfile} ${dow_name} ${input} ${Hijackname} ${Hijacktype} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Hijackname}:填入新建hijack的name + ... ${Hijackfile}:填入新建hijack文件的路径 + ... ${dow_name}:根据情况填入close或open或其他 + ... ${input};填入shuru或其他 + ... ${Hijacktype}:填入选择文件类型的元素 + ... 新建hijack Sleep 2 - input id=keyringsadd_name ${name} #输入name + input id=hijack_profileName ${Hijackname} #输入name Sleep 2 - Choose File xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/div[2]/form/div[2]/div/div/div/input ${file} #上传文件 + Choose File xpath=//*[@id="proxy"]/div[11]/div/div[1]/div[2]/form/div[2]/div/div/div[1]/input ${Hijackfile} #上传文件 Sleep 2 - Choose File xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/div[2]/form/div[3]/div/div[2]/div/div/input ${file1} #上传文件 - ${select} Set Variable ${ExpiryHours1or2} - Run Keyword If '${select}'=='1' click element id=keyringsadd_customized - Run Keyword If '${select}'=='1' input text id=reissueExpiryDate 10 + run keyword if "${dow_name}"=="close" and "${input}"=="shuru" run keywords sleep 1 + ... AND input text id=hijack_contentName ${Hijackname} + ... ELSE IF "${dow_name}"=="open" click element xpath=//*[@id="contentNameChoose"]/div[1]/span[2] sleep 1 - click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/div[2]/form/div[6]/div/div/div[1]/span/span/i #点击下拉框 - sleep 1 - click element ${type} #选择证书类型 - sleep 1 - click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/div[2]/form/div[7]/div/div/div[1]/span/span/i #点击下拉框 - sleep 1 - click element ${type1} #选择加密解密类型 - sleep 1 - ${root} Set Variable ${shift} - run keyword if "${root}"=="open" run keywords sleep 1 - ... AND click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/div[2]/form/div[9]/div/div/span - ... ELSE IF "${root}"=="close" log "go on" - Run Keyword If '${PrivateKeyType}'=='HSM' run keywords sleep 1 - ... AND click element id=privateHSM - ... AND sleep 1 - ... AND input text id=keyringsadd_slotid 10 - sleep 1 - click id=keyringsadd_sub #点击OK缇交 -Intercept-SSL-MirrorDecryptedTraffic-Open - [Arguments] ${MirrorDecryptedTraffic}=null ${MirrorDecryptedTrafficSearchorCreate}=null ${MirrorDecryptedTrafficname}=null ${type}=null ${shuru}=null - [Documentation] 引用次关键字,填入必填参数 - ... 必填参数: - ... ${MirrorDecryptedTraffic}:输入open代表开启按钮,其他代表不开启 - ... ${MirrorDecryptedTrafficSearchorCreate}:填入Create或Search - ... ${MirrorDecryptedTrafficname}:解密流量文件的name - ... ${type}:是mac还是vlan的定位元素 - ... ${shuru}:输入mac或vlan的值 - sleep 1 - run keyword if "${MirrorDecryptedTraffic}"=="open" run keywords sleep 1 - ... AND click element xpath=///*[@id="policy_paper_left"]/div[10]/div[2]/label[contains(text(), "Mirror Decrypted Traffic")]/following-sibling::div/div - ... AND sleep 1 - ... AND clcik element id=mirror_profile - ... AND MirrorDecryptedTraffic-SearchorCreate ${MirrorDecryptedTrafficSearchorCreate} ${MirrorDecryptedTrafficname} ${type} ${shuru} - ... ELSE log 不开启 -MirrorDecryptedTraffic-SearchorCreate - [Arguments] ${MirrorDecryptedTrafficSearchorCreate} ${MirrorDecryptedTrafficname} ${type} ${shuru} - [Documentation] 引用次关键字,填入必填参数 - ... 必填参数: - ... ${MirrorDecryptedTrafficSearchorCreate}:填入Create或Search - ... ${MirrorDecryptedTrafficname}:解密流量文件的name - ... ${type}:是mac还是vlan的定位元素 - ... ${shuru}:输入mac或vlan的值 - sleep 1 - run keyword if "${MirrorDecryptedTrafficSearchorCreate}"=="Create" run keywords sleep 1 - ... AND click element id=interceptionadd_trarightadd - ... AND sleep 2 - ... AND Create-MirrorDecryptedTraffic ${MirrorDecryptedTrafficname} ${type} ${shuru} - run keyword if "${MirrorDecryptedTrafficSearchorCreate}"=="Search" run keywords sleep 1 - ... AND input text id=tradata_profileName ${MirrorDecryptedTrafficname} - ... AND sleep 1 - ... AND press keys id=tradata_profileName ENTER - ... AND sleep 1 - ... AND clcik element id=tralist_length0 -Create-MirrorDecryptedTraffic - [Arguments] ${MirrorDecryptedTrafficname} ${type} ${shuru} - [Documentation] 引用次关键字,填入必填参数 - ... 必填参数: - ... ${MirrorDecryptedTrafficname}:解密流量文件的name - ... ${type}:是mac还是vlan的定位元素 - ... ${shuru}:输入mac或vlan的值 - Sleep 2 - input id=trafficmirror_profileName ${MirrorDecryptedTrafficname} #输入name - Sleep 2 - click id=addrTypeChoose #点击下拉框 - Sleep 2 - click ${type} #选择vlan或者mac + click element id=hijackAddContentType #点击+ 打开侧滑窗口 Sleep 1 - input id=trafficmirror_addrArray0 ${shuru} + click element ${Hijacktype} #选择文件类型 sleep 2 - click xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/button[1] #点击OK -DecryptionProfile-SearchorCreate - [Arguments] ${DecryptionProfileSearchorCreate}=null ${DecryptionProfilename}=null ${dict1}=null ${fail1}=null ${min1}=null ${max1}=null - [Documentation] 引用次关键字,填入必填参数 - ... 必填参数: - ... ${DecryptionProfileSearchorCreate}:填入Create或Search - ... ${DecryptionProfilename}:文件name - ... ${dict1}:是个字典,等于1为开启,等于0为关闭,例如:Common Name=1 Issuer=1 Self-signed=1 Expiry Date=1 EV Certificat=1 - ... Certificate Transparency=1 Mutual Authentication=1 On Protocol Errors=1 Certificate Pinning=1 Certificate Not Installed=1 Mirror Client Versions=1 - ... Allow HTTP/2=1 - ... ${fail1} :输入Fail-close或Pass-through - ... ${min1}:输入协议版本, - ... ${max1}:输入协议版本, - sleep 1 - click element id=interceptionadd_eventkeying - sleep 1 - run keyword if "${DecryptionProfileSearchorCreate}"=="Create" run keywords sleep 1 - ... AND click element id=interceptionadd_decryptionProfileId - ... AND sleep 2 - ... AND Create-DecryptionProfile ${DecryptionProfilename} ${dict1} ${fail1} ${min1} ${max1} - run keyword if "${DecryptionProfileSearchorCreate}"=="Search" run keywords sleep 1 - ... AND input text id=card_keyringName ${DecryptionProfilename} - ... AND sleep 1 - ... AND press keys id=card_keyringName ENTER - ... AND sleep 1 - ... AND clcik element xpath=//*[@id="decryptionProfileList"]/following-sibling::li[2] -Create-DecryptionProfile - [Arguments] ${name} ${dict1} ${fail1} ${min1} ${max1} - Sleep 1 - input id=insert_profileName ${name} - Sleep 1 - DecryptionProfileButtonSwitch ${dict1} //*[@id="policy_Manipulation_create8"]/div[2]/form/div/div/label[contains(text(), " ")]/following-sibling::div/div el-switch is-checked el-switch - ${fail} Set Variable ${fail1} - run keyword if "${fail}"=="Fail-close" Run Keywords sleep 1 - ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[3]/div[5]/div/div/label[1]/span - ... ELSE IF "${fail}"=="Pass-through" Run Keywords sleep 1 - ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[3]/div[5]/div/div/label[2]/span - ... ELSE log 1111 - ${min} Set Variable ${min1} - ${max} Set Variable ${max1} - run keyword if "${min}"=="TLSv1.0" Run Keywords sleep 1 - ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i - ... AND sleep 1 - ... AND click id=pro_min1 - ... ELSE IF "${min}"=="TLSv1.1" Run Keywords sleep 1 - ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i - ... AND sleep 1 - ... AND click id=pro_min2 - ... ELSE IF "${min}"=="TLSv1.2" Run Keywords sleep 1 - ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i - ... AND sleep 1 - ... AND click id=pro_min3 - ... ELSE IF "${min}"=="TLSv1.3" Run Keywords sleep 1 - ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i - ... AND sleep 1 - ... AND click id=pro_min4 - ... ELSE IF "${min}"=="SSLv3.0" Run Keywords sleep 1 - ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i - ... AND sleep 1 - ... AND click id=pro_min0 - ... ELSE log 错误 - run keyword if "${max}"=="TLSv1.0" Run Keywords sleep 1 - ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i - ... AND sleep 1 - ... AND click id=pro_max1 - ... ELSE IF "${max}"=="TLSv1.1" Run Keywords sleep 1 - ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i - ... AND sleep 1 - ... AND click id=pro_max2 - ... ELSE IF "${max}"=="TLSv1.2" Run Keywords sleep 1 - ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i - ... AND sleep 1 - ... AND click id=pro_max3 - ... ELSE IF "${max}"=="TLSv1.3" Run Keywords sleep 1 - ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i - ... AND sleep 1 - ... AND click id=pro_max4 - ... ELSE IF "${max}"=="SSLv3.0" Run Keywords sleep 1 - ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i - ... AND sleep 1 - ... AND click id=pro_max0 - ... ELSE log 错误 - sleep 2 - click id=decryption-ok - sleep 2 - Settings-Search ${name} ${search} #搜索框的关键字 - sleep 2 - ${name1} get text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[2]/div/div[3]/table/tbody/tr/td[2]/div/div/span - Should Be Equal As Strings ${name1} ${name} - + click element id=hijackAddOk1 #点击OK + +InsertScript-SearchorCreate + [Arguments] ${SearchorCreate} ${Insertname} ${Insertfile} ${Inserttype} ${Insertjstype} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${SearchorCreate}:填入Search或Create + ... ${Insertname}:填入新建insert的name + ... ${Insertfile}:填入新建insert文件的路径 + ... ${Inserttype}:根据情况填入css或js + ... ${Insertjstype};填入Before Page Load或After Page Load + ... 判断是新建还是搜索insert + sleep 1 + click element id=manipulation_select_insetScript + sleep 1 + run keyword if "${SearchorCreate}"=="Search" run keywords sleep 1 + ... AND input text xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ${Hijackname} + ... AND sleep 1 + ... AND press keys xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ENTER + ... AND sleep 1 + ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/div[2]/div/li[1] + ... AND sleep 1 + ... ELSE IF "${SearchorCreate}"=="Create" run keywords sleep 1 + ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/div[1]/div/div/button + ... AND sleep 1 + ... AND InsertScript-Create ${Insertname} ${Insertfile} ${Inserttype} ${Insertjstype} + ... ELSE log 传入参数错误 + +InsertScript-Create + [Arguments] ${Insertname} ${Insertfile} ${Inserttype} ${Insertjstype} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Insertname}:填入新建insert的name + ... ${Insertfile}:填入新建insert文件的路径 + ... ${Inserttype}:根据情况填入css或js + ... ${Insertjstype};填入Before Page Load或After Page Load + ... 新建insert + Sleep 2 + input id=insert_profileName ${Insertname} #输入name + Sleep 2 + Choose File xpath=//*[@id="insertAddUpload"]/div[1]/input ${Insertfile} #上传文件 + Sleep 2 + clcik element id=insert_select_format + sleep 1 + run keyword if "${Inserttype}"=="css" run keywords sleep 1 + ... AND click element //span[.="${Inserttype}"] #选择css + run keyword if "${Inserttype}"=="js" run keywords sleep 1 + ... AND click element //span[.="${Inserttype}"] + ... AND sleep 1 + ... AND click element id=insert_select_insertOn #点击下拉框 + ... AND sleep 1 + ... AND click element //span[.="${Insertjstype}"] + sleep 2 + click element id=insertAddOk1 #点击OK + + + -DecryptionProfileButtonSwitch - [Arguments] ${dict1} ${xpath1} ${xpath2} ${open} ${close} - ${dict} Set Variable ${dict1} - FOR ${list} ${key} IN ENUMERATE @{dict} - ${class}= Get Element Attribute xpath=${xpath1}${key}${xpath2} class - run keyword if "${class}"=="${open}" and "${dict}[${key}]"=="1" log 默认开启,不进行操作 - run keyword if "${class}"=="${open}" and "${dict}[${key}]"=="0" Run Keywords log 默认开启,但需求需要关闭,进行点击关闭按钮 - ... AND sleep 1 - ... AND click xpath=${xpath1}${key}${xpath2}/span - run keyword if "${class}"=="${close}" and "${dict}[${key}]"=="1" Run Keywords log 默认关闭,但需求需要开启,进行点击开启按钮 - ... AND sleep 1 - ... AND click xpath=${xpath1}${key}${xpath2}/span - run keyword if "${class}"=="${close}" and "${dict}[${key}]"=="0" log 默认关闭,不进行操作 - END LogSession [Arguments] ${LogSession} [Documentation] 调用次关键字前需要添加必填参数: ... ${LogSession}:填入clcos或其他 run keyword if "${LogSession}"=="close" run keywords sleep 1 - ... AND click element id=addlabel_labels_log + ... AND click element id=manipulationSwitch0 ... ELSE log 开启日志 + +LogOptions + [Arguments] ${LogOptions} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${LogOptions}:填入All或其他 + run keyword if "${LogOptions}"=="All" run keywords sleep 1 + ... AND click element id=logType1 + ... ELSE log 选择Metadata only Enabled [Arguments] ${Enabled} [Documentation] 调用次关键字前需要添加必填参数: ... ${Enabled}:填入open或其他 run keyword if "${Enabled}"=="open" run keywords sleep 1 - ... AND click element xpath=//*[@id="policy_paper_left"]/div/label[contains(text(), "Enabled")]/following-sibling::div/div - ... AND sleep 2 + ... AND click element xpath=//*[@id="proxyManipulationUse"]/label[contains(text(), "Enabled")]/following-sibling::div/div + ... AND sleep 2 ... AND click element xpath=/html/body/div/div/div[3]/button[2] ... ELSE log 开启日志 Security-Policies-OK sleep 1 - click element id=interceptionadd_sub + click element id=proxyManipulationSuccess + sleep 1 Create-Object-Search [Arguments] ${name} ${filter} [Documentation] 调用次关键字前需要添加必填参数: @@ -899,9 +839,9 @@ 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] -Security-Source +Proxy-Source [Arguments] ${SourceType} ${SourceValue} - Wait Until Element Is Enabled xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div 10 + Wait Until Element Is Enabled xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div 10 click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div sleep 1 run keyword if "${SourceType}"=="ID" run keywords sleep 1 @@ -911,7 +851,7 @@ Security-Source run keyword if "${SourceType}"=="Action" run keywords sleep 1 ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[4] sleep 1 - input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${SourceValue} + input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${SourceValue} sleep 1 click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i sleep 1 @@ -920,7 +860,7 @@ Security-Source EditButton sleep 1 - click element xpath=//*[@id="appEdit"]/span/div/div[2] + click element xpath=//*[@id="appEdit"]/span/div/div[2] sleep 1 Initialize-Policie @@ -928,15 +868,21 @@ Initialize-Policie [Documentation] 调用次关键字前需要添加必填参数: ... ${InitializeAction}:根据用例进行填写,意思就是是那一个action就不要点击哪一个,以免初始化失败 run keyword if "${InitializeAction}"=="Allow" run keywords sleep 1 - ... AND click element id=security_action_deny + ... AND click element id=proxyManipulationdeny ... AND sleep 1 ... ELSE IF "${InitializeAction}"=="Deny" run keywords sleep 1 - ... AND click element id=security_action_allow + ... AND click element id=proxyManipulationallow ... ELSE IF "${InitializeAction}"=="Monitor" run keywords sleep 1 - ... AND click element id=security_action_deny - ... ELSE IF "${InitializeAction}"=="Intercept" run keywords sleep 1 - ... AND click element id=security_action_deny - ... ELSE log 不修改 + ... AND click element id=proxyManipulationdeny + ... ELSE IF "${InitializeAction}"=="Redirect" run keywords sleep 1 + ... AND click element id=proxyManipulationdeny + ... ELSE IF "${InitializeAction}"=="Replace" run keywords sleep 1 + ... AND click element id=proxyManipulationdeny + ... ELSE IF "${InitializeAction}"=="Hijack" run keywords sleep 1 + ... AND click element id=proxyManipulationdeny + ... ELSE IF "${InitializeAction}"=="Insert" run keywords sleep 1 + ... AND click element id=proxyManipulationdeny + ... ELSE log 不修改 sleep 1 ${status} Run Keyword And Return Status Page should contain element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[4]/div[1]/div/div/div #判断页面是否包含该元素 run keyword if "${status}"=="False" log go on @@ -949,4 +895,53 @@ Initialize-Policie ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[5]/div[1]/div/div/div/p/span/span/i[2] ... AND sleep 1 +Delete-Proxy + [Arguments] ${securityname} + Menu policys Security Policy + sleep 2 + Wait Until Element Is Enabled xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div 10 + click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div + sleep 1 + click element xpath=/html/body/div/div[1]/div[1]/ul/li[3] + sleep 1 + input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${securityname} + sleep 1 + click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i + sleep 1 + Run Keyword And Ignore Error click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1] + sleep 2 + sleep 1 + Run Keyword And Ignore Error click element id=appDel + sleep 1 + Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2] + sleep 1 + +Delete-object + [Arguments] ${obj} + FOR ${num} ${key} IN ENUMERATE @{obj} + Forname ${obj}[${key}] ${key} + + END + +Forname + [Arguments] ${objectname} ${key} + FOR ${i} IN @{objectname} + Menu objects ${key} + sleep 2 + click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div/div/input #点击输入框 + sleep 2 + click element xpath=/html/body/div/div[1]/div[1]/ul/li[3] #点击name为搜索类型 + sleep 2 + input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${i} #输入搜索内容 + sleep 2 + click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i #点击搜索按钮 + sleep 2 + Run Keyword And Ignore Error click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span #选择搜索到的列表 + sleep 2 + sleep 1 + Run Keyword And Ignore Error click element id=objectDel #点击删除按钮 + sleep 1 + Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2] + sleep 1 + END diff --git a/02-Keyword/tsg_ui/securityPolicy/SecurityPolicy.robot b/02-Keyword/tsg_ui/securityPolicy/SecurityPolicy.robot index 271ca13..3c4d9e5 100644 --- a/02-Keyword/tsg_ui/securityPolicy/SecurityPolicy.robot +++ b/02-Keyword/tsg_ui/securityPolicy/SecurityPolicy.robot @@ -1,7 +1,7 @@ *** Settings *** Library Selenium2Library Resource ../objects/NewObject.robot - +Resource ../Menu.robot *** Keywords *** CreateButton [Documentation] 点击安全策略中的Create按钮 @@ -37,9 +37,9 @@ Create-Source-Button Create-Destination-Button [Documentation] 点击Destination的加号 - 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 sleep 2 click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[1]/div/div + sleep 2 Create-Application-Button [Documentation] 点击Application的加号 Wait Until Element Is Enabled id=interceptionadd_application 10 @@ -965,4 +965,64 @@ Initialize-Policie ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[5]/div[1]/div/div/div/p/span/span/i[2] ... AND sleep 1 +Delete-Security-estimate + [Arguments] ${securityname} + run keyword if "${securityname}"!="null" run keywords sleep 1 + ... AND Delete-Security ${securityname} + ... ELSE log go on +Delete-Security + [Arguments] ${securityname} + + Menu policys Security Policy + sleep 2 + Wait Until Element Is Enabled xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div 10 + click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div + sleep 1 + click element xpath=/html/body/div/div[1]/div[1]/ul/li[3] + sleep 1 + input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${securityname} + sleep 1 + click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i + sleep 1 + Run Keyword And Ignore Error click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1] + sleep 2 + sleep 1 + Run Keyword And Ignore Error click element id=appDel + sleep 1 + Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2] + sleep 1 + +Delete-object-estimate + [Arguments] ${obj} + run keyword if "${obj}"!="null" run keywords sleep 1 + ... AND Delete-object ${obj} + ... ELSE log go on +Delete-object + [Arguments] ${obj} + FOR ${num} ${key} IN ENUMERATE @{obj} + Forname ${obj}[${key}] ${key} + + END + +Forname + [Arguments] ${objectname} ${key} + FOR ${i} IN @{objectname} + Menu objects ${key} + sleep 2 + click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div/div/input #点击输入框 + sleep 2 + click element xpath=/html/body/div/div[1]/div[1]/ul/li[3] #点击name为搜索类型 + sleep 2 + input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${i} #输入搜索内容 + sleep 2 + click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i #点击搜索按钮 + sleep 2 + Run Keyword And Ignore Error click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span #选择搜索到的列表 + sleep 2 + sleep 1 + Run Keyword And Ignore Error click element id=objectDel #点击删除按钮 + sleep 1 + Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2] + sleep 1 + END