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
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
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
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
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
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
mmetc
89aec7cf6b
pkg/cwhub: simpler accessor methods ( #3165 )
...
* pkg/cwhub: simpler accessor methods
- prefer higher level GetItemsByType, GetInstalledByType over GetItemMap
- always send both appsec-rules and scenarios to api
- explicit parameter for (case insensitive) sorted list of items
- shorter code
- assume itemType parameter makes sense, don't error
* lint (gofumpt)
2024-08-22 12:12:40 +02:00
mmetc
3d27e83bf5
pkg/cwhub: improve support for k8s config maps with custom items ( #3154 )
...
* pkg/cwhub: improve support for k8s config maps as custom items
- allow links to links
- ignore hidden ..data directories, but allow links to their content
* allow any number of subdirectories in /etc/crowdsec/{hubtype}
* item name as subdir/file.yaml
* improve func test
* lint
2024-08-20 17:36:07 +02:00
mmetc
48e3f51954
cscli: add option --ignore-missing to "bouncers delete", "machines delete" ( #3177 )
...
* cscli: add option --ignore-missing to "bouncers delete", "machines delete"
* lint
2024-08-13 16:49:27 +02:00
mmetc
1bc3b0870b
command "cscli doc --target /path/to/dir" ( #3169 )
...
* command "cscli doc --target /path/to/dir"
* typos and improved messages
* CI: remove obsolete parameters for golangi-lint action
* lint
2024-08-07 12:45:54 +02:00
mmetc
6f5d75c5f1
cscli metrics: explicit message "no bouncer metrics found" ( #3155 )
2024-07-29 14:13:06 +02:00
mmetc
20067a85a0
cscli/hub: don't return error if some file can't be recognized ( #3150 )
...
In k8s there can be extra directories while mounting config maps, which
leads to a failure while parsing the hub state. The PR changes these
kind of errors to warnings.
2024-07-24 16:29:38 +02:00
mmetc
64e4ecde90
LAPI: detailed metrics endpoint ( #2858 )
2024-07-24 10:29:18 +02:00
marco
61d19cff84
update table test
2024-07-22 14:58:43 +02:00
mmetc
5b4f924d5f
allow .index.json to embed item content ( #3145 )
2024-07-22 10:54:39 +02:00
mmetc
35f97d4855
bats: curl helpers to mock log processors and bouncers ( #3141 )
2024-07-18 11:13:18 +02:00
mmetc
f130ce677d
command "cscli metrics show bouncers" ( #3126 )
...
* cscli metrics show bouncers
* db metrics: increase payload size
* func tests
2024-07-15 09:55:52 +02:00
mmetc
6f5e970f50
func tests: update curl wrapper ( #3121 )
2024-07-10 12:57:16 +02:00
mmetc
9cebcf96b4
command cscli [machines|bouncers] inspect ( #3103 )
...
* command cscli [machines|bouncers] inspect
* lint
2024-07-03 17:20:20 +02:00
mmetc
27935f6d4c
fix "cscli [machines|bouncers] delete" autocompletion ( #3101 )
...
* fix "cscli [machines|bouncers] delete" autocompletion
* func test
2024-07-01 16:35:34 +02:00
mmetc
a3bd9baec1
improved tls middleware revocation checks ( #3034 )
2024-06-26 10:41:30 +02:00
mmetc
a1ebe18221
config: expand env variables in local_api_credentials.yaml and .yaml.local ( #3093 )
...
* config: expand env variables in local_api_credentials.yaml and .yaml.local
* fix func test
2024-06-20 17:18:41 +02:00
mmetc
4521a98ecc
db: don't set machine heartbeat until first connection ( #3019 )
...
* db: don't set machine heartbeat until first connection
* cscli machines prune: if hearbeat is not set, look at creation date
* lint
2024-06-17 10:39:50 +02:00
mmetc
44a2014f62
db: don't set bouncer last_pull until first connection ( #3020 )
...
* db: don't set bouncer last_pull until first connection
* cscli bouncers prune: query creation date if they never connected
2024-06-17 10:16:46 +02:00
mmetc
c39c9cf8b7
cscli: fix deprecation message for "context delete" ( #3078 )
...
missing newline, proper return code, same msg as dashboard, test
2024-06-11 09:28:10 +02:00
mmetc
cad760e605
pkg/cwhub: use explicit context for version check, index update ( #3064 )
...
* cscli refactor: explicit context for hub (version lookup)
* change order of version checks
* pkg/cwhub: split NewHub() + Update() + Load()
* cscli refactor: explicit context for hub (index update)
* updated pkg/cwhub docs
* lint
2024-06-07 16:56:02 +02:00
mmetc
114a966129
refactor "cscli decisions" ( #3061 )
...
* cscli decisions: extract method add()
* cscli decisions: extract method delete()
* cscli lapi: avoid apiclient global
* cscli capi: avoid apiclient global
* cscli decisions: error cleanup, avoid global for api client
* update test
* cscli alerts: extract method delete()
* lint
2024-06-06 10:21:03 +02:00