Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context is a WAF execution context. It allows to run the WAF incrementally by calling it multiple times to run its rules every time new addresses become available. Each request must have its own Context.
func NewContext ¶
NewContext creates a new WAF context and increases the number of references to the WAF handle. A nil value is returned when the WAF handle can no longer be used or the WAF context couldn't be created.
func (*Context) Close ¶
func (c *Context) Close()
Close the WAF context by releasing its C memory and decreasing the number of references to the WAF handle.
func (*Context) Run ¶
func (c *Context) Run(values map[string]interface{}, timeout time.Duration) (matches []byte, actions []string, err error)
Run the WAF with the given Go values and timeout.
func (*Context) TotalRuntime ¶
TotalRuntime returns the cumulated WAF runtime across various run calls within the same WAF context. Returned time is in nanoseconds.
func (*Context) TotalTimeouts ¶
TotalTimeouts returns the cumulated amount of WAF timeouts across various run calls within the same WAF context.
type Handle ¶
type Handle struct {
// contains filtered or unexported fields
}
Handle represents an instance of the WAF for a given ruleset.
func NewHandle ¶
NewHandle creates a new instance of the WAF with the given JSON rule and key/value regexps for obfuscation.
func NewHandleFromRuleSet ¶ added in v1.1.0
NewHandleFromRuleSet creates a new instance of the WAF with the given ruleset and key/value regexps for obfuscation.
func (*Handle) Close ¶
func (h *Handle) Close()
Close the WAF handle. Note that this call doesn't block until the handle gets released but instead let WAF contexts still use it until there's no more (eg. when swapping the WAF handle with a new one).
func (*Handle) RulesetInfo ¶
func (h *Handle) RulesetInfo() RulesetInfo
RulesetInfo returns the rules initialization metrics for the current WAF handle
type RulesetInfo ¶
type RulesetInfo struct { // Number of rules successfully loaded Loaded uint16 // Number of rules which failed to parse Failed uint16 // Map from an error string to an array of all the rule ids for which // that error was raised. {error: [rule_ids]} Errors map[string]interface{} // Ruleset version Version string }
RulesetInfo stores the information - provided by the WAF - about WAF rules initialization.
Directories ¶
Path | Synopsis |
---|---|
Package include is required to help go tools support vendoring.
|
Package include is required to help go tools support vendoring. |
lib
|
|
darwin-amd64
Package vendor is required to help go tools support vendoring.
|
Package vendor is required to help go tools support vendoring. |
darwin-arm64
Package vendor is required to help go tools support vendoring.
|
Package vendor is required to help go tools support vendoring. |
linux-amd64
Package vendor is required to help go tools support vendoring.
|
Package vendor is required to help go tools support vendoring. |
linux-arm64
Package vendor is required to help go tools support vendoring.
|
Package vendor is required to help go tools support vendoring. |