Commit graph

1320 commits

Author SHA1 Message Date
blotus dc38e5ac00
S3 acquisition datasource (#2130) 2023-03-21 13:54:52 +01:00
Thibault "bui" Koechlin a74e424d53
support ip and cidr based whitelists for capi and 3rd party blocklists (#2132)
* support ip and cidr based whitelists for capi and 3rd party blocklist
2023-03-21 11:50:10 +01:00
Thibault "bui" Koechlin d87f088b8f
match expr helper (#2126)
* match expr helper
2023-03-21 10:39:17 +01:00
mmetc 86971da274
CI: avoid conflict with pkg/build cache in golangci-lint action (#2123) 2023-03-20 10:41:08 +01:00
Thibault "bui" Koechlin 618be9ff68
properly update the time structure within event (#2122)
* properly update the time structure within event to ensure it works in time-machine

* move LIVE and TIMEMACHINE to pkg/types : less code needs to import leakybucket package, and we avoid duplicating constants
2023-03-16 16:25:50 +01:00
blotus c77fe16943
actually fix expr-debugger to work with the new version (#2124) 2023-03-16 15:20:48 +01:00
blotus 94c7efdb5b
add ToString() helper (#2100) 2023-03-16 15:20:31 +01:00
blotus b1f2063a9a
Only support pgx driver for postgresql (#2118) 2023-03-16 11:02:31 +01:00
Thibault "bui" Koechlin 855f9e6f8d
protect map w/ mutex to avoid concurrent map writes with cscli explain when having many concurrent parser routines (#2113) 2023-03-16 11:01:25 +01:00
AlteredCoder e61a464951
Fix cscli explain when running from testenv (#2114)
* Fix cscli explain when running from testenv
2023-03-15 10:26:40 +01:00
Manuel Sabban b451d190b7
try to make reproducible build work (#2119)
Co-authored-by: sabban <15465465+sabban@users.noreply.github.com>
2023-03-13 17:26:33 +01:00
mmetc 9c90144867
Docker readme: update build instructions, recommend acquis.d and config.yaml.local (#2115) 2023-03-10 17:30:08 +01:00
blotus 6aaf3cd50b
Update expr to 1.12.2 (#2110) 2023-03-09 16:56:11 +01:00
mmetc 0a114ca7d1
Fix docker tests by increasing timeout (again) and move compose test to plugin (#2112)
* Fix docker tests by increasing timeout (again) and move compose test to plugin

* Bump workflow timeout to 30 min

* Test only alpine-slim and debian-full flavors
2023-03-09 12:00:29 +01:00
mmetc e161507d08
Lint (type inference): remove redundant type declarations (#2111) 2023-03-09 11:56:02 +01:00
mmetc 9faa49c7e8
Load lapi config for config show output (#2097)
This adds URL and login parameters as it was intended.
Also rewrite configShow and displayOneAlert to use an embedded text/template for shorter code.
2023-03-08 22:47:25 +01:00
Thibault "bui" Koechlin d95b7afe61
Distance support : Impossible travel (#2108)
* add distance helpers
2023-03-08 18:29:42 +01:00
Thibault "bui" Koechlin 9d5aaf5ea2
add --origin to cscli decisions delete (#2109) 2023-03-08 18:29:20 +01:00
Thibault "bui" Koechlin 5b0fe4b7f1
support for regexps result cache (#2104)
* support for regexps result cache : gcache + xxhash

Co-authored-by: Marco Mariani <marco@crowdsec.net>
2023-03-08 16:07:49 +01:00
mmetc e71d146a2d
Fix docker tests by increasing timeout (#2107) 2023-03-08 14:51:49 +01:00
mmetc 137e7408fd
Run lint after tests instead of separate workflow (#2103) 2023-03-08 14:50:59 +01:00
mmetc e63a3ab92b
Unit tests: fix authentication to localstack (#2106) 2023-03-08 14:41:16 +01:00
mmetc c7014dba8f
Build notification plugins with current crowdsec; mod tidy (#2102) 2023-03-07 16:41:13 +01:00
mmetc 0a748d324e
Make: extract "goversion.mk" to reuse it in bouncers (#2101) 2023-03-07 11:46:52 +01:00
blotus 16a3be49e2
do not try to load PAPI is url is not set (#2099) 2023-03-06 15:38:58 +01:00
blotus e27a0a0e14
display source in alerts list when an alert has multiple decisions (#2098) 2023-03-06 13:51:57 +01:00
blotus b2c2c5ac59
add papi_url in credentials file when enabling console_management, and remove it when disabling console_management (#2095) 2023-03-03 17:03:21 +01:00
mmetc a19748ae35
Rename directory "tests" to "test" (#2094)
If you use a ./test/local directory, you need to create it again:
$ make clean bats-build bats-fixture
2023-03-03 15:54:49 +01:00
blotus 85ab9c68a2
Add cscli papi status and cscli papi sync (#2091) 2023-03-03 13:46:28 +01:00
mmetc f6d6c5bb2b
Add tests and typo fixes (#2092) 2023-03-03 11:06:27 +01:00
dependabot[bot] ef4e61e05e
Bump golang.org/x/net in /plugins/notifications/slack (#2088)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20220418201149-a630d4f3e7a2 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/commits/v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-03 10:13:22 +01:00
dependabot[bot] 54fc5e48dc
Bump golang.org/x/net in /plugins/notifications/splunk (#2086)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20220418201149-a630d4f3e7a2 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/commits/v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-02 22:21:00 +01:00
dependabot[bot] 7f04d12333
Bump golang.org/x/net in /plugins/notifications/http (#2087)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20220418201149-a630d4f3e7a2 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/commits/v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-02 21:54:26 +01:00
dependabot[bot] 76c84c69c4
Bump golang.org/x/net in /plugins/notifications/email (#2085)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20220418201149-a630d4f3e7a2 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/commits/v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-02 21:21:50 +01:00
dependabot[bot] 6888fa2133
Bump golang.org/x/net from 0.0.0-20220722155237-a158d28d115b to 0.7.0 (#2089)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20220722155237-a158d28d115b to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/commits/v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-02 14:46:58 +01:00
mmetc dd76c07293
CI: limit -dev docker image to amd64 to speed up the pipeline (#2090) 2023-03-02 11:33:36 +01:00
dependabot[bot] d7119b73ab
Bump golang.org/x/text in /plugins/notifications/http (#2074)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.3.7...v0.3.8)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-02 09:41:27 +01:00
mmetc a6bb2cf5e1
Fix log destination in one-shot mode (#2084) 2023-03-01 17:00:04 +01:00
dependabot[bot] 83db873f5b
Bump golang.org/x/text in /plugins/notifications/email (#2073)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.3.7...v0.3.8)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-01 12:27:26 +01:00
dependabot[bot] cdd2401ff6
Bump golang.org/x/text in /plugins/notifications/splunk (#2071)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.3.7...v0.3.8)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-01 11:38:44 +01:00
mmetc 83b6c2cfef
Bump bats-core to 1.9 (#2083)
- update bats-core to the last release
- renamed 01_base.bats to 01_cscli.bats
- separate stderr for all the run commands in 01_*.bats, fix out/err check where appropriate
- cache go modules for bats build too
- add configuration file for buildx jobs
2023-03-01 10:56:25 +01:00
mmetc 3962daa3bd
CI: Limit parallel docker builds for performance on small machines (#2082) 2023-03-01 10:27:08 +01:00
dependabot[bot] 9ae99964e6
Bump golang.org/x/text from 0.3.7 to 0.3.8 (#2072)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.3.7...v0.3.8)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-01 09:30:50 +01:00
dependabot[bot] 37c8d4419a
Bump golang.org/x/text in /plugins/notifications/slack (#2070)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.3.7...v0.3.8)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-01 09:30:20 +01:00
mmetc 301782ae18
Docker tests: use pytest-cs 0.2 (#2079)
* Use pytest-cs 0.2

* fix pipenv cache key

* Cache docker layers

* Load build images from buildx to docker

* CI: commit Pipfile.lock

* Add full docker tag

* Cache only amd64 docker layers

* Cache layer mode=min
2023-02-28 17:49:32 +01:00
mmetc ff17a961fc
CI: Cache all built go modules (#2081) 2023-02-28 17:25:09 +01:00
Manuel Sabban 60b3f63851
ugly workaround to fix the tests (#2080)
* ugly workaround to fix the tests

* add comments

---------

Co-authored-by: sabban <15465465+sabban@users.noreply.github.com>
2023-02-28 17:05:11 +01:00
Manuel Sabban 39a4a256fd
fix the way acquisition is stopped (#2069)
* fix the way acquisition is stopped by draining inputLineChan before terminating it.

---------

Co-authored-by: sabban <15465465+sabban@users.noreply.github.com>
2023-02-27 11:21:25 +01:00
AlteredCoder 01ea78c10e
Strip version with ~ instead of - (#2076) 2023-02-25 20:05:48 +01:00
mmetc 40b5bcb918
Fix docker tests (network creation) (#2077) 2023-02-24 17:15:17 +01:00