Commit graph

860 commits

Author SHA1 Message Date
Sebastien Blot
cd2ceee414
remove notification support 2024-09-02 15:09:58 +02:00
Sebastien Blot
94d368604d
remove all acquis module except file and syslog 2024-09-02 14:43:58 +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
ec415ed069
cscli hub update: option --with-content to keep embedded items in index; use it in docker (#3192) 2024-08-27 13:07:05 +02:00
Robert Nagy
27559d6636
implement GetFSType on openbsd with the correct statfs struct member (#3191) 2024-08-27 12:41:53 +02:00
mmetc
da495e812c
pkg/cwhub: cache control / send etag header from file contents, check with HEAD req (#3187) 2024-08-23 17:05:55 +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
08fdfc4fb0
cscli refact: package 'cliconsole' (#3149)
* cscli refact: package 'cliconsole'

* dry

* lint

* lint
2024-08-20 16:20:40 +02:00
mmetc
e7b54c68c5
refact (nestif): reduce complexity of pkg/leakybucket (#3139)
* refact (nestif): extract functions in pkg/leakybucket/overflows.go

* refact (nestif): extract functions in pkg/leakybucket/manager_load.go

* lint
2024-08-20 15:47:28 +02:00
mmetc
6b9b19b8c1
CI: use golangci-lint 1.60 (#3180)
* use golangci-lint 1.60

* lint (gosimple/S1009) -> len(nil) == 0

* nerf govet for now
2024-08-19 14:09:17 +02:00
blotus
534fb14f7b
hide geoip related warnings (#3179) 2024-08-19 10:07:06 +02:00
Alexander Mnich
64d2ea0ddb
add missing ApiKeyAuthorizer to decisions swagger endpoint (#3178) 2024-08-16 21:48:14 +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
Laurence Jones
71a253aea6
Remove useragent set by RC (#3167)
Fix #3166
2024-08-12 09:34:45 +01:00
mmetc
52995b8fa4
prevent nil deref when loading cti config (#3176)
* correct variable names

* prevent nil deref when loading cti config
2024-08-12 10:15:00 +02:00
mmetc
3532e872d3
metrics: avoid nil deref with inactive bouncers or malformed response (#3170)
* metrics: avoid nil deref with inactive bouncers

* log message from API even it if cannot be parsed

* fix unit test
2024-08-08 16:46:39 +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
136dba61d9
reduce log verbosity, minor CI fixes, lint (#3157)
* pkg/cwhub: redundant log messages

* CI: fixture output and elapsed time

* CI: preload only essential hub items

* report full version (including -rc2 etc.) with cscli hub update --debug

* lint
2024-08-01 10:55:04 +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
Manuel Sabban
36d15fedce
Use the new hub api url (#3132)
* new hapi url
* mock url in tests has to be updated
---------

Co-authored-by: marco <marco@crowdsec.net>
2024-07-24 12:20:23 +02:00
mmetc
24bd8bb92c
perf: retrieve unsorted metrics (#3148) 2024-07-24 10:50:19 +02:00
mmetc
64e4ecde90
LAPI: detailed metrics endpoint (#2858) 2024-07-24 10:29:18 +02:00
blotus
a3d7900b5f
update expr (#3144) 2024-07-22 12:14:46 +02:00
mmetc
5b4f924d5f
allow .index.json to embed item content (#3145) 2024-07-22 10:54:39 +02:00
mmetc
189fb9ca1b
deps: use go-cs-lib 0.13 (#3136) 2024-07-17 09:50:31 +02:00
blotus
c4bfdf1991
Store alert remediations status in DB (#3115) 2024-07-16 10:08:00 +02:00
Laurence Jones
84c214a6f0
enhance: add crowdsec user agent to cti do request func (#3130) 2024-07-15 12:31:01 +01:00
mmetc
c4da2775cd
usage metrics: validate maxLength for some elements (#3131)
Co-authored-by: Sebastien Blot <sebastien@crowdsec.net>
2024-07-15 13:26:59 +02:00
mmetc
5390b8ea4b
remove warning "maxopenconns is 0, default to 100" (#3129)
* remove warning "maxopenconns is 0, default to 100"

also don't store as pointer since value 0 is not useful

* lint
2024-07-15 11:05:40 +02:00
mmetc
91463836ff
tests: increase delta for flaky float comparison (#3122)
* tests: increase delta for flaky float comparison

* remove leading 0 from non-octal number
2024-07-15 10:51:45 +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
06720538f5
revert "db: round created, updated... timestamps to 1 second" (#3127)
this fixes functional tests with decision stream startup=true
2024-07-12 17:02:44 +02:00
mmetc
1b0104186a
cscli machines/bouncers: dry helper code and move to cscli (#3123) 2024-07-11 12:19:10 +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
4635d04b22
lapi detailed metrics: API spec + models (#3100)
* lapi detailed metrics: API spec + models

* models+db: split hubstate by item type
2024-07-02 22:49:47 +02:00
mmetc
b1cf83975e
db refact: drop column machines.status (#3102) 2024-07-02 16:08:41 +02:00
mmetc
1acc35442c
lapi detailed metrics: db schema (#3099) 2024-07-01 12:14:55 +02:00
mmetc
b081065c8e
lint: replace "github.com/pkg/errors" in apiserver (#3097) 2024-07-01 11:54:49 +02:00
mmetc
206211ce53
lint: import statement order (#3085)
* lint: import statement order

* lint
2024-06-26 12:16:17 +02:00
mmetc
a3bd9baec1
improved tls middleware revocation checks (#3034) 2024-06-26 10:41:30 +02:00
mmetc
0e93f98cad
lint: github.com/pkg/errors -> errors (#3091) 2024-06-21 14:31:45 +02:00
mmetc
4b988701ed
lint (intrange) (#2970) 2024-06-21 13:47:26 +02:00
mmetc
8a259fd25b
lint (copyloopvar) (#2971) 2024-06-20 22:13:26 +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
659774fd3d
refactor: prefer logrus.WithField over WithFields with a single param (#3087) 2024-06-20 10:38:23 +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
e6ebf7af22
enable linter: revive (superfluous-else) (#3082)
* enable linter: revive (superfluous-else)

* lint (whitespace)
2024-06-13 11:33:01 +02:00
mmetc
a529e66cd8
Typos (#3084)
* comment fix

* redundancy

* typo nill -> nil

* remove extra newline from log
2024-06-13 11:07:44 +02:00