Commit graph

1854 commits

Author SHA1 Message Date
marco
f70f1ad2af interface conversion: interface {} is *syscall.Stat_t, not *unix.Stat_t 2024-08-22 09:38:48 +02:00
marco
89efed68b0 replace syscall with unix/windows packages where possible
from the 1.22 release notes:

The syscall package has been frozen since Go 1.4 and was marked as deprecated in Go 1.11 [...]
However, some non-deprecated functionality requires use of the syscall package [...]
To avoid unnecessary complaints[...] no longer marked as deprecated.
The package remains frozen to most new functionality, and new code remains encouraged
to use golang.org/x/sys/unix or golang.org/x/sys/windows where possible.
2024-08-22 09:38:48 +02:00
mmetc
429418ffc6
cscli refact: package 'cliexplain' (#3151) 2024-08-21 10:24:18 +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
0e567a9a18
CI: go - don't pin minor version (always use latest) (#3181) 2024-08-20 09:48:36 +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
mmetc
2fbc214538
CI: use go 1.22.6 (#3171) 2024-08-19 09:54:58 +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
Thibault "bui" Koechlin
6bd4096a3e
fix #1742 : Allow QueryCAPIStatus to return as well enrollment status (#3159)
* fix #1742 : Allow QueryCAPIStatus to return as well enrollment status

---------

Co-authored-by: marco <marco@crowdsec.net>
2024-08-05 12:04:07 +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
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
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
a7ec842bce
docker: symlink all data files to the staging area (#3120) 2024-07-24 11:00:38 +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
marco
61d19cff84 update table test 2024-07-22 14:58:43 +02:00
mmetc
7b1794ff89
CI: update test dependencies (#3146) 2024-07-22 12:59:24 +02:00
blotus
a3d7900b5f
update expr (#3144) 2024-07-22 12:14:46 +02:00
mmetc
30c0d8997d
CI: update action versions (#3143) 2024-07-22 12:12:27 +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
8f1abc300d
docker: make sure the sqlite db is present before changing GID (#3140) 2024-07-18 09:58:45 +02:00
mmetc
443ec37e47
lint: dockerfiles (#3138) 2024-07-18 09:39:57 +02:00
mmetc
aabb5cca89
CI: use go 1.22.5 (#3128) 2024-07-17 12:48:07 +02:00
mmetc
8d96ddd48e
refact cscli metrics: fix lines between tables, skip wrapper api (#3137)
* fix empty line between metrics tables

* refact metrics tables: use go-pretty api directly

* lint
2024-07-17 12:30:52 +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
6f5e970f50
func tests: update curl wrapper (#3121) 2024-07-10 12:57:16 +02:00
mmetc
31195ddf36
update vagrant config for opensuse (#3119) 2024-07-09 15:30:38 +02:00
mmetc
aab59b6287
typos (#3104)
* typos

* lint
2024-07-09 14:51:31 +02:00
mmetc
aa0c389d2b
make: remove redundant go version check (#3118)
It's already done by the toolchain with go.mod
2024-07-09 14:49:55 +02:00
Laurence Jones
96a6eec1fb
enhance: Add default_range_remediation (#3109) 2024-07-05 16:04:33 +01:00
mmetc
ea2098f6e6
refact cscli metrics: split stat types to own files (#3107) 2024-07-04 15:55:47 +02:00
mmetc
7cc33b5854
cscli refact: extract metrics to own package (#3106) 2024-07-04 14:43:35 +02:00