IP名单优化

* 增加IP灰名单,用于仅记录并观察IP
* 优化IP名单同步版本号管理
* WAF记录IP动作优先记录到网站和策略相关的IP名单中
This commit is contained in:
GoEdgeLab
2024-05-05 19:10:46 +08:00
parent 4eccec6b84
commit ff823d326d
6 changed files with 71 additions and 20 deletions

View File

@@ -69,6 +69,20 @@ func (this *WAFManager) ConvertWAF(policy *firewallconfigs.HTTPFirewallPolicy) (
// inbound
if policy.Inbound != nil && policy.Inbound.IsOn {
// ip lists
if policy.Inbound.AllowListRef != nil && policy.Inbound.AllowListRef.IsOn && policy.Inbound.AllowListRef.ListId > 0 {
w.AllowListId = policy.Inbound.AllowListRef.ListId
}
if policy.Inbound.DenyListRef != nil && policy.Inbound.DenyListRef.IsOn && policy.Inbound.DenyListRef.ListId > 0 {
w.DenyListId = policy.Inbound.DenyListRef.ListId
}
if policy.Inbound.GreyListRef != nil && policy.Inbound.GreyListRef.IsOn && policy.Inbound.GreyListRef.ListId > 0 {
w.GreyListId = policy.Inbound.GreyListRef.ListId
}
// groups
for _, group := range policy.Inbound.Groups {
g := &RuleGroup{
Id: group.Id,