From d321d0378cad411d9bfd5a023afcf406ca331f37 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Wed, 8 May 2024 16:42:40 +0800 Subject: [PATCH] =?UTF-8?q?WAF=E8=A7=84=E5=88=99=E9=9B=86=E4=B8=AD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E2=80=9C=E5=85=81=E8=AE=B8=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=BC=95=E6=93=8E=E2=80=9D=E9=80=89=E9=A1=B9=EF=BC=8C=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E5=BF=AB=E9=80=9F=E5=85=81=E8=AE=B8=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=BC=95=E6=93=8E=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../servers/components/waf/createSetPopup.go | 30 ++++++++++--------- .../servers/components/waf/updateSetPopup.go | 12 ++++---- .../components/waf/createSetPopup.html | 11 +++++-- .../components/waf/updateSetPopup.html | 9 +++++- 4 files changed, 40 insertions(+), 22 deletions(-) diff --git a/internal/web/actions/default/servers/components/waf/createSetPopup.go b/internal/web/actions/default/servers/components/waf/createSetPopup.go index 88cb2ceb..238346c1 100644 --- a/internal/web/actions/default/servers/components/waf/createSetPopup.go +++ b/internal/web/actions/default/servers/components/waf/createSetPopup.go @@ -78,10 +78,11 @@ func (this *CreateSetPopupAction) RunPost(params struct { FormType string // normal - RulesJSON []byte - Connector string - ActionsJSON []byte - IgnoreLocal bool + RulesJSON []byte + Connector string + ActionsJSON []byte + IgnoreLocal bool + IgnoreSearchEngine bool // code Code string @@ -133,16 +134,17 @@ func (this *CreateSetPopupAction) RunPost(params struct { } var setConfig = &firewallconfigs.HTTPFirewallRuleSet{ - Id: 0, - IsOn: true, - Name: params.Name, - Code: "", - Description: "", - Connector: params.Connector, - RuleRefs: nil, - Rules: rules, - Actions: actionConfigs, - IgnoreLocal: params.IgnoreLocal, + Id: 0, + IsOn: true, + Name: params.Name, + Code: "", + Description: "", + Connector: params.Connector, + RuleRefs: nil, + Rules: rules, + Actions: actionConfigs, + IgnoreLocal: params.IgnoreLocal, + IgnoreSearchEngine: params.IgnoreSearchEngine, } setConfigJSON, err = json.Marshal(setConfig) diff --git a/internal/web/actions/default/servers/components/waf/updateSetPopup.go b/internal/web/actions/default/servers/components/waf/updateSetPopup.go index d3560d3d..80875f96 100644 --- a/internal/web/actions/default/servers/components/waf/updateSetPopup.go +++ b/internal/web/actions/default/servers/components/waf/updateSetPopup.go @@ -93,11 +93,12 @@ func (this *UpdateSetPopupAction) RunPost(params struct { GroupId int64 SetId int64 - Name string - RulesJSON []byte - Connector string - ActionsJSON []byte - IgnoreLocal bool + Name string + RulesJSON []byte + Connector string + ActionsJSON []byte + IgnoreLocal bool + IgnoreSearchEngine bool Must *actions.Must }) { @@ -149,6 +150,7 @@ func (this *UpdateSetPopupAction) RunPost(params struct { setConfig.Rules = rules setConfig.Actions = actionConfigs setConfig.IgnoreLocal = params.IgnoreLocal + setConfig.IgnoreSearchEngine = params.IgnoreSearchEngine setConfigJSON, err := json.Marshal(setConfig) if err != nil { diff --git a/web/views/@default/servers/components/waf/createSetPopup.html b/web/views/@default/servers/components/waf/createSetPopup.html index d6176acd..49b17eb4 100644 --- a/web/views/@default/servers/components/waf/createSetPopup.html +++ b/web/views/@default/servers/components/waf/createSetPopup.html @@ -40,10 +40,17 @@ - 忽略局域网IP + 允许局域网IP -

选中后表示如果请求来自局域网IP,则直接跳过当前规则集。

+

选中后,表示如果请求来自局域网IP,则直接跳过当前规则集。

+ + + + 允许搜索引擎 + + +

选中后,表示如果请求来自常见搜索引擎的IP,则直接跳过当前规则集。

diff --git a/web/views/@default/servers/components/waf/updateSetPopup.html b/web/views/@default/servers/components/waf/updateSetPopup.html index 1ef2c0c9..60aac2f7 100644 --- a/web/views/@default/servers/components/waf/updateSetPopup.html +++ b/web/views/@default/servers/components/waf/updateSetPopup.html @@ -34,12 +34,19 @@ - 忽略局域网IP + 允许局域网IP

选中后表示如果请求来自局域网IP,则直接跳过当前规则集。

+ + 允许搜索引擎 + + +

选中后,表示如果请求来自常见搜索引擎的IP,则直接跳过当前规则集。

+ + \ No newline at end of file