diff --git a/.goreleaser.yml b/.goreleaser.yml index 2000e19..967bb12 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -78,7 +78,7 @@ nfpms: package_name: coraza-caddy vendor: Coraza Technologies - homepage: https://github.com/jptosso/coraza-waf + homepage: https://github.com/corazawaf/coraza maintainer: Juan Pablo Tosso description: | Caddy - Powerful, enterprise-ready, open source web server with automatic HTTPS written in Go. Integrated with Coraza Web Application Firewall diff --git a/README.md b/README.md index 83b0323..4642d94 100644 --- a/README.md +++ b/README.md @@ -67,11 +67,11 @@ $ go test ./...` ## Compiling with CRS support -Uncomment the plugins github.com/jptosso/coraza-libinjection and github.com/coraza-pcre from caddy/main.go and then compile. +Uncomment the plugin github.com/coraza-pcre from caddy/main.go and then compile. ## Using OWASP Core Ruleset -Once you have enabled your plugin, you will have to clone coreruleset and download the default coraza configurations from [Coraza repository](https://raw.githubusercontent.com/jptosso/coraza-waf/v2/master/coraza.conf-recommended), then add the following to you coraza_waf directive: +Once you have enabled your plugin, you will have to clone coreruleset and download the default coraza configurations from [Coraza repository](https://raw.githubusercontent.com/corazawaf/coraza/v2/master/coraza.conf-recommended), then add the following to you coraza_waf directive: ``` include caddypath/coraza.conf-recommended diff --git a/coraza.go b/coraza.go index 7e3135d..1ef06ea 100644 --- a/coraza.go +++ b/coraza.go @@ -11,9 +11,9 @@ import ( "github.com/caddyserver/caddy/v2/caddyconfig/caddyfile" "github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile" "github.com/caddyserver/caddy/v2/modules/caddyhttp" - "github.com/jptosso/coraza-waf/v2" - "github.com/jptosso/coraza-waf/v2/seclang" - "github.com/jptosso/coraza-waf/v2/types" + "github.com/corazawaf/coraza/v2" + "github.com/corazawaf/coraza/v2/seclang" + "github.com/corazawaf/coraza/v2/types" "go.uber.org/zap" ) diff --git a/go.mod b/go.mod index 51b2ffe..94e24b7 100644 --- a/go.mod +++ b/go.mod @@ -5,13 +5,13 @@ go 1.16 require ( github.com/caddyserver/caddy/v2 v2.4.5 github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/jptosso/coraza-waf/v2 v2.0.0-rc.2 + github.com/corazawaf/coraza/v2 v2.0.0-rc.3 github.com/miekg/dns v1.1.43 // indirect github.com/prometheus/common v0.30.0 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/sirupsen/logrus v1.8.1 // indirect go.uber.org/atomic v1.9.0 // indirect - go.uber.org/multierr v1.7.0 // indirect + go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.21.0 golang.org/x/crypto v0.0.0-20210920023735-84f357641f63 // indirect golang.org/x/net v0.0.0-20210917221730-978cfadd31cf // indirect diff --git a/go.sum b/go.sum index 97a9175..806b6d8 100644 --- a/go.sum +++ b/go.sum @@ -212,6 +212,9 @@ github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoC github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/cli v1.20.0/go.mod h1:/qJNoX69yVSKu5o4jLyXAENLRyk1uhi7zkbQ3slBdOA= +github.com/corazawaf/coraza/v2 v2.0.0-rc.3 h1:eBj32X1gZlGyCU9jLU/KiwRDapXnIpWHkDb25I1DFrY= +github.com/corazawaf/coraza/v2 v2.0.0-rc.3/go.mod h1:lLTGaUlgP44aotO3gr2vAj+l1jyOes7GnoG8xnPfox0= +github.com/corazawaf/libinjection-go v0.0.0-20220207031228-44e9c4250eb5 h1:SukhxLQRRBM3nJFEUF+ePG7l0JTWAvaxaG/o6X/FQVY= github.com/corazawaf/libinjection-go v0.0.0-20220207031228-44e9c4250eb5/go.mod h1:OP4TM7xdJ2skyXqNX1AN1wN5nNZEmJNuWbNPOItn7aw= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -533,10 +536,6 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22 github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/jptosso/coraza-waf/v2 v2.0.0-beta.6 h1:2pJN9paVO2/kXrgNFJLJKOJGr7yD3GGt8HDLRBu3oac= -github.com/jptosso/coraza-waf/v2 v2.0.0-beta.6/go.mod h1:d9K0ycCNi9YmgqQKjgOheq73EY4l6fB8Y6HdLWcx5FM= -github.com/jptosso/coraza-waf/v2 v2.0.0-rc.2 h1:WSQ9d3Joh8P+BFIMwH+9L3IOPAbNWTkhBRadhhHl7hU= -github.com/jptosso/coraza-waf/v2 v2.0.0-rc.2/go.mod h1:LyVKwq97JanBosBpJU856jeNi//F8Gr3AIkyl0bRRtE= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -1009,15 +1008,14 @@ go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723 h1:sHOAIxRGBp443oHZIPB+HsUGaksVCXVQENPxwTfQdH4= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= -go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= @@ -1025,9 +1023,6 @@ go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= -go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= -go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= diff --git a/stream.go b/stream.go index 5d09302..2fd2fb6 100644 --- a/stream.go +++ b/stream.go @@ -5,7 +5,7 @@ import ( "net/http" "github.com/caddyserver/caddy/v2/modules/caddyhttp" - "github.com/jptosso/coraza-waf/v2" + "github.com/corazawaf/coraza/v2" ) type StreamRecorder struct {