corazawaf / coraza-spoa

EXPERIMENTAL: A wrapper around the OWASP Coraza WAF for HAProxy's SPOE filters
Apache License 2.0
74 stars 16 forks source link

Drop logger, logLevel and use coraza's #70

Open jcchavezs opened 1 year ago

jcchavezs commented 1 year ago

Right now this connector spins up a new zap logger on bootstrap. Spawning a new zap logger for a connector is overkill, more so when the transactions carry a logger that are controlled by the directives log level (so it is consistent) and it is efficient when it comes to allocation. Removing a dependency is usually a good practice.

Lines https://github.com/corazawaf/coraza-spoa/blob/main/internal/spoa.go#L175-L193 should be removed. In case spoe has a logger we could plug that into WAF setup (e.g. https://github.com/corazawaf/coraza-caddy/blob/main/logger.go), otherwise we should follow and use the default WAF logger.