Commit graph

2113 commits

Author SHA1 Message Date
robigan
505ad36dfd
Fix spelling mistake in metrics.go (#3618)
Some checks are pending
Tests / sqlite (push) Waiting to run
Tests / mariadb (push) Waiting to run
Tests / mysql (push) Waiting to run
Tests / postgres (push) Waiting to run
Tests / hub (push) Waiting to run
Release Drafter / update_release_draft (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
Test Docker images / test_flavor (debian) (push) Waiting to run
Test Docker images / test_flavor (slim) (push) Waiting to run
Go tests (windows) / Build + tests (push) Waiting to run
Build / Build + tests (push) Waiting to run
(push-master) Publish latest Docker images / dev-alpine (push) Waiting to run
(push-master) Publish latest Docker images / dev-debian (push) Waiting to run
2025-05-09 16:43:15 +02:00
mmetc
627eb352f1
CI: update codecov list and fix workflow (#3617) 2025-05-09 13:58:58 +02:00
mmetc
9510146780
update expr to 1.17.2 (#3519)
* update expr to 1.17.2

* add if test

---------

Co-authored-by: Sebastien Blot <sebastien@crowdsec.net>
2025-05-09 12:55:01 +02:00
mmetc
ce6018fbbf
config.yaml: make config_dir and notification_dir optional (#3606)
Some checks are pending
Tests / sqlite (push) Waiting to run
Tests / mariadb (push) Waiting to run
Tests / mysql (push) Waiting to run
Tests / postgres (push) Waiting to run
Tests / hub (push) Waiting to run
Release Drafter / update_release_draft (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
Test Docker images / test_flavor (debian) (push) Waiting to run
Test Docker images / test_flavor (slim) (push) Waiting to run
Go tests (windows) / Build + tests (push) Waiting to run
Build / Build + tests (push) Waiting to run
(push-master) Publish latest Docker images / dev-alpine (push) Waiting to run
(push-master) Publish latest Docker images / dev-debian (push) Waiting to run
2025-05-09 10:58:12 +02:00
mmetc
ec553b34ad
use go 1.24.3 (#3612) 2025-05-09 10:26:38 +02:00
Manuel Sabban
341e816a5c
fix(apiserver): ensure nil is returned after setting token and expiration and before we reauthenticate (#3613) 2025-05-07 17:02:04 +02:00
Micha Cassola
5484cc2044
Fix cp -n (#3483)
* Fix cp -n

* Don't rely on cp for file existence check

* Busybox cp can be used now

* test -s -> test -f

* test -f -> test -e

---------

Co-authored-by: marco <marco@crowdsec.net>
2025-05-07 14:15:54 +02:00
mmetc
31b914512a
refact pkg/database: unnecessary pointers (#3611)
* refact pkg/database: unnecessary pointers

* lint
2025-05-07 11:12:27 +02:00
mmetc
73a423034f
CI: update action for generating docker description (#3559) 2025-05-07 10:45:34 +02:00
Manuel Sabban
e6b85b641c
feat(apic): add ApicAuth client and token re-authentication logic (#3522) 2025-05-06 16:23:56 +02:00
mmetc
3b9130469c
refact pkg/parser: extract method, avoid calling defer in loop (#3564) 2025-05-06 16:11:24 +02:00
mmetc
15dcbdeec9
refact: remove unused metod DeleteDecisionsWithFilter() (#3605) 2025-05-06 16:10:18 +02:00
mmetc
0e8b557402
refact alert, decision filters: remove unnecessary pointers (#3607) 2025-05-06 15:34:50 +02:00
mmetc
4527ad0fa8
CI: update lint complexity thresholds (#3608) 2025-05-06 15:15:31 +02:00
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
d10067e772
refactor pkg/database/Client.createAlertChunk() (#3585) 2025-05-02 14:12:00 +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
54571d1688
refact cscli: hub item - pointer receiver for consistency (#3595) 2025-05-01 23:04:42 +02:00
mmetc
dafc9c3076
CI: correct uv.lock path (#3596) 2025-04-30 23:24:33 +02:00
mmetc
0a9e6ddd4f
CI: remove obsolete reference to directory dyn-bats (#3600) 2025-04-30 23:23:49 +02:00
David
8949309223
Fix monitorNewFiles for NFS + Remove dead tails from tail map (#3508)
* xx

* xx

* Tests

* fix tests

* XX

* Fix race condition in TestLiveAcquisition implementation

* Better comments for IsTailing and RemoveTail

* lint

* linter

* unmarshal DiscoveryPollInterval to time.Duration

* []byte -> string

* prefer void assignment to nolint

* extract method, add test

* excludedByRE() -> isExcluded()

* fix windows test

* fix regression - tail files from the end if they are detected when the application starts

---------

Co-authored-by: marco <marco@crowdsec.net>
2025-04-30 15:05:17 +02:00
dependabot[bot]
582a192c1e
build(deps): bump golang.org/x/net from 0.37.0 to 0.38.0 (#3581)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.37.0 to 0.38.0.
- [Commits](https://github.com/golang/net/compare/v0.37.0...v0.38.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: blotus <sebastien@crowdsec.net>
2025-04-30 14:45:57 +02:00
Laurence Jones
764deee1c0
enhance: add listen_socket to http acquisition (#3499)
* enhance: add listen_socket to http acquisition

* wrap error for long socket path

* enhance: Cancel early go routines if config is emtpy and add a socket test

* enhance: use temp dir for socket tests

* enhance: use mktemp instead of hardcoding

* enhance: mr linter pls be happy with me

---------

Co-authored-by: marco <marco@crowdsec.net>
2025-04-29 17:19:10 +01:00
Laurence Jones
46e6398868
enhance: Allow the use of 'd' suffix in profiles (#3594) 2025-04-29 12:18:06 +01: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
f9417971d0
enable codeql for python (#3545) 2025-04-29 11:24:30 +02:00
mmetc
2002b8da85
update golangci-lint (#3590) 2025-04-29 11:24:01 +02:00
blotus
a79b92f280
make CTI client available in cscli notifications (#3591) 2025-04-28 18:13:53 +02:00
mmetc
5bc2b49387
allowlists: check during bulk decision import (#3588) 2025-04-28 17:11:17 +02:00
mmetc
8689783ade
refact: pkg/exprhelpers/debugger, convert switch to function dispatch (#3587) 2025-04-24 11:27:45 +02:00
mmetc
418a27596e
lint/gocritic: enable importShadow, typeUnparen, unnecessaryDefer (#3583) 2025-04-24 11:12:38 +02:00
mmetc
34e306505c
refact pkg/database: dry decision count (#3586) 2025-04-24 10:25:48 +02:00
mmetc
d46cef1bcb
refact parser Init: argument types (#3578)
* refact parser Init: argument types
* lint
* tests
* rename struct field; drop redundant nil check
2025-04-23 21:30:03 +02:00
mmetc
7c4e91d304
tests: refact localtest helper, use testify.suite (#3574) 2025-04-17 17:35:28 +02:00
mmetc
7396a103d0
refact: logrus.GetLevel() -> logrus.IsLevelEnabled() (#3579) 2025-04-17 17:35:09 +02:00
mmetc
a0fab0ac5a
fix: avoid possible race condition while compiling expressions (#3582) 2025-04-17 17:34:40 +02:00
blotus
4004868245
fix mysql client certificate support (#3575) 2025-04-16 14:39:26 +02:00
mmetc
7e280b23af
fix: error check on postoverflow config (#3576)
* fix error check on postoverflow config

* lint
2025-04-16 13:15:12 +02:00
mmetc
922c29983f
test: add cold log event assert (#3577) 2025-04-16 12:37:50 +02:00
mmetc
620bd0117a
Refact pkg/database/decisions.go (#3541) 2025-04-16 11:53:52 +02:00
mmetc
c17d42278f
replace go-acc, richgo with gotestsum (#3567) 2025-04-14 16:21:32 +02:00
mmetc
89761938c7
pkg/hubtest: use os.CopyFS() (#3539) 2025-04-04 14:54:22 +02:00
mmetc
faa5b482f6
lint/refactor: defer, reflectvaluecompare, stylecheck (#3544)
* lint: enable reflectvaluecompare
* lint: remove exception
* lint: stylecheck ST016 - methods on the same type should have the same receiver name
* lint: enable revive[time-equal]
2025-04-04 14:52:45 +02:00
blotus
48e3c8c5d4
do not return an error if we cannot fetch allowlists when starting the appsec (#3550) 2025-04-04 14:44:18 +02:00
mmetc
49927f79a1
CI: golangci-lint v2 (#3558)
* golangci-lint v2

* CI: reduce parallel jobs for hubtests
2025-04-03 16:57:56 +02:00
mmetc
6c507604b1
hubtests: correct basename check in parser tests (#3557) 2025-04-03 12:56:19 +02:00
AlteredCoder
78a6179566
Support WithUserAgent in cti client (#3542) 2025-03-31 14:44:51 +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