crowdsec/pkg
Laurence Jones 19de3a8a77
Runtime whitelist parsing improvement (#2422)
* Improve whitelist parsing

* Split whitelist check into a function tied to whitelist, also since we check node debug we can make a pointer to node containing whitelist

* No point passing clog as an argument since it is just a pointer to node we already know about

* We should break instead of returning false, false as it may have been whitelisted by ips/cidrs

* reimplement early return if expr errors

* Fix lint and dont need to parse ip back to string just loop over sources

* Log error with node logger as it provides context

* Move getsource to a function cleanup some code

* Change func name

* Split out compile to a function so we can use in tests. Add a bunch of tests

* spell correction

* Use node logger so it has context

* alternative solution

* quick fixes

* Use containswls

* Change whitelist test to use parseipsource and only events

* Make it simpler

* Postoverflow tests, some basic ones to make sure it works

* Use official pkg

* Add @mmetc reco

* Add @mmetc reco

* Change if if to a switch to only evaluate once

* simplify assertions

---------

Co-authored-by: bui <thibault@crowdsec.net>
Co-authored-by: Marco Mariani <marco@crowdsec.net>
2023-10-16 10:08:57 +01:00
..
acquisition Kafka acquisition: do not create empty events when a read error occurs (#2466) 2023-09-13 13:20:36 +02:00
alertcontext use go 1.21.1 (#2418) 2023-10-04 13:01:57 +02:00
apiclient change behavior of flag disable_http_retry_backoff (#2426) 2023-08-16 21:04:07 +02:00
apiserver add missing scenarios in first login when authenticating with TLS (#2454) 2023-10-09 15:26:38 +02:00
cache support for regexps result cache (#2104) 2023-03-08 16:07:49 +01:00
csconfig cscli config feeature-flags: point user to the right location of feature.yaml (#2539) 2023-10-13 09:52:51 +02:00
csplugin Add html escape function so it can be invoked from template (#2451) 2023-09-04 09:49:39 +01:00
csprofiles Use a default duration if no duration is provided in a profile (#2520) 2023-10-06 14:43:17 +02:00
cticlient update dependency on go-cs-lib; drop the pkg/ part (#2393) 2023-07-28 16:35:08 +02:00
cwhub Refact cscli hub / pkg/cwhub (part 6) (#2524) 2023-10-09 21:33:35 +02:00
cwversion update dependency on go-cs-lib; drop the pkg/ part (#2393) 2023-07-28 16:35:08 +02:00
database fix include_capi filter (#2478) 2023-09-20 11:56:00 +02:00
exprhelpers Load file only once if specified twice, and bail earlier if type is unknown (#2419) 2023-10-13 22:34:57 +01:00
fflag golangci-lint: use v1.54, remove unnecessary byte/string conversions (#2438) 2023-08-25 16:22:10 +02:00
hubtest sort map keys when generating asserts (#2494) 2023-10-16 09:54:19 +02:00
leakybucket Dont create 3 maps just pass the same one to expr (#2421) 2023-10-13 22:35:30 +01:00
longpollclient Add cscli papi status and cscli papi sync (#2091) 2023-03-03 13:46:28 +01:00
metabase update dependency on go-cs-lib; drop the pkg/ part (#2393) 2023-07-28 16:35:08 +02:00
models Polling API Integration (#1715) 2023-01-31 14:47:44 +01:00
modelscapi v3 capi and blocklists links support (#2019) 2023-02-06 14:06:14 +01:00
parser Runtime whitelist parsing improvement (#2422) 2023-10-16 10:08:57 +01:00
protobufs Add plugin interface code in protobufs package (#921) 2021-08-31 14:40:17 +02:00
setup Refact cscli hub / pkg/cwhub (part 5) (#2521) 2023-10-06 13:59:51 +02:00
time Windows Support (#1159) 2022-05-17 12:14:59 +02:00
types Runtime whitelist parsing improvement (#2422) 2023-10-16 10:08:57 +01:00