whitelist.go 572 B

123456789101112131415161718192021222324
  1. package parser
  2. import (
  3. "net"
  4. "github.com/antonmedv/expr/vm"
  5. "github.com/crowdsecurity/crowdsec/pkg/exprhelpers"
  6. )
  7. type Whitelist struct {
  8. Reason string `yaml:"reason,omitempty"`
  9. Ips []string `yaml:"ip,omitempty"`
  10. B_Ips []net.IP
  11. Cidrs []string `yaml:"cidr,omitempty"`
  12. B_Cidrs []*net.IPNet
  13. Exprs []string `yaml:"expression,omitempty"`
  14. B_Exprs []*ExprWhitelist
  15. }
  16. type ExprWhitelist struct {
  17. Filter *vm.Program
  18. ExprDebugger *exprhelpers.ExprDebugger // used to debug expression by printing the content of each variable of the expression
  19. }