decouple bouncer dependencies: use go-cs-lib in test code (#2229)
This commit is contained in:
parent
364b833d67
commit
b2d3520519
23 changed files with 185 additions and 279 deletions
1
.github/workflows/bats-sqlite-coverage.yml
vendored
1
.github/workflows/bats-sqlite-coverage.yml
vendored
|
@ -72,7 +72,6 @@ jobs:
|
|||
-e '/plugins/notifications' \
|
||||
-e '/pkg/protobufs' \
|
||||
-e '/pkg/cwversions' \
|
||||
-e '/pkg/cstest' \
|
||||
-e '/pkg/models' \
|
||||
< coverage-bats-raw.out \
|
||||
> coverage-bats.out
|
||||
|
|
|
@ -13,9 +13,10 @@ import (
|
|||
tomb "gopkg.in/tomb.v2"
|
||||
"gopkg.in/yaml.v2"
|
||||
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/acquisition/configuration"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/csconfig"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/types"
|
||||
)
|
||||
|
||||
|
|
|
@ -9,9 +9,10 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/types"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
|
|
@ -11,7 +11,8 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/types"
|
||||
dockerTypes "github.com/docker/docker/api/types"
|
||||
dockerContainer "github.com/docker/docker/api/types/container"
|
||||
|
|
|
@ -13,8 +13,9 @@ import (
|
|||
"github.com/stretchr/testify/require"
|
||||
"gopkg.in/tomb.v2"
|
||||
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
|
||||
fileacquisition "github.com/crowdsecurity/crowdsec/pkg/acquisition/modules/file"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/types"
|
||||
)
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/types"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/sirupsen/logrus/hooks/test"
|
||||
|
|
|
@ -8,7 +8,8 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/types"
|
||||
"github.com/segmentio/kafka-go"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
|
|
@ -12,10 +12,11 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/kinesis"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/types"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
|
|
@ -4,8 +4,9 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
)
|
||||
|
||||
func TestPri(t *testing.T) {
|
||||
|
|
|
@ -7,7 +7,8 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/types"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"gopkg.in/tomb.v2"
|
||||
|
|
|
@ -20,11 +20,12 @@ import (
|
|||
"github.com/stretchr/testify/require"
|
||||
"gopkg.in/tomb.v2"
|
||||
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/ptr"
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/version"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/apiclient"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/csconfig"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/database"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/database/ent/decision"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/database/ent/machine"
|
||||
|
@ -60,10 +61,10 @@ func getAPIC(t *testing.T) *apic {
|
|||
metricsTomb: tomb.Tomb{},
|
||||
scenarioList: make([]string, 0),
|
||||
consoleConfig: &csconfig.ConsoleConfig{
|
||||
ShareManualDecisions: types.BoolPtr(false),
|
||||
ShareTaintedScenarios: types.BoolPtr(false),
|
||||
ShareCustomScenarios: types.BoolPtr(false),
|
||||
ShareContext: types.BoolPtr(false),
|
||||
ShareManualDecisions: ptr.Of(false),
|
||||
ShareTaintedScenarios: ptr.Of(false),
|
||||
ShareCustomScenarios: ptr.Of(false),
|
||||
ShareContext: ptr.Of(false),
|
||||
},
|
||||
isPulling: make(chan bool, 1),
|
||||
}
|
||||
|
@ -266,11 +267,11 @@ func TestAPICHandleDeletedDecisions(t *testing.T) {
|
|||
assertTotalDecisionCount(t, api.dbClient, 2)
|
||||
|
||||
nbDeleted, err := api.HandleDeletedDecisions([]*models.Decision{{
|
||||
Value: types.StrPtr("1.2.3.4"),
|
||||
Origin: types.StrPtr(types.CAPIOrigin),
|
||||
Value: ptr.Of("1.2.3.4"),
|
||||
Origin: ptr.Of(types.CAPIOrigin),
|
||||
Type: &decision1.Type,
|
||||
Scenario: types.StrPtr("crowdsec/test"),
|
||||
Scope: types.StrPtr("IP"),
|
||||
Scenario: ptr.Of("crowdsec/test"),
|
||||
Scope: ptr.Of("IP"),
|
||||
}}, deleteCounters)
|
||||
|
||||
assert.NoError(t, err)
|
||||
|
@ -294,7 +295,7 @@ func TestAPICGetMetrics(t *testing.T) {
|
|||
machineIDs: []string{},
|
||||
bouncers: []string{},
|
||||
expectedMetric: &models.Metrics{
|
||||
ApilVersion: types.StrPtr(version.String()),
|
||||
ApilVersion: ptr.Of(version.String()),
|
||||
Bouncers: []*models.MetricsBouncerInfo{},
|
||||
Machines: []*models.MetricsAgentInfo{},
|
||||
},
|
||||
|
@ -304,7 +305,7 @@ func TestAPICGetMetrics(t *testing.T) {
|
|||
machineIDs: []string{"a", "b", "c"},
|
||||
bouncers: []string{"1", "2", "3"},
|
||||
expectedMetric: &models.Metrics{
|
||||
ApilVersion: types.StrPtr(version.String()),
|
||||
ApilVersion: ptr.Of(version.String()),
|
||||
Bouncers: []*models.MetricsBouncerInfo{
|
||||
{
|
||||
CustomName: "1",
|
||||
|
@ -375,23 +376,23 @@ func TestAPICGetMetrics(t *testing.T) {
|
|||
|
||||
func TestCreateAlertsForDecision(t *testing.T) {
|
||||
httpBfDecisionList := &models.Decision{
|
||||
Origin: types.StrPtr(types.ListOrigin),
|
||||
Scenario: types.StrPtr("crowdsecurity/http-bf"),
|
||||
Origin: ptr.Of(types.ListOrigin),
|
||||
Scenario: ptr.Of("crowdsecurity/http-bf"),
|
||||
}
|
||||
|
||||
sshBfDecisionList := &models.Decision{
|
||||
Origin: types.StrPtr(types.ListOrigin),
|
||||
Scenario: types.StrPtr("crowdsecurity/ssh-bf"),
|
||||
Origin: ptr.Of(types.ListOrigin),
|
||||
Scenario: ptr.Of("crowdsecurity/ssh-bf"),
|
||||
}
|
||||
|
||||
httpBfDecisionCommunity := &models.Decision{
|
||||
Origin: types.StrPtr(types.CAPIOrigin),
|
||||
Scenario: types.StrPtr("crowdsecurity/http-bf"),
|
||||
Origin: ptr.Of(types.CAPIOrigin),
|
||||
Scenario: ptr.Of("crowdsecurity/http-bf"),
|
||||
}
|
||||
|
||||
sshBfDecisionCommunity := &models.Decision{
|
||||
Origin: types.StrPtr(types.CAPIOrigin),
|
||||
Scenario: types.StrPtr("crowdsecurity/ssh-bf"),
|
||||
Origin: ptr.Of(types.CAPIOrigin),
|
||||
Scenario: ptr.Of("crowdsecurity/ssh-bf"),
|
||||
}
|
||||
type args struct {
|
||||
decisions []*models.Decision
|
||||
|
@ -454,27 +455,27 @@ func TestCreateAlertsForDecision(t *testing.T) {
|
|||
|
||||
func TestFillAlertsWithDecisions(t *testing.T) {
|
||||
httpBfDecisionCommunity := &models.Decision{
|
||||
Origin: types.StrPtr(types.CAPIOrigin),
|
||||
Scenario: types.StrPtr("crowdsecurity/http-bf"),
|
||||
Scope: types.StrPtr("ip"),
|
||||
Origin: ptr.Of(types.CAPIOrigin),
|
||||
Scenario: ptr.Of("crowdsecurity/http-bf"),
|
||||
Scope: ptr.Of("ip"),
|
||||
}
|
||||
|
||||
sshBfDecisionCommunity := &models.Decision{
|
||||
Origin: types.StrPtr(types.CAPIOrigin),
|
||||
Scenario: types.StrPtr("crowdsecurity/ssh-bf"),
|
||||
Scope: types.StrPtr("ip"),
|
||||
Origin: ptr.Of(types.CAPIOrigin),
|
||||
Scenario: ptr.Of("crowdsecurity/ssh-bf"),
|
||||
Scope: ptr.Of("ip"),
|
||||
}
|
||||
|
||||
httpBfDecisionList := &models.Decision{
|
||||
Origin: types.StrPtr(types.ListOrigin),
|
||||
Scenario: types.StrPtr("crowdsecurity/http-bf"),
|
||||
Scope: types.StrPtr("ip"),
|
||||
Origin: ptr.Of(types.ListOrigin),
|
||||
Scenario: ptr.Of("crowdsecurity/http-bf"),
|
||||
Scope: ptr.Of("ip"),
|
||||
}
|
||||
|
||||
sshBfDecisionList := &models.Decision{
|
||||
Origin: types.StrPtr(types.ListOrigin),
|
||||
Scenario: types.StrPtr("crowdsecurity/ssh-bf"),
|
||||
Scope: types.StrPtr("ip"),
|
||||
Origin: ptr.Of(types.ListOrigin),
|
||||
Scenario: ptr.Of("crowdsecurity/ssh-bf"),
|
||||
Scope: ptr.Of("ip"),
|
||||
}
|
||||
type args struct {
|
||||
alerts []*models.Alert
|
||||
|
@ -573,58 +574,58 @@ func TestAPICWhitelists(t *testing.T) {
|
|||
"9.9.9.9", // This is already present in DB
|
||||
"9.1.9.9", // This not present in DB
|
||||
},
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
}, // This is already present in DB
|
||||
},
|
||||
New: modelscapi.GetDecisionsStreamResponseNew{
|
||||
&modelscapi.GetDecisionsStreamResponseNewItem{
|
||||
Scenario: types.StrPtr("crowdsecurity/test1"),
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Scenario: ptr.Of("crowdsecurity/test1"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
Decisions: []*modelscapi.GetDecisionsStreamResponseNewItemDecisionsItems0{
|
||||
{
|
||||
Value: types.StrPtr("13.2.3.4"), //wl by cidr
|
||||
Duration: types.StrPtr("24h"),
|
||||
Value: ptr.Of("13.2.3.4"), //wl by cidr
|
||||
Duration: ptr.Of("24h"),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
&modelscapi.GetDecisionsStreamResponseNewItem{
|
||||
Scenario: types.StrPtr("crowdsecurity/test1"),
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Scenario: ptr.Of("crowdsecurity/test1"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
Decisions: []*modelscapi.GetDecisionsStreamResponseNewItemDecisionsItems0{
|
||||
{
|
||||
Value: types.StrPtr("2.2.3.4"),
|
||||
Duration: types.StrPtr("24h"),
|
||||
Value: ptr.Of("2.2.3.4"),
|
||||
Duration: ptr.Of("24h"),
|
||||
},
|
||||
},
|
||||
},
|
||||
&modelscapi.GetDecisionsStreamResponseNewItem{
|
||||
Scenario: types.StrPtr("crowdsecurity/test2"),
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Scenario: ptr.Of("crowdsecurity/test2"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
Decisions: []*modelscapi.GetDecisionsStreamResponseNewItemDecisionsItems0{
|
||||
{
|
||||
Value: types.StrPtr("13.2.3.5"), //wl by cidr
|
||||
Duration: types.StrPtr("24h"),
|
||||
Value: ptr.Of("13.2.3.5"), //wl by cidr
|
||||
Duration: ptr.Of("24h"),
|
||||
},
|
||||
},
|
||||
}, // These two are from community list.
|
||||
&modelscapi.GetDecisionsStreamResponseNewItem{
|
||||
Scenario: types.StrPtr("crowdsecurity/test1"),
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Scenario: ptr.Of("crowdsecurity/test1"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
Decisions: []*modelscapi.GetDecisionsStreamResponseNewItemDecisionsItems0{
|
||||
{
|
||||
Value: types.StrPtr("6.2.3.4"),
|
||||
Duration: types.StrPtr("24h"),
|
||||
Value: ptr.Of("6.2.3.4"),
|
||||
Duration: ptr.Of("24h"),
|
||||
},
|
||||
},
|
||||
},
|
||||
&modelscapi.GetDecisionsStreamResponseNewItem{
|
||||
Scenario: types.StrPtr("crowdsecurity/test1"),
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Scenario: ptr.Of("crowdsecurity/test1"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
Decisions: []*modelscapi.GetDecisionsStreamResponseNewItemDecisionsItems0{
|
||||
{
|
||||
Value: types.StrPtr("9.2.3.4"), //wl by ip
|
||||
Duration: types.StrPtr("24h"),
|
||||
Value: ptr.Of("9.2.3.4"), //wl by ip
|
||||
Duration: ptr.Of("24h"),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -632,18 +633,18 @@ func TestAPICWhitelists(t *testing.T) {
|
|||
Links: &modelscapi.GetDecisionsStreamResponseLinks{
|
||||
Blocklists: []*modelscapi.BlocklistLink{
|
||||
{
|
||||
URL: types.StrPtr("http://api.crowdsec.net/blocklist1"),
|
||||
Name: types.StrPtr("blocklist1"),
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Remediation: types.StrPtr("ban"),
|
||||
Duration: types.StrPtr("24h"),
|
||||
URL: ptr.Of("http://api.crowdsec.net/blocklist1"),
|
||||
Name: ptr.Of("blocklist1"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
Remediation: ptr.Of("ban"),
|
||||
Duration: ptr.Of("24h"),
|
||||
},
|
||||
{
|
||||
URL: types.StrPtr("http://api.crowdsec.net/blocklist2"),
|
||||
Name: types.StrPtr("blocklist2"),
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Remediation: types.StrPtr("ban"),
|
||||
Duration: types.StrPtr("24h"),
|
||||
URL: ptr.Of("http://api.crowdsec.net/blocklist2"),
|
||||
Name: ptr.Of("blocklist2"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
Remediation: ptr.Of("ban"),
|
||||
Duration: ptr.Of("24h"),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -735,27 +736,27 @@ func TestAPICPullTop(t *testing.T) {
|
|||
"9.9.9.9", // This is already present in DB
|
||||
"9.1.9.9", // This not present in DB
|
||||
},
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
}, // This is already present in DB
|
||||
},
|
||||
New: modelscapi.GetDecisionsStreamResponseNew{
|
||||
&modelscapi.GetDecisionsStreamResponseNewItem{
|
||||
Scenario: types.StrPtr("crowdsecurity/test1"),
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Scenario: ptr.Of("crowdsecurity/test1"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
Decisions: []*modelscapi.GetDecisionsStreamResponseNewItemDecisionsItems0{
|
||||
{
|
||||
Value: types.StrPtr("1.2.3.4"),
|
||||
Duration: types.StrPtr("24h"),
|
||||
Value: ptr.Of("1.2.3.4"),
|
||||
Duration: ptr.Of("24h"),
|
||||
},
|
||||
},
|
||||
},
|
||||
&modelscapi.GetDecisionsStreamResponseNewItem{
|
||||
Scenario: types.StrPtr("crowdsecurity/test2"),
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Scenario: ptr.Of("crowdsecurity/test2"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
Decisions: []*modelscapi.GetDecisionsStreamResponseNewItemDecisionsItems0{
|
||||
{
|
||||
Value: types.StrPtr("1.2.3.5"),
|
||||
Duration: types.StrPtr("24h"),
|
||||
Value: ptr.Of("1.2.3.5"),
|
||||
Duration: ptr.Of("24h"),
|
||||
},
|
||||
},
|
||||
}, // These two are from community list.
|
||||
|
@ -763,18 +764,18 @@ func TestAPICPullTop(t *testing.T) {
|
|||
Links: &modelscapi.GetDecisionsStreamResponseLinks{
|
||||
Blocklists: []*modelscapi.BlocklistLink{
|
||||
{
|
||||
URL: types.StrPtr("http://api.crowdsec.net/blocklist1"),
|
||||
Name: types.StrPtr("blocklist1"),
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Remediation: types.StrPtr("ban"),
|
||||
Duration: types.StrPtr("24h"),
|
||||
URL: ptr.Of("http://api.crowdsec.net/blocklist1"),
|
||||
Name: ptr.Of("blocklist1"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
Remediation: ptr.Of("ban"),
|
||||
Duration: ptr.Of("24h"),
|
||||
},
|
||||
{
|
||||
URL: types.StrPtr("http://api.crowdsec.net/blocklist2"),
|
||||
Name: types.StrPtr("blocklist2"),
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Remediation: types.StrPtr("ban"),
|
||||
Duration: types.StrPtr("24h"),
|
||||
URL: ptr.Of("http://api.crowdsec.net/blocklist2"),
|
||||
Name: ptr.Of("blocklist2"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
Remediation: ptr.Of("ban"),
|
||||
Duration: ptr.Of("24h"),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -841,12 +842,12 @@ func TestAPICPullTopBLCacheFirstCall(t *testing.T) {
|
|||
modelscapi.GetDecisionsStreamResponse{
|
||||
New: modelscapi.GetDecisionsStreamResponseNew{
|
||||
&modelscapi.GetDecisionsStreamResponseNewItem{
|
||||
Scenario: types.StrPtr("crowdsecurity/test1"),
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Scenario: ptr.Of("crowdsecurity/test1"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
Decisions: []*modelscapi.GetDecisionsStreamResponseNewItemDecisionsItems0{
|
||||
{
|
||||
Value: types.StrPtr("1.2.3.4"),
|
||||
Duration: types.StrPtr("24h"),
|
||||
Value: ptr.Of("1.2.3.4"),
|
||||
Duration: ptr.Of("24h"),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -854,11 +855,11 @@ func TestAPICPullTopBLCacheFirstCall(t *testing.T) {
|
|||
Links: &modelscapi.GetDecisionsStreamResponseLinks{
|
||||
Blocklists: []*modelscapi.BlocklistLink{
|
||||
{
|
||||
URL: types.StrPtr("http://api.crowdsec.net/blocklist1"),
|
||||
Name: types.StrPtr("blocklist1"),
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Remediation: types.StrPtr("ban"),
|
||||
Duration: types.StrPtr("24h"),
|
||||
URL: ptr.Of("http://api.crowdsec.net/blocklist1"),
|
||||
Name: ptr.Of("blocklist1"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
Remediation: ptr.Of("ban"),
|
||||
Duration: ptr.Of("24h"),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -884,7 +885,7 @@ func TestAPICPullTopBLCacheFirstCall(t *testing.T) {
|
|||
err = api.PullTop(false)
|
||||
require.NoError(t, err)
|
||||
|
||||
blocklistConfigItemName := fmt.Sprintf("blocklist:%s:last_pull", *types.StrPtr("blocklist1"))
|
||||
blocklistConfigItemName := "blocklist:blocklist1:last_pull"
|
||||
lastPullTimestamp, err := api.dbClient.GetConfigItem(blocklistConfigItemName)
|
||||
require.NoError(t, err)
|
||||
assert.NotEqual(t, "", *lastPullTimestamp)
|
||||
|
@ -928,12 +929,12 @@ func TestAPICPullTopBLCacheForceCall(t *testing.T) {
|
|||
modelscapi.GetDecisionsStreamResponse{
|
||||
New: modelscapi.GetDecisionsStreamResponseNew{
|
||||
&modelscapi.GetDecisionsStreamResponseNewItem{
|
||||
Scenario: types.StrPtr("crowdsecurity/test1"),
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Scenario: ptr.Of("crowdsecurity/test1"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
Decisions: []*modelscapi.GetDecisionsStreamResponseNewItemDecisionsItems0{
|
||||
{
|
||||
Value: types.StrPtr("1.2.3.4"),
|
||||
Duration: types.StrPtr("24h"),
|
||||
Value: ptr.Of("1.2.3.4"),
|
||||
Duration: ptr.Of("24h"),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -941,11 +942,11 @@ func TestAPICPullTopBLCacheForceCall(t *testing.T) {
|
|||
Links: &modelscapi.GetDecisionsStreamResponseLinks{
|
||||
Blocklists: []*modelscapi.BlocklistLink{
|
||||
{
|
||||
URL: types.StrPtr("http://api.crowdsec.net/blocklist1"),
|
||||
Name: types.StrPtr("blocklist1"),
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Remediation: types.StrPtr("ban"),
|
||||
Duration: types.StrPtr("24h"),
|
||||
URL: ptr.Of("http://api.crowdsec.net/blocklist1"),
|
||||
Name: ptr.Of("blocklist1"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
Remediation: ptr.Of("ban"),
|
||||
Duration: ptr.Of("24h"),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -982,10 +983,10 @@ func TestAPICPush(t *testing.T) {
|
|||
name: "simple single alert",
|
||||
alerts: []*models.Alert{
|
||||
{
|
||||
Scenario: types.StrPtr("crowdsec/test"),
|
||||
ScenarioHash: types.StrPtr("certified"),
|
||||
ScenarioVersion: types.StrPtr("v1.0"),
|
||||
Simulated: types.BoolPtr(false),
|
||||
Scenario: ptr.Of("crowdsec/test"),
|
||||
ScenarioHash: ptr.Of("certified"),
|
||||
ScenarioVersion: ptr.Of("v1.0"),
|
||||
Simulated: ptr.Of(false),
|
||||
Source: &models.Source{},
|
||||
},
|
||||
},
|
||||
|
@ -995,10 +996,10 @@ func TestAPICPush(t *testing.T) {
|
|||
name: "simulated alert is not pushed",
|
||||
alerts: []*models.Alert{
|
||||
{
|
||||
Scenario: types.StrPtr("crowdsec/test"),
|
||||
ScenarioHash: types.StrPtr("certified"),
|
||||
ScenarioVersion: types.StrPtr("v1.0"),
|
||||
Simulated: types.BoolPtr(true),
|
||||
Scenario: ptr.Of("crowdsec/test"),
|
||||
ScenarioHash: ptr.Of("certified"),
|
||||
ScenarioVersion: ptr.Of("v1.0"),
|
||||
Simulated: ptr.Of(true),
|
||||
Source: &models.Source{},
|
||||
},
|
||||
},
|
||||
|
@ -1011,10 +1012,10 @@ func TestAPICPush(t *testing.T) {
|
|||
alerts := make([]*models.Alert, 100)
|
||||
for i := 0; i < 100; i++ {
|
||||
alerts[i] = &models.Alert{
|
||||
Scenario: types.StrPtr("crowdsec/test"),
|
||||
ScenarioHash: types.StrPtr("certified"),
|
||||
ScenarioVersion: types.StrPtr("v1.0"),
|
||||
Simulated: types.BoolPtr(false),
|
||||
Scenario: ptr.Of("crowdsec/test"),
|
||||
ScenarioHash: ptr.Of("certified"),
|
||||
ScenarioVersion: ptr.Of("v1.0"),
|
||||
Simulated: ptr.Of(false),
|
||||
Source: &models.Source{},
|
||||
}
|
||||
}
|
||||
|
@ -1189,12 +1190,12 @@ func TestAPICPull(t *testing.T) {
|
|||
modelscapi.GetDecisionsStreamResponse{
|
||||
New: modelscapi.GetDecisionsStreamResponseNew{
|
||||
&modelscapi.GetDecisionsStreamResponseNewItem{
|
||||
Scenario: types.StrPtr("crowdsecurity/ssh-bf"),
|
||||
Scope: types.StrPtr("Ip"),
|
||||
Scenario: ptr.Of("crowdsecurity/ssh-bf"),
|
||||
Scope: ptr.Of("Ip"),
|
||||
Decisions: []*modelscapi.GetDecisionsStreamResponseNewItemDecisionsItems0{
|
||||
{
|
||||
Value: types.StrPtr("1.2.3.5"),
|
||||
Duration: types.StrPtr("24h"),
|
||||
Value: ptr.Of("1.2.3.5"),
|
||||
Duration: ptr.Of("24h"),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1229,29 +1230,29 @@ func TestShouldShareAlert(t *testing.T) {
|
|||
{
|
||||
name: "custom alert should be shared if config enables it",
|
||||
consoleConfig: &csconfig.ConsoleConfig{
|
||||
ShareCustomScenarios: types.BoolPtr(true),
|
||||
ShareCustomScenarios: ptr.Of(true),
|
||||
},
|
||||
alert: &models.Alert{Simulated: types.BoolPtr(false)},
|
||||
alert: &models.Alert{Simulated: ptr.Of(false)},
|
||||
expectedRet: true,
|
||||
expectedTrust: "custom",
|
||||
},
|
||||
{
|
||||
name: "custom alert should not be shared if config disables it",
|
||||
consoleConfig: &csconfig.ConsoleConfig{
|
||||
ShareCustomScenarios: types.BoolPtr(false),
|
||||
ShareCustomScenarios: ptr.Of(false),
|
||||
},
|
||||
alert: &models.Alert{Simulated: types.BoolPtr(false)},
|
||||
alert: &models.Alert{Simulated: ptr.Of(false)},
|
||||
expectedRet: false,
|
||||
expectedTrust: "custom",
|
||||
},
|
||||
{
|
||||
name: "manual alert should be shared if config enables it",
|
||||
consoleConfig: &csconfig.ConsoleConfig{
|
||||
ShareManualDecisions: types.BoolPtr(true),
|
||||
ShareManualDecisions: ptr.Of(true),
|
||||
},
|
||||
alert: &models.Alert{
|
||||
Simulated: types.BoolPtr(false),
|
||||
Decisions: []*models.Decision{{Origin: types.StrPtr(types.CscliOrigin)}},
|
||||
Simulated: ptr.Of(false),
|
||||
Decisions: []*models.Decision{{Origin: ptr.Of(types.CscliOrigin)}},
|
||||
},
|
||||
expectedRet: true,
|
||||
expectedTrust: "manual",
|
||||
|
@ -1259,11 +1260,11 @@ func TestShouldShareAlert(t *testing.T) {
|
|||
{
|
||||
name: "manual alert should not be shared if config disables it",
|
||||
consoleConfig: &csconfig.ConsoleConfig{
|
||||
ShareManualDecisions: types.BoolPtr(false),
|
||||
ShareManualDecisions: ptr.Of(false),
|
||||
},
|
||||
alert: &models.Alert{
|
||||
Simulated: types.BoolPtr(false),
|
||||
Decisions: []*models.Decision{{Origin: types.StrPtr(types.CscliOrigin)}},
|
||||
Simulated: ptr.Of(false),
|
||||
Decisions: []*models.Decision{{Origin: ptr.Of(types.CscliOrigin)}},
|
||||
},
|
||||
expectedRet: false,
|
||||
expectedTrust: "manual",
|
||||
|
@ -1271,11 +1272,11 @@ func TestShouldShareAlert(t *testing.T) {
|
|||
{
|
||||
name: "manual alert should be shared if config enables it",
|
||||
consoleConfig: &csconfig.ConsoleConfig{
|
||||
ShareTaintedScenarios: types.BoolPtr(true),
|
||||
ShareTaintedScenarios: ptr.Of(true),
|
||||
},
|
||||
alert: &models.Alert{
|
||||
Simulated: types.BoolPtr(false),
|
||||
ScenarioHash: types.StrPtr("whateverHash"),
|
||||
Simulated: ptr.Of(false),
|
||||
ScenarioHash: ptr.Of("whateverHash"),
|
||||
},
|
||||
expectedRet: true,
|
||||
expectedTrust: "tainted",
|
||||
|
@ -1283,11 +1284,11 @@ func TestShouldShareAlert(t *testing.T) {
|
|||
{
|
||||
name: "manual alert should not be shared if config disables it",
|
||||
consoleConfig: &csconfig.ConsoleConfig{
|
||||
ShareTaintedScenarios: types.BoolPtr(false),
|
||||
ShareTaintedScenarios: ptr.Of(false),
|
||||
},
|
||||
alert: &models.Alert{
|
||||
Simulated: types.BoolPtr(false),
|
||||
ScenarioHash: types.StrPtr("whateverHash"),
|
||||
Simulated: ptr.Of(false),
|
||||
ScenarioHash: ptr.Of("whateverHash"),
|
||||
},
|
||||
expectedRet: false,
|
||||
expectedTrust: "tainted",
|
||||
|
|
|
@ -7,12 +7,12 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/types"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gopkg.in/yaml.v2"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/ptr"
|
||||
)
|
||||
|
||||
func TestLoadLocalApiClientCfg(t *testing.T) {
|
||||
|
@ -53,7 +53,7 @@ func TestLoadLocalApiClientCfg(t *testing.T) {
|
|||
name: "valid configuration with insecure skip verify",
|
||||
input: &LocalApiClientCfg{
|
||||
CredentialsFilePath: "./tests/lapi-secrets.yaml",
|
||||
InsecureSkipVerify: types.BoolPtr(false),
|
||||
InsecureSkipVerify: ptr.Of(false),
|
||||
},
|
||||
expected: &ApiCredentialsCfg{
|
||||
URL: "http://localhost:8080/",
|
||||
|
@ -188,21 +188,21 @@ func TestLoadAPIServer(t *testing.T) {
|
|||
DisableAPI: false,
|
||||
},
|
||||
expected: &LocalApiServerCfg{
|
||||
Enable: types.BoolPtr(true),
|
||||
Enable: ptr.Of(true),
|
||||
ListenURI: "http://crowdsec.api",
|
||||
TLS: nil,
|
||||
DbConfig: &DatabaseCfg{
|
||||
DbPath: "./tests/test.db",
|
||||
Type: "sqlite",
|
||||
MaxOpenConns: types.IntPtr(DEFAULT_MAX_OPEN_CONNS),
|
||||
MaxOpenConns: ptr.Of(DEFAULT_MAX_OPEN_CONNS),
|
||||
},
|
||||
ConsoleConfigPath: DefaultConfigPath("console.yaml"),
|
||||
ConsoleConfig: &ConsoleConfig{
|
||||
ShareManualDecisions: types.BoolPtr(false),
|
||||
ShareTaintedScenarios: types.BoolPtr(true),
|
||||
ShareCustomScenarios: types.BoolPtr(true),
|
||||
ShareContext: types.BoolPtr(false),
|
||||
ConsoleManagement: types.BoolPtr(false),
|
||||
ShareManualDecisions: ptr.Of(false),
|
||||
ShareTaintedScenarios: ptr.Of(true),
|
||||
ShareCustomScenarios: ptr.Of(true),
|
||||
ShareContext: ptr.Of(false),
|
||||
ConsoleManagement: ptr.Of(false),
|
||||
},
|
||||
LogDir: LogDirFullPath,
|
||||
LogMedia: "stdout",
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
)
|
||||
|
||||
func TestNormalLoad(t *testing.T) {
|
||||
|
|
|
@ -5,13 +5,13 @@ import (
|
|||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/types"
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/ptr"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestLoadCrowdsec(t *testing.T) {
|
||||
falseBoolPtr := false
|
||||
acquisFullPath, err := filepath.Abs("./tests/acquis.yaml")
|
||||
require.NoError(t, err)
|
||||
|
||||
|
@ -63,7 +63,7 @@ func TestLoadCrowdsec(t *testing.T) {
|
|||
},
|
||||
},
|
||||
expectedResult: &CrowdsecServiceCfg{
|
||||
Enable: types.BoolPtr(true),
|
||||
Enable: ptr.Of(true),
|
||||
AcquisitionDirPath: "",
|
||||
ConsoleContextPath: contextFileFullPath,
|
||||
AcquisitionFilePath: acquisFullPath,
|
||||
|
@ -81,7 +81,7 @@ func TestLoadCrowdsec(t *testing.T) {
|
|||
"source_ip": {"evt.Parsed.source_ip"},
|
||||
},
|
||||
SimulationConfig: &SimulationConfig{
|
||||
Simulation: &falseBoolPtr,
|
||||
Simulation: ptr.Of(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -106,7 +106,7 @@ func TestLoadCrowdsec(t *testing.T) {
|
|||
},
|
||||
},
|
||||
expectedResult: &CrowdsecServiceCfg{
|
||||
Enable: types.BoolPtr(true),
|
||||
Enable: ptr.Of(true),
|
||||
AcquisitionDirPath: acquisDirFullPath,
|
||||
AcquisitionFilePath: acquisFullPath,
|
||||
ConsoleContextPath: contextFileFullPath,
|
||||
|
@ -124,7 +124,7 @@ func TestLoadCrowdsec(t *testing.T) {
|
|||
},
|
||||
SimulationFilePath: "./tests/simulation.yaml",
|
||||
SimulationConfig: &SimulationConfig{
|
||||
Simulation: &falseBoolPtr,
|
||||
Simulation: ptr.Of(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -147,7 +147,7 @@ func TestLoadCrowdsec(t *testing.T) {
|
|||
},
|
||||
},
|
||||
expectedResult: &CrowdsecServiceCfg{
|
||||
Enable: types.BoolPtr(true),
|
||||
Enable: ptr.Of(true),
|
||||
AcquisitionDirPath: "",
|
||||
AcquisitionFilePath: "",
|
||||
ConfigDir: configDirFullPath,
|
||||
|
@ -165,7 +165,7 @@ func TestLoadCrowdsec(t *testing.T) {
|
|||
"source_ip": {"evt.Parsed.source_ip"},
|
||||
},
|
||||
SimulationConfig: &SimulationConfig{
|
||||
Simulation: &falseBoolPtr,
|
||||
Simulation: ptr.Of(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
)
|
||||
|
||||
func TestSimulationLoading(t *testing.T) {
|
||||
|
|
|
@ -19,8 +19,9 @@ import (
|
|||
"gopkg.in/tomb.v2"
|
||||
"gopkg.in/yaml.v2"
|
||||
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/csconfig"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/models"
|
||||
)
|
||||
|
||||
|
|
|
@ -15,8 +15,9 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
"gopkg.in/tomb.v2"
|
||||
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/csconfig"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/models"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/types"
|
||||
)
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
//go:build unix || linux || freebsd || netbsd || openbsd || solaris
|
||||
|
||||
package cstest
|
||||
|
||||
const FileNotFoundMessage = "no such file or directory"
|
|
@ -1,5 +0,0 @@
|
|||
//go:build windows
|
||||
|
||||
package cstest
|
||||
|
||||
const FileNotFoundMessage = "The system cannot find the file specified."
|
|
@ -1,99 +0,0 @@
|
|||
package cstest
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
"text/template"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
logtest "github.com/sirupsen/logrus/hooks/test"
|
||||
)
|
||||
|
||||
func AssertErrorContains(t *testing.T, err error, expectedErr string) {
|
||||
t.Helper()
|
||||
|
||||
if expectedErr != "" {
|
||||
assert.ErrorContains(t, err, expectedErr)
|
||||
return
|
||||
}
|
||||
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
func AssertErrorMessage(t *testing.T, err error, expectedErr string) {
|
||||
t.Helper()
|
||||
|
||||
if expectedErr != "" {
|
||||
errmsg := ""
|
||||
if err != nil {
|
||||
errmsg = err.Error()
|
||||
}
|
||||
assert.Equal(t, expectedErr, errmsg)
|
||||
return
|
||||
}
|
||||
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func RequireErrorContains(t *testing.T, err error, expectedErr string) {
|
||||
t.Helper()
|
||||
|
||||
if expectedErr != "" {
|
||||
require.ErrorContains(t, err, expectedErr)
|
||||
return
|
||||
}
|
||||
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func RequireErrorMessage(t *testing.T, err error, expectedErr string) {
|
||||
t.Helper()
|
||||
|
||||
if expectedErr != "" {
|
||||
errmsg := ""
|
||||
if err != nil {
|
||||
errmsg = err.Error()
|
||||
}
|
||||
require.Equal(t, expectedErr, errmsg)
|
||||
return
|
||||
}
|
||||
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func RequireLogContains(t *testing.T, hook *logtest.Hook, expected string) {
|
||||
t.Helper()
|
||||
|
||||
// look for a log entry that matches the expected message
|
||||
for _, entry := range hook.AllEntries() {
|
||||
if strings.Contains(entry.Message, expected) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// show all hook entries, in case the test fails we'll need them
|
||||
for _, entry := range hook.AllEntries() {
|
||||
t.Logf("log entry: %s", entry.Message)
|
||||
}
|
||||
|
||||
require.Fail(t, "no log entry found with message", expected)
|
||||
}
|
||||
|
||||
// Interpolate fills a string template with the given values, can be map or struct.
|
||||
// example: Interpolate("{{.Name}}", map[string]string{"Name": "JohnDoe"})
|
||||
func Interpolate(s string, data interface{}) (string, error) {
|
||||
tmpl, err := template.New("").Parse(s)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var b strings.Builder
|
||||
err = tmpl.Execute(&b, data)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return b.String(), nil
|
||||
}
|
|
@ -13,8 +13,10 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/ptr"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/csconfig"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/database"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/models"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/types"
|
||||
|
@ -220,7 +222,7 @@ func TestRegexpCacheBehavior(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
|
||||
//cache with no TTL
|
||||
err = RegexpCacheInit(filename, types.DataSource{Type: "regex", Size: types.IntPtr(1)})
|
||||
err = RegexpCacheInit(filename, types.DataSource{Type: "regex", Size: ptr.Of(1)})
|
||||
require.NoError(t, err)
|
||||
|
||||
ret, _ := RegexpInFile("crowdsec", filename)
|
||||
|
@ -233,7 +235,7 @@ func TestRegexpCacheBehavior(t *testing.T) {
|
|||
|
||||
//cache with TTL
|
||||
ttl := 500 * time.Millisecond
|
||||
err = RegexpCacheInit(filename, types.DataSource{Type: "regex", Size: types.IntPtr(2), TTL: &ttl})
|
||||
err = RegexpCacheInit(filename, types.DataSource{Type: "regex", Size: ptr.Of(2), TTL: &ttl})
|
||||
require.NoError(t, err)
|
||||
|
||||
ret, _ = RegexpInFile("crowdsec", filename)
|
||||
|
|
|
@ -9,7 +9,8 @@ import (
|
|||
logtest "github.com/sirupsen/logrus/hooks/test"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/fflag"
|
||||
)
|
||||
|
||||
|
|
|
@ -10,7 +10,8 @@ import (
|
|||
"github.com/lithammer/dedent"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cstest"
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/cstest"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/setup"
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue