Files
EdgeNode/internal/waf
2024-05-06 21:06:55 +08:00
..
2024-04-15 08:42:33 +08:00
2024-01-21 11:13:30 +08:00
2024-05-03 15:31:40 +08:00
2021-07-18 15:51:49 +08:00
2021-07-18 15:51:49 +08:00
2021-07-18 15:51:49 +08:00
2024-04-07 14:31:22 +08:00
2020-10-08 15:06:42 +08:00
2024-04-07 14:31:22 +08:00
2024-05-03 15:31:40 +08:00
2024-05-05 19:10:46 +08:00
2023-05-28 17:11:33 +08:00
2024-04-07 14:31:22 +08:00
2023-11-30 17:25:41 +08:00
2024-04-07 14:31:22 +08:00
2024-04-07 14:31:22 +08:00
2024-04-07 14:31:22 +08:00
2024-04-07 14:31:22 +08:00
2024-05-05 19:10:46 +08:00
2020-10-08 15:06:42 +08:00
2024-01-21 11:13:30 +08:00
2024-05-05 19:10:46 +08:00
2024-05-05 19:10:46 +08:00

WAF

A basic WAF for TeaWeb.

Config Constructions

WAF
  Inbound
	  Rule Groups
		Rule Sets
		  Rules
			Checkpoint Param <Operator> Value
  Outbound
  	  Rule Groups
  	    ... 				

Apply WAF

Request  -->  WAF  -->   Backends
			/
Response  <-- WAF <----		

Coding

waf := teawaf.NewWAF()

// add rule groups here

err := waf.Init()
if err != nil {
	return
}
waf.Start()

// match http request
// (req *http.Request, responseWriter http.ResponseWriter)
goNext, ruleSet, _ := waf.MatchRequest(req, responseWriter)
if ruleSet != nil {
	log.Println("meet rule set:", ruleSet.Name, "action:", ruleSet.Action)
}
if !goNext {
	return
}

// stop the waf
// waf.Stop()