Repository: coreruleset/go-ftw
Pull request #86 (2022-10-03 17:17:53)

chore: 🚀 to coreruleset organization
Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>

Let's move! 🕺 

fzipi: Merging after approval. Need this to fix tests in the CRS repo.

Patch:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 2909814..d5c2cf8 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -4,7 +4,6 @@ repos:
   hooks:
     - id: go-fmt
     - id: go-vet
-    - id: go-lint
     - id: go-imports
     - id: go-cyclo
       args: [-over=15]
diff --git a/README.md b/README.md
index 7ede5ab..29eaaa7 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,13 @@
 # Go-FTW - Framework for Testing WAFs in Go!
 
 [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
-[![Go Report Card](https://goreportcard.com/badge/github.com/fzipi/go-ftw)](https://goreportcard.com/report/github.com/fzipi/go-ftw)
-[![Go Doc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](http://godoc.org/github.com/fzipi/go-ftw)
-[![PkgGoDev](https://pkg.go.dev/badge/github.com/fzipi/go-ftw)](https://pkg.go.dev/github.com/fzipi/go-ftw)
-[![Release](https://img.shields.io/github/v/release/fzipi/go-ftw.svg?style=flat-square)](https://github.com/fzipi/go-ftw/releases/latest)
-[![Total alerts](https://img.shields.io/lgtm/alerts/g/fzipi/go-ftw.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/fzipi/go-ftw/alerts/)
-[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=fzipi_go-ftw&metric=coverage)](https://sonarcloud.io/dashboard?id=fzipi_go-ftw)
-[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=fzipi_go-ftw&metric=alert_status)](https://sonarcloud.io/dashboard?id=fzipi_go-ftw)
+[![Go Report Card](https://goreportcard.com/badge/github.com/coreruleset/go-ftw)](https://goreportcard.com/report/github.com/coreruleset/go-ftw)
+[![Go Doc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](http://godoc.org/github.com/coreruleset/go-ftw)
+[![PkgGoDev](https://pkg.go.dev/badge/github.com/coreruleset/go-ftw)](https://pkg.go.dev/github.com/coreruleset/go-ftw)
+[![Release](https://img.shields.io/github/v/release/coreruleset/go-ftw.svg?style=flat-square)](https://github.com/coreruleset/go-ftw/releases/latest)
+[![Total alerts](https://img.shields.io/lgtm/alerts/g/coreruleset/go-ftw.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/coreruleset/go-ftw/alerts/)
+[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=coreruleset_go-ftw&metric=coverage)](https://sonarcloud.io/dashboard?id=coreruleset_go-ftw)
+[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=coreruleset_go-ftw&metric=alert_status)](https://sonarcloud.io/dashboard?id=coreruleset_go-ftw)
 
 
 This software should be compatible with the [Python version](https://pypi.org/project/ftw/).
@@ -25,11 +25,11 @@ My goals are:
 
 ## Install
 
-Go to the [releases](https://github.com/fzipi/go-ftw/releases) page and get the one that matches your OS.
+Go to the [releases](https://github.com/coreruleset/go-ftw/releases) page and get the one that matches your OS.
 
 If you have Go installed and configured to run Go binaries from your shell you can also run
 ```bash
-go install github.com/fzipi/go-ftw@latest
+go install github.com/coreruleset/go-ftw@latest
 ```
 
 ## Example Usage
@@ -251,4 +251,4 @@ You can configure the name of the HTTP header by setting the `logmarkerheadernam
 option in the configuration to a custom value (the value is case insensitive).
 
 ## License
-[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ffzipi%2Fgo-ftw.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Ffzipi%2Fgo-ftw?ref=badge_large)
+[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcoreruleset%2Fgo-ftw.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcoreruleset%2Fgo-ftw?ref=badge_large)
diff --git a/check/base.go b/check/base.go
index d11009c..c3242e7 100644
--- a/check/base.go
+++ b/check/base.go
@@ -1,9 +1,9 @@
 package check
 
 import (
-	"github.com/fzipi/go-ftw/config"
-	"github.com/fzipi/go-ftw/test"
-	"github.com/fzipi/go-ftw/waflog"
+	"github.com/coreruleset/go-ftw/config"
+	"github.com/coreruleset/go-ftw/test"
+	"github.com/coreruleset/go-ftw/waflog"
 )
 
 // FTWCheck is the base struct for checking test results
diff --git a/cmd/check.go b/cmd/check.go
index 80e739d..7cc37db 100644
--- a/cmd/check.go
+++ b/cmd/check.go
@@ -8,7 +8,7 @@ import (
 	"github.com/rs/zerolog/log"
 	"github.com/spf13/cobra"
 
-	"github.com/fzipi/go-ftw/test"
+	"github.com/coreruleset/go-ftw/test"
 )
 
 // checkCmd represents the check command
diff --git a/cmd/root.go b/cmd/root.go
index 3c1804b..6b3a36a 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -7,7 +7,7 @@ import (
 	"github.com/rs/zerolog"
 	"github.com/spf13/cobra"
 
-	"github.com/fzipi/go-ftw/config"
+	"github.com/coreruleset/go-ftw/config"
 )
 
 var (
diff --git a/cmd/run.go b/cmd/run.go
index e3fb197..6a9aeaa 100644
--- a/cmd/run.go
+++ b/cmd/run.go
@@ -11,8 +11,8 @@ import (
 	"github.com/rs/zerolog/log"
 	"github.com/spf13/cobra"
 
-	"github.com/fzipi/go-ftw/runner"
-	"github.com/fzipi/go-ftw/test"
+	"github.com/coreruleset/go-ftw/runner"
+	"github.com/coreruleset/go-ftw/test"
 )
 
 // cleanCmd represents the clean command
diff --git a/config/types.go b/config/types.go
index 2a16402..e7ff0f9 100644
--- a/config/types.go
+++ b/config/types.go
@@ -1,6 +1,6 @@
 package config
 
-import "github.com/fzipi/go-ftw/test"
+import "github.com/coreruleset/go-ftw/test"
 
 // RunMode represents the mode of the test run
 type RunMode string
diff --git a/ftwhttp/request.go b/ftwhttp/request.go
index e70285a..e84c836 100644
--- a/ftwhttp/request.go
+++ b/ftwhttp/request.go
@@ -9,7 +9,7 @@ import (
 
 	"github.com/rs/zerolog/log"
 
-	"github.com/fzipi/go-ftw/utils"
+	"github.com/coreruleset/go-ftw/utils"
 )
 
 // ToString converts the request line to string for sending it in the wire
diff --git a/go.mod b/go.mod
index 304e5ab..cfb679e 100644
--- a/go.mod
+++ b/go.mod
@@ -1,25 +1,38 @@
-module github.com/fzipi/go-ftw
+module github.com/coreruleset/go-ftw
 
-go 1.16
+go 1.18
 
 require (
-	github.com/Masterminds/goutils v1.1.1 // indirect
-	github.com/Masterminds/semver v1.5.0 // indirect
 	github.com/Masterminds/sprig v2.22.0+incompatible
-	github.com/fatih/color v1.11.0 // indirect
 	github.com/goccy/go-yaml v1.8.9
 	github.com/google/uuid v1.2.0
-	github.com/huandu/xstrings v1.3.2 // indirect
 	github.com/icza/backscanner v0.0.0-20200205093934-2120fccb01f7
-	github.com/imdario/mergo v0.3.12 // indirect
 	github.com/knadh/koanf v1.0.0
 	github.com/kyokomi/emoji v2.2.4+incompatible
-	github.com/pelletier/go-toml v1.9.1 // indirect
 	github.com/rs/zerolog v1.22.0
 	github.com/spf13/cobra v1.1.3
-	github.com/stretchr/testify v1.5.1 // indirect
 	github.com/yargevad/filepathx v1.0.0
-	golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
 	golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
+)
+
+require (
+	github.com/Masterminds/goutils v1.1.1 // indirect
+	github.com/Masterminds/semver v1.5.0 // indirect
+	github.com/fatih/color v1.11.0 // indirect
+	github.com/fsnotify/fsnotify v1.4.9 // indirect
+	github.com/huandu/xstrings v1.3.2 // indirect
+	github.com/imdario/mergo v0.3.12 // indirect
+	github.com/inconshreveable/mousetrap v1.0.0 // indirect
+	github.com/mattn/go-colorable v0.1.8 // indirect
+	github.com/mattn/go-isatty v0.0.12 // indirect
+	github.com/mitchellh/copystructure v1.2.0 // indirect
+	github.com/mitchellh/mapstructure v1.4.1 // indirect
+	github.com/mitchellh/reflectwalk v1.0.2 // indirect
+	github.com/pelletier/go-toml v1.9.1 // indirect
+	github.com/spf13/pflag v1.0.5 // indirect
+	github.com/stretchr/testify v1.5.1 // indirect
+	golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
 	golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 // indirect
+	golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
+	gopkg.in/yaml.v2 v2.4.0 // indirect
 )
diff --git a/main.go b/main.go
index 4c1e03b..51f9f00 100644
--- a/main.go
+++ b/main.go
@@ -11,7 +11,7 @@ import (
 	"github.com/rs/zerolog"
 	"github.com/rs/zerolog/log"
 
-	"github.com/fzipi/go-ftw/cmd"
+	"github.com/coreruleset/go-ftw/cmd"
 )
 
 // nolint: gochecknoglobals
diff --git a/runner/run.go b/runner/run.go
index aa52184..1671018 100644
--- a/runner/run.go
+++ b/runner/run.go
@@ -9,12 +9,12 @@ import (
 	"github.com/kyokomi/emoji"
 	"github.com/rs/zerolog/log"
 
-	"github.com/fzipi/go-ftw/check"
-	"github.com/fzipi/go-ftw/config"
-	"github.com/fzipi/go-ftw/ftwhttp"
-	"github.com/fzipi/go-ftw/test"
-	"github.com/fzipi/go-ftw/utils"
-	"github.com/fzipi/go-ftw/waflog"
+	"github.com/coreruleset/go-ftw/check"
+	"github.com/coreruleset/go-ftw/config"
+	"github.com/coreruleset/go-ftw/ftwhttp"
+	"github.com/coreruleset/go-ftw/test"
+	"github.com/coreruleset/go-ftw/utils"
+	"github.com/coreruleset/go-ftw/waflog"
 )
 
 // Run runs your tests with the specified Config. Returns error if some test failed
diff --git a/runner/types.go b/runner/types.go
index a4bf40d..f1327f5 100644
--- a/runner/types.go
+++ b/runner/types.go
@@ -4,9 +4,9 @@ import (
 	"regexp"
 	"time"
 
-	"github.com/fzipi/go-ftw/config"
-	"github.com/fzipi/go-ftw/ftwhttp"
-	"github.com/fzipi/go-ftw/waflog"
+	"github.com/coreruleset/go-ftw/config"
+	"github.com/coreruleset/go-ftw/ftwhttp"
+	"github.com/coreruleset/go-ftw/waflog"
 )
 
 // Config provides configuration for the test runner.
diff --git a/sonar-project.properties b/sonar-project.properties
index dcabb90..f76c477 100644
--- a/sonar-project.properties
+++ b/sonar-project.properties
@@ -1,5 +1,5 @@
-sonar.projectKey=fzipi_go-ftw
-sonar.organization=fzipi
+sonar.projectKey=coreruleset_go-ftw
+sonar.organization=coreruleset
 
 # This is the name and version displayed in the SonarCloud UI.
 sonar.projectName=go-ftw
diff --git a/waflog/read.go b/waflog/read.go
index c95d321..91186cc 100644
--- a/waflog/read.go
+++ b/waflog/read.go
@@ -9,7 +9,7 @@ import (
 	"github.com/icza/backscanner"
 	"github.com/rs/zerolog/log"
 
-	"github.com/fzipi/go-ftw/config"
+	"github.com/coreruleset/go-ftw/config"
 )
 
 // Contains looks in logfile for regex
diff --git a/waflog/waflog.go b/waflog/waflog.go
index 3a92417..7be09e1 100644
--- a/waflog/waflog.go
+++ b/waflog/waflog.go
@@ -5,7 +5,7 @@ import (
 
 	"github.com/rs/zerolog/log"
 
-	"github.com/fzipi/go-ftw/config"
+	"github.com/coreruleset/go-ftw/config"
 )
 
 // NewFTWLogLines is the base struct for reading the log file


Test patch:
diff --git a/check/base_test.go b/check/base_test.go
index ad7239f..ff0595c 100644
--- a/check/base_test.go
+++ b/check/base_test.go
@@ -4,8 +4,8 @@ import (
 	"sort"
 	"testing"
 
-	"github.com/fzipi/go-ftw/config"
-	"github.com/fzipi/go-ftw/test"
+	"github.com/coreruleset/go-ftw/config"
+	"github.com/coreruleset/go-ftw/test"
 )
 
 var yamlApacheConfig = `---
diff --git a/check/error_test.go b/check/error_test.go
index 5e968cc..af661c7 100644
--- a/check/error_test.go
+++ b/check/error_test.go
@@ -4,7 +4,7 @@ import (
 	"errors"
 	"testing"
 
-	"github.com/fzipi/go-ftw/config"
+	"github.com/coreruleset/go-ftw/config"
 )
 
 var expectedOKTests = []struct {
diff --git a/check/logs_test.go b/check/logs_test.go
index a1a2a40..6ebbf2c 100644
--- a/check/logs_test.go
+++ b/check/logs_test.go
@@ -4,8 +4,8 @@ import (
 	"os"
 	"testing"
 
-	"github.com/fzipi/go-ftw/config"
-	"github.com/fzipi/go-ftw/utils"
+	"github.com/coreruleset/go-ftw/config"
+	"github.com/coreruleset/go-ftw/utils"
 )
 
 var logText = `[Tue Jan 05 02:21:09.637165 2021] [:error] [pid 76:tid 139683434571520] [client 172.23.0.1:58998] [client 172.23.0.1] ModSecurity: Warning. Pattern match "\\\\b(?:keep-alive|close),\\\\s?(?:keep-alive|close)\\\\b" at REQUEST_HEADERS:Connection. [file "/etc/modsecurity.d/owasp-crs/rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf"] [line "339"] [id "920210"] [msg "Multiple/Conflicting Connection Header Data Found"] [data "close,close"] [severity "WARNING"] [ver "OWASP_CRS/3.3.0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-protocol"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/210/272"] [hostname "localhost"] [uri "/"] [unique_id "X-PNFSe1VwjCgYRI9FsbHgAAAIY"]
diff --git a/check/response_test.go b/check/response_test.go
index a78d87c..4428031 100644
--- a/check/response_test.go
+++ b/check/response_test.go
@@ -3,7 +3,7 @@ package check
 import (
 	"testing"
 
-	"github.com/fzipi/go-ftw/config"
+	"github.com/coreruleset/go-ftw/config"
 )
 
 var expectedResponseOKTests = []struct {
diff --git a/check/status_test.go b/check/status_test.go
index d4b7df9..8656c56 100644
--- a/check/status_test.go
+++ b/check/status_test.go
@@ -3,7 +3,7 @@ package check
 import (
 	"testing"
 
-	"github.com/fzipi/go-ftw/config"
+	"github.com/coreruleset/go-ftw/config"
 )
 
 var statusOKTests = []struct {
diff --git a/config/config_test.go b/config/config_test.go
index 68fcac4..45952b7 100644
--- a/config/config_test.go
+++ b/config/config_test.go
@@ -6,7 +6,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/fzipi/go-ftw/utils"
+	"github.com/coreruleset/go-ftw/utils"
 )
 
 var yamlConfig = `---
diff --git a/runner/run_test.go b/runner/run_test.go
index c1e9928..1432d82 100644
--- a/runner/run_test.go
+++ b/runner/run_test.go
@@ -10,10 +10,10 @@ import (
 
 	"github.com/rs/zerolog/log"
 
-	"github.com/fzipi/go-ftw/check"
-	"github.com/fzipi/go-ftw/config"
-	"github.com/fzipi/go-ftw/ftwhttp"
-	"github.com/fzipi/go-ftw/test"
+	"github.com/coreruleset/go-ftw/check"
+	"github.com/coreruleset/go-ftw/config"
+	"github.com/coreruleset/go-ftw/ftwhttp"
+	"github.com/coreruleset/go-ftw/test"
 )
 
 var yamlConfig = `
diff --git a/test/defaults.go b/test/defaults.go
index 32de7dd..54bdd16 100644
--- a/test/defaults.go
+++ b/test/defaults.go
@@ -3,7 +3,7 @@ package test
 import (
 	"encoding/base64"
 
-	"github.com/fzipi/go-ftw/utils"
+	"github.com/coreruleset/go-ftw/utils"
 )
 
 // GetMethod returns the proper semantic when the field is empty
diff --git a/test/defaults_test.go b/test/defaults_test.go
index 33feb25..25a618e 100644
--- a/test/defaults_test.go
+++ b/test/defaults_test.go
@@ -4,7 +4,7 @@ import (
 	"bytes"
 	"testing"
 
-	"github.com/fzipi/go-ftw/ftwhttp"
+	"github.com/coreruleset/go-ftw/ftwhttp"
 )
 
 func getTestInputDefaults() *Input {
diff --git a/test/errors_test.go b/test/errors_test.go
index ef0c843..9701fb6 100644
--- a/test/errors_test.go
+++ b/test/errors_test.go
@@ -3,7 +3,7 @@ package test
 import (
 	"testing"
 
-	"github.com/fzipi/go-ftw/utils"
+	"github.com/coreruleset/go-ftw/utils"
 )
 
 var errorsTest = `---
diff --git a/test/files_test.go b/test/files_test.go
index 49ace73..20d5440 100644
--- a/test/files_test.go
+++ b/test/files_test.go
@@ -4,7 +4,7 @@ import (
 	"regexp"
 	"testing"
 
-	"github.com/fzipi/go-ftw/utils"
+	"github.com/coreruleset/go-ftw/utils"
 )
 
 var yamlTest = `
diff --git a/test/types.go b/test/types.go
index 4ff02bd..44a5e3f 100644
--- a/test/types.go
+++ b/test/types.go
@@ -1,6 +1,6 @@
 package test
 
-import "github.com/fzipi/go-ftw/ftwhttp"
+import "github.com/coreruleset/go-ftw/ftwhttp"
 
 // Input represents the input request in a stage
 // The fields `Version`, `Method` and `URI` we want to explicitly now when they are set to ""
diff --git a/waflog/read_test.go b/waflog/read_test.go
index 51e80ea..41d49c0 100644
--- a/waflog/read_test.go
+++ b/waflog/read_test.go
@@ -7,8 +7,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/fzipi/go-ftw/config"
-	"github.com/fzipi/go-ftw/utils"
+	"github.com/coreruleset/go-ftw/config"
+	"github.com/coreruleset/go-ftw/utils"
 )
 
 func TestReadCheckLogForMarkerNoMarkerAtEnd(t *testing.T) {
diff --git a/waflog/waflog_test.go b/waflog/waflog_test.go
index 19eadd6..2da0bf0 100644
--- a/waflog/waflog_test.go
+++ b/waflog/waflog_test.go
@@ -3,7 +3,7 @@ package waflog
 import (
 	"testing"
 
-	"github.com/fzipi/go-ftw/config"
+	"github.com/coreruleset/go-ftw/config"
 )
 
 func TestNewFTWLogLines(t *testing.T) {