WAF规则集中增加“允许搜索引擎”选项,可以快速允许搜索引擎访问
This commit is contained in:
@@ -78,10 +78,11 @@ func (this *CreateSetPopupAction) RunPost(params struct {
|
|||||||
FormType string
|
FormType string
|
||||||
|
|
||||||
// normal
|
// normal
|
||||||
RulesJSON []byte
|
RulesJSON []byte
|
||||||
Connector string
|
Connector string
|
||||||
ActionsJSON []byte
|
ActionsJSON []byte
|
||||||
IgnoreLocal bool
|
IgnoreLocal bool
|
||||||
|
IgnoreSearchEngine bool
|
||||||
|
|
||||||
// code
|
// code
|
||||||
Code string
|
Code string
|
||||||
@@ -133,16 +134,17 @@ func (this *CreateSetPopupAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var setConfig = &firewallconfigs.HTTPFirewallRuleSet{
|
var setConfig = &firewallconfigs.HTTPFirewallRuleSet{
|
||||||
Id: 0,
|
Id: 0,
|
||||||
IsOn: true,
|
IsOn: true,
|
||||||
Name: params.Name,
|
Name: params.Name,
|
||||||
Code: "",
|
Code: "",
|
||||||
Description: "",
|
Description: "",
|
||||||
Connector: params.Connector,
|
Connector: params.Connector,
|
||||||
RuleRefs: nil,
|
RuleRefs: nil,
|
||||||
Rules: rules,
|
Rules: rules,
|
||||||
Actions: actionConfigs,
|
Actions: actionConfigs,
|
||||||
IgnoreLocal: params.IgnoreLocal,
|
IgnoreLocal: params.IgnoreLocal,
|
||||||
|
IgnoreSearchEngine: params.IgnoreSearchEngine,
|
||||||
}
|
}
|
||||||
|
|
||||||
setConfigJSON, err = json.Marshal(setConfig)
|
setConfigJSON, err = json.Marshal(setConfig)
|
||||||
|
|||||||
@@ -93,11 +93,12 @@ func (this *UpdateSetPopupAction) RunPost(params struct {
|
|||||||
GroupId int64
|
GroupId int64
|
||||||
SetId int64
|
SetId int64
|
||||||
|
|
||||||
Name string
|
Name string
|
||||||
RulesJSON []byte
|
RulesJSON []byte
|
||||||
Connector string
|
Connector string
|
||||||
ActionsJSON []byte
|
ActionsJSON []byte
|
||||||
IgnoreLocal bool
|
IgnoreLocal bool
|
||||||
|
IgnoreSearchEngine bool
|
||||||
|
|
||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
}) {
|
}) {
|
||||||
@@ -149,6 +150,7 @@ func (this *UpdateSetPopupAction) RunPost(params struct {
|
|||||||
setConfig.Rules = rules
|
setConfig.Rules = rules
|
||||||
setConfig.Actions = actionConfigs
|
setConfig.Actions = actionConfigs
|
||||||
setConfig.IgnoreLocal = params.IgnoreLocal
|
setConfig.IgnoreLocal = params.IgnoreLocal
|
||||||
|
setConfig.IgnoreSearchEngine = params.IgnoreSearchEngine
|
||||||
|
|
||||||
setConfigJSON, err := json.Marshal(setConfig)
|
setConfigJSON, err := json.Marshal(setConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -40,10 +40,17 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>忽略局域网IP</td>
|
<td>允许局域网IP</td>
|
||||||
<td>
|
<td>
|
||||||
<checkbox name="ignoreLocal"></checkbox>
|
<checkbox name="ignoreLocal"></checkbox>
|
||||||
<p class="comment">选中后表示如果请求来自局域网IP,则直接跳过当前规则集。</p>
|
<p class="comment">选中后,表示如果请求来自局域网IP,则直接跳过当前规则集。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>允许搜索引擎</td>
|
||||||
|
<td>
|
||||||
|
<checkbox name="ignoreSearchEngine"></checkbox>
|
||||||
|
<p class="comment">选中后,表示如果请求来自常见搜索引擎的IP,则直接跳过当前规则集。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -34,12 +34,19 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>忽略局域网IP</td>
|
<td>允许局域网IP</td>
|
||||||
<td>
|
<td>
|
||||||
<checkbox name="ignoreLocal" v-model="setConfig.ignoreLocal"></checkbox>
|
<checkbox name="ignoreLocal" v-model="setConfig.ignoreLocal"></checkbox>
|
||||||
<p class="comment">选中后表示如果请求来自局域网IP,则直接跳过当前规则集。</p>
|
<p class="comment">选中后表示如果请求来自局域网IP,则直接跳过当前规则集。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>允许搜索引擎</td>
|
||||||
|
<td>
|
||||||
|
<checkbox name="ignoreSearchEngine" v-model="setConfig.ignoreSearchEngine"></checkbox>
|
||||||
|
<p class="comment">选中后,表示如果请求来自常见搜索引擎的IP,则直接跳过当前规则集。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<submit-btn></submit-btn>
|
<submit-btn></submit-btn>
|
||||||
</form>
|
</form>
|
||||||
Reference in New Issue
Block a user