Commit graph

181 commits

Author SHA1 Message Date
blotus
959b872118
allowlists: automatically expire current matching decisions on update (#3601) 2025-05-06 14:10:30 +02:00
mmetc
f8f0b2a211
improve support for parsing time durations with 'day' units (#3599)
* custom duration type for "cscli decisions list", "cscli alerts list"
* custom duration type for "cscli allowlist add"
* custom duration type for "cscli machines prune"
* custom duration type for "cscli bouncers prune"
* replace old function ParseDuration
* use custom duration type in expr helpers
* update dependency
* lint
* test fix
* support days in 'metrics_max_age'
* DurationWithDays for 'max_age'
2025-05-05 15:12:29 +02:00
mmetc
201aebaac2
cscli inspect: don't show metrics or converted rules if an item is not installed (#3602) 2025-05-02 00:12:55 +02:00
mmetc
0a9e6ddd4f
CI: remove obsolete reference to directory dyn-bats (#3600) 2025-04-30 23:23:49 +02:00
mmetc
7891268486
lapi: return specific error if a unix socket path is too long for the OS (#3593) 2025-04-29 12:42:49 +02:00
mmetc
5bc2b49387
allowlists: check during bulk decision import (#3588) 2025-04-28 17:11:17 +02:00
mmetc
922c29983f
test: add cold log event assert (#3577) 2025-04-16 12:37:50 +02:00
mmetc
c17d42278f
replace go-acc, richgo with gotestsum (#3567) 2025-04-14 16:21:32 +02:00
blotus
d64f196b3f
Allowlists: fix range check in LAPI endpoint (#3538) 2025-03-25 14:30:18 +01:00
mmetc
55aa1893d1
explicit message for malformed data URL in local items (#3537) 2025-03-25 11:53:49 +01:00
mmetc
f735457ca4
revert ActionPlan info/warning to StandardLogger (#3536) 2025-03-24 15:13:24 +01:00
mmetc
9a3f94dc8f
fix #3532 "reload causes crashing process" (#3534) 2025-03-24 15:10:10 +01:00
mmetc
2dcc3ae0df
CI: pin hub branch during functional tests (#3526) 2025-03-20 11:28:37 +01:00
mmetc
cab99643d1
Parallel hubtest (#3509)
Hubtests are now much faster and have a --max-jobs option which defaults to the number of cpu cores.
2025-03-17 11:27:09 +01:00
blotus
cce41a1e6c
do not attempt to set db log level if no db config (#3510) 2025-03-13 17:38:07 +01:00
mmetc
a432a6352d
appsec: support custom CA for lapi (#3503)
* apisever, appsec: refact listenAndServe..()

* RemoveAll() -> Remove()

* configure CA for tls auth request

* ignore error from os.Remove(socket) when there's no file

* appsec functional test

* lint
2025-03-12 09:33:21 +01:00
Laurence Jones
bcce4afe5e
enhance: Flags now superceed all log levels (#3496)
* enhance: Flags now superceed all log levels

* enhance: remove global var for local scope

* test

---------

Co-authored-by: marco <marco@crowdsec.net>
2025-03-07 13:42:08 +00:00
mmetc
b12ade27f4
cscli: review/update argument number checking (#3490)
* cscsli: remove unused Command.Args setting

* cscli: review/update argument number checking

cscli will consistently print the help text if the number of arguments is
wrong for the command, but not for other types of errors.

* fix func tests

* lint
2025-03-04 12:21:27 +01:00
mmetc
02d4793657
tests: remove modeline (#3486) 2025-02-28 15:24:13 +01:00
blotus
c5f5896625
crowdsec: allow -t to work if using appsec and allowlists (#3484) 2025-02-27 14:26:38 +01:00
mmetc
105801d1f9
cscli: allow non-local symlinks to have a different name than hub items (#3475) 2025-02-21 12:44:30 +01:00
mmetc
2b70dbf3e5
cscli hub/items: always show action plan; fix --interactive in pipes (#3451) 2025-02-21 00:17:01 +01:00
blotus
16d0677938
Add support for centralized allowlists (#3355) 2025-02-19 15:04:47 +01:00
mmetc
c4ff4228be
use go 1.24, enable unencrypted http2 (#3470) 2025-02-19 14:05:17 +01:00
mmetc
c5e0003b59
silence "cscli hub update" if noop in cron jobs (#3460) 2025-02-10 11:24:59 +01:00
mmetc
a001e1d760
cscli: replace '--yes' option with '--interactive' (#3448) 2025-02-06 11:43:29 +01:00
mmetc
b582730d06
remove commands "cscli config backup/restore" (#3158)
* remove "cscli config backup/restore"
* remove backup/restore calls from deb,rpm pre/postinst and wizard
* remove from prerm too
2025-01-16 14:02:39 +01:00
mmetc
5df56844d9
log warning if local items have conflicting names (#3399) 2025-01-13 13:28:48 +01:00
mmetc
866b0ad60c
Hubops tests (#3393) 2025-01-07 16:39:32 +01:00
mmetc
5c7b957a34
cscli: restyle table titles; autocomplete "cscli metrics show" (#3391)
* cscli: restyle table titles; autocomplete "cscli metrics show"
* lint
2025-01-02 16:58:03 +01:00
mmetc
a1d26bdc5b
cscli: improved hub management (#3352) 2024-12-26 15:21:52 +01:00
victoredvardsson
466f39b880
Add possibility to configure log format #799 (#2941)
* make it possible to enable json log

* fix

* fix typo

* fix typo

* fix typo

* fix typo

* fix typo

* fix typo

* Add error handling

* Add log_format to default config

* Fix syntax error in if statement

* Fix typo

* Fix typo

* Fix some typos and change naming from native to text, makes more sense

* Set same timestamp format for json logging

* Fix formatting

* Move in if statement under previous

* Fix some formatting that got messed up

* Default to text formatter, if log_format is not configured.

* defining logFormatter outside if statement so that log.SetFormatter(logFormatter) is not undefined when function is called

* Add variables that were undefined

* Argument were missing when calling SetDefaultLoggerConfig function

* Fix order of arguments passed

* Fix order of arguments passed

* Fix typo

* Implicit log_format = "text"

* functional test

* ignore log_format in FatalHook

* make it possible to enable json log

* fix

* fix typo

* fix typo

* fix typo

* fix typo

* fix typo

* fix typo

* Add error handling

* Add log_format to default config

* Fix syntax error in if statement

* Fix typo

* Fix typo

* Fix some typos and change naming from native to text, makes more sense

* Set same timestamp format for json logging

* Fix formatting

* Move in if statement under previous

* Fix some formatting that got messed up

* Default to text formatter, if log_format is not configured.

* defining logFormatter outside if statement so that log.SetFormatter(logFormatter) is not undefined when function is called

* Add variables that were undefined

* Argument were missing when calling SetDefaultLoggerConfig function

* Fix order of arguments passed

* Fix order of arguments passed

* Fix typo

* Implicit log_format = "text"

* functional test

* ignore log_format in FatalHook

* lint

* fix func test

* lint

* remove < > characters from log

---------

Co-authored-by: Victor Edvardsson <victor.edvardsson@loopia.se>
Co-authored-by: marco <marco@crowdsec.net>
Co-authored-by: Thibault "bui" Koechlin <thibault@crowdsec.net>
2024-12-23 11:08:33 +01:00
mmetc
26c15a1267
refact pkg/database: clean up code and error messages (#3263)
* refact pkg/database: extract alertfilter.go
* refact pkg/database: extract function rollbackOnError(); dry error messages
2024-12-19 17:01:16 +01:00
mmetc
99552f4a53
update dependency on docker (#3175)
* update dependency on docker

since docker doesn't have a go.mod, the opentelemetry dependencies
in go.sum must be updated by hand according to the vendor.mod file
of the related docker release

ex. https://github.com/docker/cli/blob/v27.1.1/vendor.mod
2024-12-18 16:35:00 +01:00
mmetc
b1e2b9523c
cscli: print errors in plain text with -o json (#2973) 2024-12-13 15:45:07 +01:00
mmetc
08296d9cfa
acquisition: add some test and warning for wrong source type (#3362) 2024-12-13 11:00:41 +01:00
mmetc
88c5f85064
sigmahq: fix functional test (#3359) 2024-12-10 13:19:56 +01:00
blotus
fb733ee43a
Allow bouncers to share API keys (#3323) 2024-11-19 14:47:59 +01:00
Laurence Jones
b3810c7e75
enhance: add fedora 41 (40, with provision to upgrade to 41 since there no image so far on vagrant cloud) (#3328) 2024-11-13 14:17:15 +00:00
Laurence Jones
4be84b8a0a
enhance: add opensuse leap 15 vagrant (#3329) 2024-11-13 14:15:01 +00:00
Laurence Jones
3ba71f412e
fix: Ansible fedora 40 to use 40 (#3327) 2024-11-12 16:42:19 +00:00
mmetc
92662ed461
refact cscli: decisions, lapi, bouncers, machines (#3306)
* refact "cscli decisions import"

* cobra.ExactArgs(0) -> cobra.NoArgs

* refact cscli bouncers

* refact cscli machines

* refact "cscli lapi"

* lint
2024-10-30 10:59:20 +01:00
mmetc
f97b9c84da
CI: update golangci-lint to v1.61, yq to 4.44.3 (#3241) 2024-09-17 15:19:30 +02:00
mmetc
ce085dc4cd
logs and user messages: use "parse" and "serialize" instead of marshal/unmarshal (#3240) 2024-09-17 13:19:14 +02:00
mmetc
cae76baa3a
refact acquisition: build profiles (optionally exclude datasources from final binary) (#3217)
example

$ make BUILD_PROFILE=minimal

or

$ make EXCLUDE=datasource_s3,datasource_kinesis
2024-09-12 17:26:39 +02:00
mmetc
4d10e9df00
refact: cscli papi (#3222)
* cscli papi status - fix nil deref + func test

* cscli papi: extract methods status(), sync()

* papi status -> stdout

* fix nil deref

* cscli support dump: include papi status

* lint
2024-09-10 17:32:13 +02:00
mmetc
ace942a36d
tests: prevent "make bats-fixture" to run if instance-data is locked (#3201)
* tests: prevent "make bats-fixture" to run if instance-data is locked

* lint
2024-09-06 10:31:00 +02:00
mmetc
bc6be99b97
cscli refact: package clialert, clidecision (#3203)
* cscli refact: package clialert, clidecision

* refact: function SanitizeScope()

* lint
2024-09-03 12:37:38 +02:00
blotus
d2616766de
Allow auto registration of machines in LAPI (#3202)
Co-authored-by: marco <marco@crowdsec.net>
2024-09-02 13:13:40 +02:00
mmetc
0fb64682fd
cscli refact: package cli{support, machine, bouncer} (#3199)
* cscli refact: clisupport (reuse lapi status, capi status)

* cscli refact: package clibouncer, climachine

* cscli refact: package clisupport
2024-08-29 15:21:29 +02:00