mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 07:40:56 +08:00 
			
		
		
		
	WAF允许动作默认跳过所有规则
This commit is contained in:
		@@ -132,7 +132,7 @@ func (this *RecordIPAction) WillChange() bool {
 | 
			
		||||
	return this.Type == "black"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (this *RecordIPAction) Perform(waf *WAF, group *RuleGroup, set *RuleSet, request requests.Request, writer http.ResponseWriter) (continueRequest bool, goNextSet bool) {
 | 
			
		||||
func (this *RecordIPAction) Perform(waf *WAF, group *RuleGroup, set *RuleSet, request requests.Request, writer http.ResponseWriter) PerformResult {
 | 
			
		||||
	var ipListId = this.IPListId
 | 
			
		||||
	if ipListId <= 0 {
 | 
			
		||||
		ipListId = firewallconfigs.GlobalListId
 | 
			
		||||
@@ -143,7 +143,11 @@ func (this *RecordIPAction) Perform(waf *WAF, group *RuleGroup, set *RuleSet, re
 | 
			
		||||
 | 
			
		||||
	// 是否在本地白名单中
 | 
			
		||||
	if SharedIPWhiteList.Contains("set:"+types.String(set.Id), this.Scope, request.WAFServerId(), request.WAFRemoteIP()) {
 | 
			
		||||
		return true, false
 | 
			
		||||
		return PerformResult{
 | 
			
		||||
			ContinueRequest: true,
 | 
			
		||||
			IsAllowed:       true,
 | 
			
		||||
			AllowScope:      AllowScopeGlobal,
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var timeout = this.Timeout
 | 
			
		||||
@@ -200,5 +204,10 @@ func (this *RecordIPAction) Perform(waf *WAF, group *RuleGroup, set *RuleSet, re
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return this.Type != "black", false
 | 
			
		||||
	var isWhite = this.Type != "black"
 | 
			
		||||
	return PerformResult{
 | 
			
		||||
		ContinueRequest: isWhite,
 | 
			
		||||
		IsAllowed:       isWhite,
 | 
			
		||||
		AllowScope:      AllowScopeGlobal,
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user