WAF参数中增加“请求来源”

This commit is contained in:
GoEdgeLab
2023-12-24 10:03:01 +08:00
parent 112087a76b
commit 3136f986d7
3 changed files with 14 additions and 1 deletions

View File

@@ -24,4 +24,5 @@ type HTTPFirewallCheckpointDefinition struct {
IsComposed bool `json:"isComposed"` // 是否为组合的checkpoint
Priority int `json:"priority"` // 优先级
DataType string `json:"dataType"` // 数据类型number, bool等
Version string `json:"version"` // 被加入的版本号
}

View File

@@ -168,7 +168,15 @@ var AllCheckpoints = []*HTTPFirewallCheckpointDefinition{
DataType: "bool",
},
{
Name: "请求来源URL",
Name: "请求来源",
Prefix: "refererOrigin",
Description: "请求报头中的Referer和Origin值。",
IsRequest: true,
Priority: 100,
Version: "1.3.2",
},
{
Name: "请求来源Referer",
Prefix: "referer",
Description: "请求报头中的Referer值。",
IsRequest: true,
@@ -231,6 +239,7 @@ var AllCheckpoints = []*HTTPFirewallCheckpointDefinition{
Description: "使用换行符(\\n隔开的报头名称字符串每行一个名称。",
IsRequest: true,
Priority: 100,
Version: "1.3.2",
},
{
Name: "单个请求报头值",

View File

@@ -19,6 +19,9 @@ func TestRuleCheckpoint_Markdown(t *testing.T) {
row += "* 名称:" + def.Name + "\n"
row += "* 代号:`${" + def.Prefix + "}`\n"
row += "* 描述:" + def.Description + "\n"
if len(def.Version) > 0 {
row += "* 版本v" + def.Version + "\n"
}
result = append(result, row)
}