Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from crowdsecurity:master #70

Open
wants to merge 333 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
333 commits
Select commit Hold shift + click to select a range
912c4bc
split & reorganize tests a bit. Add tests on existing zones (#2925)
buixor Apr 3, 2024
2682f80
windows: fix data file update (remove before rename) (#2930)
mmetc Apr 5, 2024
990dd5e
use go 1.21.9; update dependencies (#2931)
mmetc Apr 5, 2024
0e8a1c6
docker: pre-download all hub items and data, opt-in hub update/upgrad…
mmetc Apr 8, 2024
2291a23
docker: pre-download hub items (debian image) (#2934)
mmetc Apr 8, 2024
0746e0c
Rename bouncers to Remediation component in openAPI (#2936)
AlteredCoder Apr 11, 2024
c6e4019
Revert "docker: pre-download all hub items and data, opt-in hub updat…
blotus Apr 18, 2024
95f2767
enhance: add refactoring to governance (#2955)
LaurenceJJones Apr 22, 2024
630cbf0
update linter list and descriptions (#2951)
mmetc Apr 22, 2024
fb393f1
tests: bump yq, cfssl (#2952)
mmetc Apr 22, 2024
b48b728
cscli support: include stack traces (#2935)
mmetc Apr 22, 2024
718d1c5
pkg/database/decisiosn: remove filter parameter, which is always pass…
mmetc Apr 23, 2024
c64332d
cscli config show: avoid globals, use yaml v3 (#2863)
mmetc Apr 23, 2024
725cae1
CI: upload coverage with token (#2958)
mmetc Apr 23, 2024
97e6588
cscli hub items: avoid global (#2960)
mmetc Apr 24, 2024
0f942a9
pkg/cwhub - rename methods for clarity (#2961)
mmetc Apr 24, 2024
6043180
db config: don't exit setup if can't detect fs, improve detection for…
mmetc Apr 25, 2024
f4ed7b3
Truncate meta data (#2966)
buixor Apr 25, 2024
845d454
cscli: use yaml.v3 (#2965)
mmetc Apr 25, 2024
ceb4479
add zfs magic for GetFSType (#2950)
blotus Apr 25, 2024
2abc078
use go 1.22.2 (#2826)
mmetc Apr 25, 2024
d2c4bc5
plugins: use yaml.v3 (#2969)
mmetc Apr 25, 2024
c447383
Refact pkg/parser/node (#2953)
mmetc Apr 25, 2024
05b5468
feat: support stdout in cscli support dump (#2939)
LaurenceJJones Apr 26, 2024
3788610
cscli: avoid global vars (#2977)
mmetc May 2, 2024
87564ea
pkg/dumps,hubtest: use yaml.v3 (#2972)
mmetc May 2, 2024
c70a2fe
update go dependencies (#2968)
mmetc May 2, 2024
91fbc63
db: review update timestamps, immutable columns (#2981)
mmetc May 2, 2024
529d3b2
minor lint/readability (#2976)
mmetc May 2, 2024
3392e5e
enable linter "revive" (#2978)
mmetc May 2, 2024
659feec
cscli: don't print timestamps (#2984)
mmetc May 6, 2024
a2dcc0e
cscli: remove global dbClient (#2985)
mmetc May 6, 2024
11da728
cscli support: collect profiling data and logs (#2987)
mmetc May 7, 2024
0d9e000
use go-cs-lib/downloader for data files, hub index, item YAML (#2926)
mmetc May 7, 2024
e5cd480
update go-cs-lib to 0.0.11 (#2990)
mmetc May 7, 2024
defa076
CI: disable log formatting for consistency (#2989)
mmetc May 7, 2024
14dc26b
Add ability to configure channel, username, icon emoji/url in slack n…
blesswinsamuel May 10, 2024
26b3410
CI: improve test "cscli machines prune" (#2992)
mmetc May 13, 2024
b4e79aa
use go 1.22.3 (#2994)
mmetc May 13, 2024
e4a8d3b
deb,rpm: include empty directory etc/crowdsec/acquis.d (#2997)
mmetc May 13, 2024
e3c6a5b
LAPI: support CRL files with multiple PEM blocks (#3002)
mmetc May 13, 2024
11893b2
[cscli] Add tab completion to notifications [test, inspect] (#2765)
LaurenceJJones May 14, 2024
b5e5078
fix: add sslmode check and apend flag to conn string (#3009)
LaurenceJJones May 14, 2024
6b978b0
docker: conditionally update hub (#2948)
blotus May 15, 2024
ecd82ec
feat: File notification plugin (#2932)
LaurenceJJones May 15, 2024
41ec90a
make: remove unused targets (#2998)
mmetc May 15, 2024
ccab6e9
bats: clean up extra output (#3008)
mmetc May 15, 2024
cc63729
version: write to stdout, add missing newline (#3012)
mmetc May 15, 2024
1b894a2
`GetActiveDecisionsCount()`and `GetActiveDecisionsTimeLeft()`expr hel…
blotus May 15, 2024
ccf08e5
bats: no need for openssl, netcat; allow to prevent tests from runnin…
mmetc May 16, 2024
b6253d5
simulation for local scenarios (#3010)
mmetc May 16, 2024
0ba05ac
tests: replace "docker-compose" -> "docker compose" (#3000)
mmetc May 17, 2024
1a4ac9d
replace log.Fatal with error return (#2996)
mmetc May 17, 2024
20e44cd
appsec: add files and cookies related zones (#2956)
blotus May 17, 2024
572b387
CI: improve code coverage report (#3029)
mmetc May 24, 2024
816608d
cscli: faster table rendering (#3027)
mmetc May 24, 2024
45b403e
fix nil deref w/ malformed cti config (#3028)
mmetc May 24, 2024
09afcbe
appsec: respect on_success parameter in hooks (#3017)
blotus May 24, 2024
f06e3e7
jwt transport: fix retry on unauthorized from CAPI(#3006)
blotus May 24, 2024
9088f31
enhance: container discovery via labels (#2959)
LaurenceJJones May 24, 2024
f3341c1
Appsec: properly populate event (#2943)
blotus May 27, 2024
7d6514c
update user agent with version and platform information (#3035)
mmetc May 30, 2024
16bfab8
check type assertion in geoip enrichers (#3040)
blotus May 31, 2024
02e2c8a
deps: use ent 0.13.1 (#3023)
mmetc May 31, 2024
6dbc5fd
db: mark immutable columns / remove unused (#3024)
mmetc May 31, 2024
b8ee31a
pkg/database: simplify flush agents/bouncers (#3026)
mmetc May 31, 2024
95bc588
update vagrant image for fc39, fc40 and ubuntu24.04 (#3042)
sabban May 31, 2024
599a5a4
pkg/dumps.DumpTree: split to reduce complexity (#3001)
mmetc May 31, 2024
8501f45
db,lapi: round durations and timestamps to 1 second (#3015)
mmetc May 31, 2024
89d02e9
CI/lint: enable some "revive" rules (#3041)
mmetc May 31, 2024
c1e858c
cscli: refactor alerts/console/decisions/setup (#3003)
mmetc May 31, 2024
9823ed6
cscli: log.Fatal -> return err (#3049)
mmetc Jun 3, 2024
7313d49
enable linter: revive(bool-literal-in-expr) (#2983)
mmetc Jun 4, 2024
fba4237
lint: revive/useless-break (#3050)
mmetc Jun 4, 2024
9101de9
pkg/database: refactor & rename "soft delete" to "expire" (#3025)
mmetc Jun 4, 2024
d614ecb
CI/bats: test remediation api via socket (#3052)
mmetc Jun 4, 2024
f0f27ee
add decently new version of python for centos 7 and 8 for testing (#3…
sabban Jun 4, 2024
2865b69
fix tests in 01_crowdsec.bats for packages testing (#3054)
sabban Jun 5, 2024
3dd17b9
tests: log.Fatal -> return err (#3056)
mmetc Jun 5, 2024
73e03ef
lint: enable revive/if-return, revive/error-strings (#3057)
mmetc Jun 5, 2024
9e859c0
refactor pkg/database, pkg/models (#3022)
mmetc Jun 5, 2024
114a966
refactor "cscli decisions" (#3061)
mmetc Jun 6, 2024
1378e16
fix test 01_cscli by avoiding discrepancies in cscli explain (#3059)
sabban Jun 6, 2024
b38b959
enable linter "stylecheck" (#3060)
mmetc Jun 6, 2024
7d75290
Use cmp.Or from go 1.22 (#3058)
mmetc Jun 6, 2024
6ef2396
enable linter: revive (blank-imports) (#3062)
mmetc Jun 6, 2024
550d422
lint revive(deep-exit): refactor cmd/crowdsec (#3063)
mmetc Jun 7, 2024
d397489
add: go reference badge (#3066)
mazzma12 Jun 7, 2024
72b6da9
enable linter: revive (early-return) (#3051)
mmetc Jun 7, 2024
cad760e
pkg/cwhub: use explicit context for version check, index update (#3064)
mmetc Jun 7, 2024
dd6cf2b
pkg/cwhub: use explicit context for item install, upgrade (#3067)
mmetc Jun 7, 2024
13fb252
lint: replace cyclop, gocyclo with revive; basic pkg/hubtest helper (…
mmetc Jun 7, 2024
819fa0e
enhancement: add other log levels to docker start script and document…
LaurenceJJones Jun 10, 2024
7fd01ae
CI: update golangci-lint to 1.59; enforce canonical HTTP headers (#3074)
mmetc Jun 10, 2024
31ed9fb
enable linter: revive (indent-error-flow) (#3068)
mmetc Jun 10, 2024
ae58b15
enable linter: revive (var-declaration) (#3069)
mmetc Jun 11, 2024
c39c9cf
cscli: fix deprecation message for "context delete" (#3078)
mmetc Jun 11, 2024
1d08edc
enable linter: revive (deep-exit) (#3077)
mmetc Jun 11, 2024
24687e9
enhancement: add deprecation notice to cscli dashboard prerun (#3079)
LaurenceJJones Jun 11, 2024
bd4540b
refactor context (cscli, pkg/database) (#3071)
mmetc Jun 11, 2024
fd433a7
cscli: refactor "cscli setup" to avoid global variable (#3075)
mmetc Jun 12, 2024
73792ea
refactor pkg/parser: extract processGrok (#3080)
mmetc Jun 12, 2024
e859a75
lint: disable redundant linters, update revive configuration and code…
mmetc Jun 12, 2024
4e09ae2
cscli: fixed some inconsistency in returning errors (#3076)
mmetc Jun 12, 2024
a529e66
Typos (#3084)
mmetc Jun 13, 2024
2f6d4cc
cscli: refactor hubtests / extract methods run(), coverage() (#3086)
mmetc Jun 13, 2024
e6ebf7a
enable linter: revive (superfluous-else) (#3082)
mmetc Jun 13, 2024
44a2014
db: don't set bouncer last_pull until first connection (#3020)
mmetc Jun 17, 2024
4521a98
db: don't set machine heartbeat until first connection (#3019)
mmetc Jun 17, 2024
659774f
refactor: prefer logrus.WithField over WithFields with a single param…
mmetc Jun 20, 2024
a1ebe18
config: expand env variables in local_api_credentials.yaml and .yaml.…
mmetc Jun 20, 2024
8a259fd
lint (copyloopvar) (#2971)
mmetc Jun 20, 2024
4b98870
lint (intrange) (#2970)
mmetc Jun 21, 2024
0e93f98
lint: github.com/pkg/errors -> errors (#3091)
mmetc Jun 21, 2024
3097c0c
lint: replace gocognit with revive (#3094)
mmetc Jun 25, 2024
a3bd9ba
improved tls middleware revocation checks (#3034)
mmetc Jun 26, 2024
d4e6b75
CI: use go 1.22.4 (#3095)
mmetc Jun 26, 2024
206211c
lint: import statement order (#3085)
mmetc Jun 26, 2024
b081065
lint: replace "github.com/pkg/errors" in apiserver (#3097)
mmetc Jul 1, 2024
1acc354
lapi detailed metrics: db schema (#3099)
mmetc Jul 1, 2024
27935f6
fix "cscli [machines|bouncers] delete" autocompletion (#3101)
mmetc Jul 1, 2024
b1cf839
db refact: drop column machines.status (#3102)
mmetc Jul 2, 2024
4635d04
lapi detailed metrics: API spec + models (#3100)
mmetc Jul 2, 2024
9cebcf9
command cscli [machines|bouncers] inspect (#3103)
mmetc Jul 3, 2024
90e3299
cscli refact: extract table wrapper to own package (#3105)
mmetc Jul 4, 2024
7cc33b5
cscli refact: extract metrics to own package (#3106)
mmetc Jul 4, 2024
ea2098f
refact cscli metrics: split stat types to own files (#3107)
mmetc Jul 4, 2024
96a6eec
enhance: Add default_range_remediation (#3109)
LaurenceJJones Jul 5, 2024
aa0c389
make: remove redundant go version check (#3118)
mmetc Jul 9, 2024
aab59b6
typos (#3104)
mmetc Jul 9, 2024
31195dd
update vagrant config for opensuse (#3119)
mmetc Jul 9, 2024
6f5e970
func tests: update curl wrapper (#3121)
mmetc Jul 10, 2024
1b01041
cscli machines/bouncers: dry helper code and move to cscli (#3123)
mmetc Jul 11, 2024
0672053
revert "db: round created, updated... timestamps to 1 second" (#3127)
mmetc Jul 12, 2024
f130ce6
command "cscli metrics show bouncers" (#3126)
mmetc Jul 15, 2024
9146383
tests: increase delta for flaky float comparison (#3122)
mmetc Jul 15, 2024
5390b8e
remove warning "maxopenconns is 0, default to 100" (#3129)
mmetc Jul 15, 2024
c4da277
usage metrics: validate maxLength for some elements (#3131)
mmetc Jul 15, 2024
84c214a
enhance: add crowdsec user agent to cti do request func (#3130)
LaurenceJJones Jul 15, 2024
c4bfdf1
Store alert remediations status in DB (#3115)
blotus Jul 16, 2024
189fb9c
deps: use go-cs-lib 0.13 (#3136)
mmetc Jul 17, 2024
8d96ddd
refact cscli metrics: fix lines between tables, skip wrapper api (#3137)
mmetc Jul 17, 2024
aabb5cc
CI: use go 1.22.5 (#3128)
mmetc Jul 17, 2024
443ec37
lint: dockerfiles (#3138)
mmetc Jul 18, 2024
8f1abc3
docker: make sure the sqlite db is present before changing GID (#3140)
mmetc Jul 18, 2024
35f97d4
bats: curl helpers to mock log processors and bouncers (#3141)
mmetc Jul 18, 2024
5b4f924
allow .index.json to embed item content (#3145)
mmetc Jul 22, 2024
30c0d89
CI: update action versions (#3143)
mmetc Jul 22, 2024
a3d7900
update expr (#3144)
blotus Jul 22, 2024
7b1794f
CI: update test dependencies (#3146)
mmetc Jul 22, 2024
61d19cf
update table test
mmetc Jul 22, 2024
64e4ecd
LAPI: detailed metrics endpoint (#2858)
mmetc Jul 24, 2024
24bd8bb
perf: retrieve unsorted metrics (#3148)
mmetc Jul 24, 2024
a7ec842
docker: symlink all data files to the staging area (#3120)
mmetc Jul 24, 2024
36d15fe
Use the new hub api url (#3132)
sabban Jul 24, 2024
20067a8
cscli/hub: don't return error if some file can't be recognized (#3150)
mmetc Jul 24, 2024
6f5d75c
cscli metrics: explicit message "no bouncer metrics found" (#3155)
mmetc Jul 29, 2024
136dba6
reduce log verbosity, minor CI fixes, lint (#3157)
mmetc Aug 1, 2024
6bd4096
fix #1742 : Allow QueryCAPIStatus to return as well enrollment status…
buixor Aug 5, 2024
1bc3b08
command "cscli doc --target /path/to/dir" (#3169)
mmetc Aug 7, 2024
3532e87
metrics: avoid nil deref with inactive bouncers or malformed response…
mmetc Aug 8, 2024
52995b8
prevent nil deref when loading cti config (#3176)
mmetc Aug 12, 2024
71a253a
Remove useragent set by RC (#3167)
LaurenceJJones Aug 12, 2024
48e3f51
cscli: add option --ignore-missing to "bouncers delete", "machines de…
mmetc Aug 13, 2024
64d2ea0
add missing ApiKeyAuthorizer to decisions swagger endpoint (#3178)
a-mnich Aug 16, 2024
2fbc214
CI: use go 1.22.6 (#3171)
mmetc Aug 19, 2024
534fb14
hide geoip related warnings (#3179)
blotus Aug 19, 2024
6b9b19b
CI: use golangci-lint 1.60 (#3180)
mmetc Aug 19, 2024
0e567a9
CI: go - don't pin minor version (always use latest) (#3181)
mmetc Aug 20, 2024
e7b54c6
refact (nestif): reduce complexity of pkg/leakybucket (#3139)
mmetc Aug 20, 2024
08fdfc4
cscli refact: package 'cliconsole' (#3149)
mmetc Aug 20, 2024
3d27e83
pkg/cwhub: improve support for k8s config maps with custom items (#3154)
mmetc Aug 20, 2024
429418f
cscli refact: package 'cliexplain' (#3151)
mmetc Aug 21, 2024
89aec7c
pkg/cwhub: simpler accessor methods (#3165)
mmetc Aug 22, 2024
da495e8
pkg/cwhub: cache control / send etag header from file contents, check…
mmetc Aug 23, 2024
9c0422f
cscli refact: package 'clicapi', 'clilapi' (#3185)
mmetc Aug 26, 2024
c4431b6
cscli refact: notifications, simulation, papi, setup (#3190)
mmetc Aug 26, 2024
27559d6
implement GetFSType on openbsd with the correct statfs struct member …
rnagy Aug 27, 2024
ec415ed
cscli hub update: option --with-content to keep embedded items in ind…
mmetc Aug 27, 2024
2e970b3
cscli refact: package 'clihubtest' (#3174)
mmetc Aug 27, 2024
eec32ad
cscli refact: extract packages ask, clientinfo (#3197)
mmetc Aug 28, 2024
b880df9
cscli refact: package 'clihub' (#3198)
mmetc Aug 28, 2024
0fb6468
cscli refact: package cli{support, machine, bouncer} (#3199)
mmetc Aug 29, 2024
8c0c10c
enhance: return an error if cscli dashboard is run within a container…
LaurenceJJones Sep 2, 2024
d261676
Allow auto registration of machines in LAPI (#3202)
blotus Sep 2, 2024
dda0fa1
cscli dashboard: exit earlier on docker (#3210)
mmetc Sep 2, 2024
f0d6046
cscli refact: package cliitem (#3204)
mmetc Sep 2, 2024
ae5e99f
update grokky and deps (#3206)
blotus Sep 3, 2024
5a50fd0
refact: reduce code nesting (acquisition/file, tests) (#3200)
mmetc Sep 3, 2024
bc6be99
cscli refact: package clialert, clidecision (#3203)
mmetc Sep 3, 2024
fb0117e
enhance: add additional explain options to hubtest (#3162)
LaurenceJJones Sep 3, 2024
ace942a
tests: prevent "make bats-fixture" to run if instance-data is locked …
mmetc Sep 6, 2024
57dee1a
fix appsec/tls issues by cloning http transport (#3213)
mmetc Sep 6, 2024
c8750f6
refact: pkg/apiclient set and use default user agent (#3219)
mmetc Sep 9, 2024
4d10e9d
refact: cscli papi (#3222)
mmetc Sep 10, 2024
57539f6
refact cscli - don't export functions if not required (#3224)
mmetc Sep 11, 2024
584a19f
fix #3225: info->debug for trigger bucket overflow (#3227)
mmetc Sep 12, 2024
d5c587c
refact / split APIServer.Run() method (#3215)
mmetc Sep 12, 2024
cae76ba
refact acquisition: build profiles (optionally exclude datasources fr…
mmetc Sep 12, 2024
6810b41
refact pkg/database: context propagation (start) (#3226)
mmetc Sep 12, 2024
8a74fae
context propagation: cscli {capi,lapi,papi} (#3228)
mmetc Sep 12, 2024
1591a0c
Update go-re2 (#3230)
blotus Sep 13, 2024
ce085dc
logs and user messages: use "parse" and "serialize" instead of marsha…
mmetc Sep 17, 2024
f97b9c8
CI: update golangci-lint to v1.61, yq to 4.44.3 (#3241)
mmetc Sep 17, 2024
5f22c78
enable linters: copyloopvar, intrange (#3184)
mmetc Sep 17, 2024
b93b240
lint: enable (some) gocritic checks (#3238)
mmetc Sep 17, 2024
5196932
refact: alerts query (#3216)
mmetc Sep 18, 2024
b14201a
CI: delegate pipenv cache management to the setup-python action (#3243)
mmetc Sep 19, 2024
7c5d4d8
context propagation: explicit ctx parameter in unit tests (#3229)
mmetc Sep 19, 2024
be391a3
context propagation: pass context to NewAPIC() (#3231)
mmetc Sep 19, 2024
2a60c99
context propagation: pkg/database/flush (#3235)
mmetc Sep 19, 2024
b4a2403
context propagation: bouncer list (#3236)
mmetc Sep 19, 2024
eeb2801
context propagation: pkg/database/config (#3246)
mmetc Sep 19, 2024
29f3d27
context propagation: pkg/database/metrics (#3247)
mmetc Sep 19, 2024
00032d4
lint/nestif: reduce hubtest complexity (#3244)
mmetc Sep 19, 2024
e2196bd
remove dependency from pkg/cwversion to pkg/acquisition (#3242)
mmetc Sep 20, 2024
fee3deb
context propagation: pkg/database/machines (#3248)
mmetc Sep 20, 2024
4a2a663
context propagation: pkg/database/bouncers (#3249)
mmetc Sep 20, 2024
1133afe
context propagation: pkg/database/{lock,decision} (#3251)
mmetc Sep 23, 2024
3945a99
context propagation: pkg/database/alerts (#3252)
mmetc Sep 24, 2024
897613e
CI: check generated code in test workflow (#3261)
mmetc Sep 25, 2024
27451a5
context propagation: pass ctx to UpdateScenario() (#3258)
mmetc Oct 2, 2024
56c9c7a
Re-generate capi models (#3260)
mmetc Oct 2, 2024
af3116d
context propagation: don't store ctx in api controller (#3268)
mmetc Oct 3, 2024
06adbe0
context propagation: apic, unit tests (#3271)
mmetc Oct 3, 2024
4e3495d
lint/revive: check tags on non-exported struct fields (#3257)
mmetc Oct 3, 2024
f6af791
CI: update test dependencies (#3267)
mmetc Oct 4, 2024
40021b6
CI: update coverage ignore list for generated code (#3262)
mmetc Oct 4, 2024
b9bccfa
context propagation: pkg/apiserver (#3272)
mmetc Oct 9, 2024
4ea0537
CI: generate codecov.yml before tests (#3280)
mmetc Oct 10, 2024
50d115b
Update protobufs (#3276)
mmetc Oct 10, 2024
8ff58ee
context propagation: pkg/csplugin (#3273)
mmetc Oct 10, 2024
9976616
context propagation: StreamingAcquisition() (#3274)
mmetc Oct 11, 2024
b2ac65b
avoid deadlock when deleting decisions if PAPI is half configured (#3…
blotus Oct 16, 2024
d8bc17b
wineventlog: add support for replaying evtx files (#3278)
blotus Oct 16, 2024
128328b
require go 1.23 (#3298)
mmetc Oct 25, 2024
d00a6a6
enhance: Check if resp is nil in capi metrics and continue (#3299)
LaurenceJJones Oct 25, 2024
9d6ccb0
context propagation: appsec, docker, kafka, k8s datasources (#3284)
mmetc Oct 25, 2024
3ead746
enhance: Remove if log check in one instance that was not needed as t…
LaurenceJJones Oct 28, 2024
53f9bc5
context propagation: OneShotAcquisition(); enable contextcheck linter…
mmetc Oct 28, 2024
96d4da7
remove unused code: HandleDeletedDecisions() (#3301)
mmetc Oct 29, 2024
97c1f60
make: remove obsolete/redundant parameters (#3304)
mmetc Oct 29, 2024
92662ed
refact cscli: decisions, lapi, bouncers, machines (#3306)
mmetc Oct 30, 2024
0940724
make: allow build on ubuntu 24.10 (#3311)
mmetc Oct 31, 2024
1616991
Alert context appsec (#3288)
buixor Nov 4, 2024
5752111
update checks for wrapped errors (#3117)
mmetc Nov 4, 2024
19b70f1
add HTTP datasource (#3294)
he2ss Nov 5, 2024
f2dfc66
readme: update bouncers link (#3297)
laur89 Nov 5, 2024
94a2a58
loki: add no_ready_check option (#3317)
blotus Nov 8, 2024
5d414f5
Add explicit configuration for signals sharing and blocklists pull (#…
blotus Nov 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
154 changes: 154 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# we measure coverage but don't enforce it
# https://docs.codecov.com/docs/codecov-yaml
codecov:
require_ci_to_pass: false

coverage:
status:
patch:
Expand All @@ -8,3 +11,154 @@ coverage:
project:
default:
target: 0%

# if a directory is ignored, there is no way to un-ignore files like pkg/models/helpers.go
# so we make a full list
ignore:
- "./pkg/modelscapi/success_response.go"
- "./pkg/modelscapi/get_decisions_stream_response_deleted.go"
- "./pkg/modelscapi/login_request.go"
- "./pkg/modelscapi/get_decisions_stream_response_links.go"
- "./pkg/modelscapi/login_response.go"
- "./pkg/modelscapi/add_signals_request_item.go"
- "./pkg/modelscapi/blocklist_link.go"
- "./pkg/modelscapi/get_decisions_stream_response_deleted_item.go"
- "./pkg/modelscapi/decisions_sync_request.go"
- "./pkg/modelscapi/get_decisions_stream_response.go"
- "./pkg/modelscapi/metrics_request_machines_item.go"
- "./pkg/modelscapi/metrics_request.go"
- "./pkg/modelscapi/get_decisions_stream_response_new.go"
- "./pkg/modelscapi/add_signals_request_item_decisions_item.go"
- "./pkg/modelscapi/metrics_request_bouncers_item.go"
- "./pkg/modelscapi/decisions_sync_request_item_decisions_item.go"
- "./pkg/modelscapi/decisions_delete_request_item.go"
- "./pkg/modelscapi/get_decisions_stream_response_new_item.go"
- "./pkg/modelscapi/decisions_sync_request_item.go"
- "./pkg/modelscapi/add_signals_request.go"
- "./pkg/modelscapi/reset_password_request.go"
- "./pkg/modelscapi/add_signals_request_item_decisions.go"
- "./pkg/modelscapi/decisions_sync_request_item_source.go"
- "./pkg/modelscapi/error_response.go"
- "./pkg/modelscapi/decisions_delete_request.go"
- "./pkg/modelscapi/decisions_sync_request_item_decisions.go"
- "./pkg/modelscapi/enroll_request.go"
- "./pkg/modelscapi/register_request.go"
- "./pkg/modelscapi/add_signals_request_item_source.go"
- "./pkg/models/success_response.go"
- "./pkg/models/hub_items.go"
- "./pkg/models/alert.go"
- "./pkg/models/metrics_bouncer_info.go"
- "./pkg/models/add_signals_request_item.go"
- "./pkg/models/metrics_meta.go"
- "./pkg/models/metrics_detail_item.go"
- "./pkg/models/add_signals_request_item_decisions_item.go"
- "./pkg/models/hub_item.go"
- "./pkg/models/get_alerts_response.go"
- "./pkg/models/metrics_labels.go"
- "./pkg/models/watcher_auth_request.go"
- "./pkg/models/add_alerts_request.go"
- "./pkg/models/event.go"
- "./pkg/models/decisions_delete_request_item.go"
- "./pkg/models/meta.go"
- "./pkg/models/detailed_metrics.go"
- "./pkg/models/delete_alerts_response.go"
- "./pkg/models/remediation_components_metrics.go"
- "./pkg/models/console_options.go"
- "./pkg/models/topx_response.go"
- "./pkg/models/add_signals_request.go"
- "./pkg/models/delete_decision_response.go"
- "./pkg/models/get_decisions_response.go"
- "./pkg/models/add_signals_request_item_decisions.go"
- "./pkg/models/source.go"
- "./pkg/models/decisions_stream_response.go"
- "./pkg/models/error_response.go"
- "./pkg/models/all_metrics.go"
- "./pkg/models/o_sversion.go"
- "./pkg/models/decision.go"
- "./pkg/models/decisions_delete_request.go"
- "./pkg/models/flush_decision_response.go"
- "./pkg/models/watcher_auth_response.go"
- "./pkg/models/lapi_metrics.go"
- "./pkg/models/watcher_registration_request.go"
- "./pkg/models/metrics_agent_info.go"
- "./pkg/models/log_processors_metrics.go"
- "./pkg/models/add_signals_request_item_source.go"
- "./pkg/models/base_metrics.go"
- "./pkg/models/add_alerts_response.go"
- "./pkg/models/metrics.go"
- "./pkg/protobufs/notifier.pb.go"
- "./pkg/protobufs/notifier_grpc.pb.go"
- "./pkg/database/ent/metric_update.go"
- "./pkg/database/ent/machine_delete.go"
- "./pkg/database/ent/decision_query.go"
- "./pkg/database/ent/meta_query.go"
- "./pkg/database/ent/metric/where.go"
- "./pkg/database/ent/metric/metric.go"
- "./pkg/database/ent/machine_create.go"
- "./pkg/database/ent/alert.go"
- "./pkg/database/ent/event_update.go"
- "./pkg/database/ent/alert_create.go"
- "./pkg/database/ent/alert_query.go"
- "./pkg/database/ent/metric_delete.go"
- "./pkg/database/ent/lock_create.go"
- "./pkg/database/ent/bouncer_update.go"
- "./pkg/database/ent/meta_update.go"
- "./pkg/database/ent/decision_create.go"
- "./pkg/database/ent/configitem_update.go"
- "./pkg/database/ent/machine_query.go"
- "./pkg/database/ent/client.go"
- "./pkg/database/ent/predicate/predicate.go"
- "./pkg/database/ent/lock/where.go"
- "./pkg/database/ent/lock/lock.go"
- "./pkg/database/ent/mutation.go"
- "./pkg/database/ent/migrate/migrate.go"
- "./pkg/database/ent/migrate/schema.go"
- "./pkg/database/ent/configitem.go"
- "./pkg/database/ent/metric_query.go"
- "./pkg/database/ent/event.go"
- "./pkg/database/ent/event_query.go"
- "./pkg/database/ent/lock_update.go"
- "./pkg/database/ent/meta.go"
- "./pkg/database/ent/configitem_query.go"
- "./pkg/database/ent/bouncer.go"
- "./pkg/database/ent/alert_update.go"
- "./pkg/database/ent/meta/meta.go"
- "./pkg/database/ent/meta/where.go"
- "./pkg/database/ent/decision_update.go"
- "./pkg/database/ent/alert_delete.go"
- "./pkg/database/ent/lock.go"
- "./pkg/database/ent/runtime/runtime.go"
- "./pkg/database/ent/alert/alert.go"
- "./pkg/database/ent/alert/where.go"
- "./pkg/database/ent/runtime.go"
- "./pkg/database/ent/bouncer/bouncer.go"
- "./pkg/database/ent/bouncer/where.go"
- "./pkg/database/ent/hook/hook.go"
- "./pkg/database/ent/metric.go"
- "./pkg/database/ent/configitem_create.go"
- "./pkg/database/ent/configitem_delete.go"
- "./pkg/database/ent/tx.go"
- "./pkg/database/ent/decision.go"
- "./pkg/database/ent/lock_delete.go"
- "./pkg/database/ent/decision_delete.go"
- "./pkg/database/ent/machine/where.go"
- "./pkg/database/ent/machine/machine.go"
- "./pkg/database/ent/event_create.go"
- "./pkg/database/ent/metric_create.go"
- "./pkg/database/ent/decision/where.go"
- "./pkg/database/ent/decision/decision.go"
- "./pkg/database/ent/enttest/enttest.go"
- "./pkg/database/ent/lock_query.go"
- "./pkg/database/ent/bouncer_create.go"
- "./pkg/database/ent/event_delete.go"
- "./pkg/database/ent/bouncer_delete.go"
- "./pkg/database/ent/event/event.go"
- "./pkg/database/ent/event/where.go"
- "./pkg/database/ent/machine.go"
- "./pkg/database/ent/ent.go"
- "./pkg/database/ent/meta_create.go"
- "./pkg/database/ent/bouncer_query.go"
- "./pkg/database/ent/meta_delete.go"
- "./pkg/database/ent/machine_update.go"
- "./pkg/database/ent/configitem/configitem.go"
- "./pkg/database/ent/configitem/where.go"
31 changes: 31 additions & 0 deletions .github/generate-codecov-yml.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

# Run this from the repository root:
#
# .github/generate-codecov-yml.sh >> .github/codecov.yml

cat <<EOT
# we measure coverage but don't enforce it
# https://docs.codecov.com/docs/codecov-yaml
codecov:
require_ci_to_pass: false

coverage:
status:
patch:
default:
target: 0%
project:
default:
target: 0%

# if a directory is ignored, there is no way to un-ignore files like pkg/models/helpers.go
# so we make a full list
ignore:
EOT

find . -name "*.go" | while read -r file; do
if head -n 1 "$file" | grep -q "Code generated by"; then
echo " - \"$file\""
fi
done
6 changes: 4 additions & 2 deletions .github/governance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ issue:
3. Check [Releases](https://github.com/crowdsecurity/crowdsec/releases/latest) to make sure your agent is on the latest version.

- prefix: kind
list: ['feature', 'bug', 'packaging', 'enhancement']
list: ['feature', 'bug', 'packaging', 'enhancement', 'refactoring']
multiple: false
author_association:
author: true
Expand All @@ -54,6 +54,7 @@ issue:
@$AUTHOR: There are no 'kind' label on this issue. You need a 'kind' label to start the triage process.
* `/kind feature`
* `/kind enhancement`
* `/kind refactoring`
* `/kind bug`
* `/kind packaging`

Expand All @@ -65,12 +66,13 @@ pull_request:
labels:
- prefix: kind
multiple: false
list: [ 'feature', 'enhancement', 'fix', 'chore', 'dependencies']
list: [ 'feature', 'enhancement', 'fix', 'chore', 'dependencies', 'refactoring']
needs:
comment: |
@$AUTHOR: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.
* `/kind feature`
* `/kind enhancement`
* `/kind refactoring`
* `/kind fix`
* `/kind chore`
* `/kind dependencies`
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/bats-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
GIST_BADGES_ID:
required: true

env:
PREFIX_TEST_NAMES_WITH_FILE: true

jobs:
build:
strategy:
Expand All @@ -36,7 +33,7 @@ jobs:
- name: "Set up Go"
uses: actions/setup-go@v5
with:
go-version: "1.21.6"
go-version: "1.23"

- name: "Install bats dependencies"
env:
Expand All @@ -50,13 +47,13 @@ jobs:
- name: "Run hub tests"
run: |
./test/bin/generate-hub-tests
./test/run-tests test/dyn-bats/${{ matrix.test-file }}
./test/run-tests ./test/dyn-bats/${{ matrix.test-file }} --formatter $(pwd)/test/lib/color-formatter

- name: "Collect hub coverage"
run: ./test/bin/collect-hub-coverage >> $GITHUB_ENV

- name: "Create Parsers badge"
uses: schneegans/dynamic-badges-action@v1.6.0
uses: schneegans/dynamic-badges-action@v1.7.0
if: ${{ github.ref == 'refs/heads/master' && github.repository_owner == 'crowdsecurity' }}
with:
auth: ${{ secrets.GIST_BADGES_SECRET }}
Expand All @@ -67,7 +64,7 @@ jobs:
color: ${{ env.SCENARIO_BADGE_COLOR }}

- name: "Create Scenarios badge"
uses: schneegans/dynamic-badges-action@v1.6.0
uses: schneegans/dynamic-badges-action@v1.7.0
if: ${{ github.ref == 'refs/heads/master' && github.repository_owner == 'crowdsecurity' }}
with:
auth: ${{ secrets.GIST_BADGES_SECRET }}
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/bats-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
required: true
type: string

env:
PREFIX_TEST_NAMES_WITH_FILE: true

jobs:
build:
name: "Functional tests"
Expand Down Expand Up @@ -39,7 +36,7 @@ jobs:
- name: "Set up Go"
uses: actions/setup-go@v5
with:
go-version: "1.21.6"
go-version: "1.23"

- name: "Install bats dependencies"
env:
Expand All @@ -58,7 +55,7 @@ jobs:
MYSQL_USER: root

- name: "Run tests"
run: make bats-test
run: ./test/run-tests ./test/bats --formatter $(pwd)/test/lib/color-formatter
env:
DB_BACKEND: mysql
MYSQL_HOST: 127.0.0.1
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/bats-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ name: (sub) Bats / Postgres
on:
workflow_call:

env:
PREFIX_TEST_NAMES_WITH_FILE: true

jobs:
build:
name: "Functional tests"
Expand Down Expand Up @@ -48,7 +45,7 @@ jobs:
- name: "Set up Go"
uses: actions/setup-go@v5
with:
go-version: "1.21.6"
go-version: "1.23"

- name: "Install bats dependencies"
env:
Expand All @@ -67,7 +64,7 @@ jobs:
PGUSER: postgres

- name: "Run tests (DB_BACKEND: pgx)"
run: make bats-test
run: ./test/run-tests ./test/bats --formatter $(pwd)/test/lib/color-formatter
env:
DB_BACKEND: pgx
PGHOST: 127.0.0.1
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/bats-sqlite-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: (sub) Bats / sqlite + coverage

on:
workflow_call:
secrets:
CODECOV_TOKEN:
required: true

env:
PREFIX_TEST_NAMES_WITH_FILE: true
TEST_COVERAGE: true

jobs:
Expand All @@ -29,7 +31,7 @@ jobs:
- name: "Set up Go"
uses: actions/setup-go@v5
with:
go-version: "1.21.6"
go-version: "1.23"

- name: "Install bats dependencies"
env:
Expand All @@ -41,8 +43,12 @@ jobs:
run: |
make clean bats-build bats-fixture BUILD_STATIC=1

- name: Generate codecov configuration
run: |
.github/generate-codecov-yml.sh >> .github/codecov.yml

- name: "Run tests"
run: make bats-test
run: ./test/run-tests ./test/bats --formatter $(pwd)/test/lib/color-formatter

- name: "Collect coverage data"
run: |
Expand Down Expand Up @@ -77,8 +83,9 @@ jobs:
run: for file in $(find ./test/local/var/log -type f); do echo ">>>>> $file"; cat $file; echo; done
if: ${{ always() }}

- name: Upload crowdsec coverage to codecov
uses: codecov/codecov-action@v3
- name: Upload bats coverage to codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage-bats.out
flags: bats
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/bats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ on:
jobs:
sqlite:
uses: ./.github/workflows/bats-sqlite-coverage.yml
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# Jobs for Postgres (and sometimes MySQL) can have failing tests on GitHub
# CI, but they pass when run on devs' machines or in the release checks. We
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-windows-build-msi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ jobs:
- name: "Set up Go"
uses: actions/setup-go@v5
with:
go-version: "1.21.6"
go-version: "1.23"

- name: Build
run: make windows_installer BUILD_RE2_WASM=1
- name: Upload MSI
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: crowdsec*msi
name: crowdsec.msi
Loading
Loading