github.com/TeaOSLab/EdgeNode@v1.3.8/internal/waf/action_types.go (about) 1 package waf 2 3 import "reflect" 4 5 type ActionString = string 6 7 const ( 8 ActionLog ActionString = "log" // allow and log 9 ActionBlock ActionString = "block" // block 10 ActionCaptcha ActionString = "captcha" // block and show captcha 11 ActionJavascriptCookie ActionString = "js_cookie" // js cookie 12 ActionNotify ActionString = "notify" // 告警 13 ActionGet302 ActionString = "get_302" // 针对GET的302重定向认证 14 ActionPost307 ActionString = "post_307" // 针对POST的307重定向认证 15 ActionRecordIP ActionString = "record_ip" // 记录IP 16 ActionTag ActionString = "tag" // 标签 17 ActionPage ActionString = "page" // 显示网页 18 ActionRedirect ActionString = "redirect" // 跳转 19 ActionAllow ActionString = "allow" // allow 20 ActionGoGroup ActionString = "go_group" // go to next rule group 21 ActionGoSet ActionString = "go_set" // go to next rule set 22 ) 23 24 var AllActions = []*ActionDefinition{ 25 { 26 Name: "阻止", 27 Code: ActionBlock, 28 Instance: new(BlockAction), 29 Type: reflect.TypeOf(new(BlockAction)).Elem(), 30 }, 31 { 32 Name: "允许通过", 33 Code: ActionAllow, 34 Instance: new(AllowAction), 35 Type: reflect.TypeOf(new(AllowAction)).Elem(), 36 }, 37 { 38 Name: "允许并记录日志", 39 Code: ActionLog, 40 Instance: new(LogAction), 41 Type: reflect.TypeOf(new(LogAction)).Elem(), 42 }, 43 { 44 Name: "Captcha验证码", 45 Code: ActionCaptcha, 46 Instance: new(CaptchaAction), 47 Type: reflect.TypeOf(new(CaptchaAction)).Elem(), 48 }, 49 { 50 Name: "JS Cookie验证", 51 Code: ActionJavascriptCookie, 52 Instance: new(JSCookieAction), 53 Type: reflect.TypeOf(new(JSCookieAction)).Elem(), 54 }, 55 { 56 Name: "告警", 57 Code: ActionNotify, 58 Instance: new(NotifyAction), 59 Type: reflect.TypeOf(new(NotifyAction)).Elem(), 60 }, 61 { 62 Name: "GET 302", 63 Code: ActionGet302, 64 Instance: new(Get302Action), 65 Type: reflect.TypeOf(new(Get302Action)).Elem(), 66 }, 67 { 68 Name: "POST 307", 69 Code: ActionPost307, 70 Instance: new(Post307Action), 71 Type: reflect.TypeOf(new(Post307Action)).Elem(), 72 }, 73 { 74 Name: "记录IP", 75 Code: ActionRecordIP, 76 Instance: new(RecordIPAction), 77 Type: reflect.TypeOf(new(RecordIPAction)).Elem(), 78 }, 79 { 80 Name: "标签", 81 Code: ActionTag, 82 Instance: new(TagAction), 83 Type: reflect.TypeOf(new(TagAction)).Elem(), 84 }, 85 { 86 Name: "显示页面", 87 Code: ActionPage, 88 Instance: new(PageAction), 89 Type: reflect.TypeOf(new(PageAction)).Elem(), 90 }, 91 { 92 Name: "跳转", 93 Code: ActionRedirect, 94 Instance: new(RedirectAction), 95 Type: reflect.TypeOf(new(RedirectAction)).Elem(), 96 }, 97 { 98 Name: "跳到下一个规则分组", 99 Code: ActionGoGroup, 100 Instance: new(GoGroupAction), 101 Type: reflect.TypeOf(new(GoGroupAction)).Elem(), 102 }, 103 { 104 Name: "跳到下一个规则集", 105 Code: ActionGoSet, 106 Instance: new(GoSetAction), 107 Type: reflect.TypeOf(new(GoSetAction)).Elem(), 108 }, 109 }