Commit graph

2057 commits

Author SHA1 Message Date
mmetc
bf0a1cc470
cscli: when prompting, use default in case of EOF instead of going for "no" (#3447) 2025-02-05 16:51:34 +01:00
mmetc
362d5dc068
CI: use alpine 3.21 for docker build (#3445) 2025-02-05 16:50:14 +01:00
mmetc
dc28ae58dc
run 'hub upgrade' in rpm/deb postinst, improve hub message (#3440) 2025-02-04 16:51:02 +01:00
mmetc
bfed861ba7
don't ask user to reload systemd service when running in docker (#3434)
* don't ask user to reload systemd service when running in docker

* refactor + give appropriate message if terminal is attached

* remove explicit filetype
2025-01-31 10:15:28 +00:00
blotus
763959fb68
ignore zero value variables for context (#3436) 2025-01-31 10:12:19 +01:00
mmetc
6827f065fa
bucket: avoid crashing on malformed expression (fix #3351) (#3368) 2025-01-30 19:19:57 +01:00
Gilbert Gilb's
5260cf16cc
fix parsing of noncompliant RFC3339 timestamps missing only a timezone (#3346) 2025-01-30 17:14:06 +01:00
Zakhar Bessarab
172d6c6dc6
acquisition/victorialogs: add new datasource (#3310)
* acquisition/victorialogs: add new datasource

Data source supports:
- cat mode with automatic adjustment of poll interval (same as one at Loki datasource)
- tail mode by using tailing API
2025-01-29 16:59:03 +01:00
mmetc
5178a919c8
CI: setup go from version in go.mod (#3432)
this should fix a caching issue with github
2025-01-29 14:10:49 +01:00
mmetc
51f762c6db
CI: package docker tests with uv (#3429) 2025-01-29 10:16:29 +01:00
Laurence Jones
5a37161df2
fix: use CreatedAt instead of StartAt (#3427)
* fix: use CreatedAt instead of StartAt

fix: #3321

* not a ptr
2025-01-27 12:05:26 +00:00
blotus
b2bcf31ed7
use the actual bucket name when checking for simulation mode (#3416) 2025-01-27 11:45:39 +00:00
Thibault "bui" Koechlin
fdd37370b3
appsec: do not attempt to deduplicate native modsec rules (#3347)
* fix #3343

* fix #3350

* fix #3350

---------

Co-authored-by: blotus <sebastien@crowdsec.net>
Co-authored-by: Laurence Jones <laurence.jones@live.co.uk>
2025-01-27 10:11:50 +01:00
mmetc
5b90dfb3c8
use go 1.23.5 (#3419) 2025-01-24 13:45:45 +00:00
srkoster
62308f535c
Removed last_heartbeat update in MachineUpdateBaseMetrics (#3425) 2025-01-23 18:50:31 +01:00
mmetc
4935dc536e
cscli hub: handle freebsd pre-release version numbers (#3423) 2025-01-23 09:29:29 +01:00
blotus
83cb3e9ead
upgrade coraza to latest version (#3417) 2025-01-21 17:27:00 +01:00
Thibault "bui" Koechlin
d0de3c9f5d
README revamp (#3408)
* wip

* attempt #2

* next

* up

* up

* up

* up

* add more feature description

* up

* next iteration

* up
2025-01-21 15:05:12 +00:00
mmetc
1b5514c9e4
wizard: install systemd service file (#3418)
fix previous PR
2025-01-21 13:15:42 +01:00
blotus
29b2252b50
Improve post-installation message (#3407) 2025-01-20 15:57:26 +01:00
mmetc
013fd8b198
remove dependency from github.com/gofrs/uuid (#3406) 2025-01-20 15:01:34 +01:00
mmetc
e1a1b1e565
deb packaging: don't duplicate crowdsec.service if /lib is not linked to /usr/lib (#3415)
We don't need to explicitly copy the file, but the standard location is
/usr/lib, not /lib - hence we must avoid duplicating it by copying explicitly if /lib
is not linked to /usr/lib.

Also we don't need preinst anymore and the message is in postinst as well.
2025-01-20 14:16:01 +01:00
AlteredCoder
d6b3841f13
pkg/cticlient: Add missing field in SmokeItem and FireItem (#3413)
* pkg/cticlient: Add missing field in SmokeItem and FireItem
2025-01-20 11:21:25 +01:00
mmetc
ff9b350e0e
deb build: get version with dpkg-parsechangelog -S (#3405) 2025-01-20 10:31:55 +01:00
mmetc
bd7e1b50c3
cscli: cliconfig - remove global variables and gratuitous pointer (#3414) 2025-01-20 10:30:36 +01:00
Laurence Jones
7d12b806cd
enhance: Log appsec error on writing response to remediation (#3412)
* enhance: Log appsec error on writing response to remediation

* fix: note to self dont write code at midnight
2025-01-18 13:13:46 +01:00
mmetc
49fb24c3b1
lint: enable errcheck; add allowlist and explicit checks (#3403)
* lint: enable errcheck with explicit allow list
* add explicit error checks
* windows tests
* windows nolint
2025-01-16 16:13:10 +01:00
mmetc
fe931af5ca
lint: gocritic/captLocal (don't capitalize local variables) (#3402)
* lint: gocritic/captLocal (don't capitalize local variables)

* lint (whitespace)
2025-01-16 14:03:53 +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
6529215775
CI: golangci-lint 1.63 (#3396) 2025-01-16 13:22:08 +01:00
mmetc
9ef5f58f88
test pkg/exprhelpers: explicit message if the tag "expr_debug" is missing (#3400)
* test pkg/exprhelpers: explicit message if the tag "expr_debug" is missing

* typo

* lint: use build tag expr_debug while linting

* lint
2025-01-15 12:13:54 +01:00
Laurence Jones
cc1196c3ad
fix: #2790 (#3378) 2025-01-14 10:48:05 +00:00
mmetc
5df56844d9
log warning if local items have conflicting names (#3399) 2025-01-13 13:28:48 +01:00
Nathanael Demacon
e9c1ed05d9
feat(cscli): add env variable flag for dashboard setup (#3110)
Signed-off-by: Nathanael DEMACON <quantumsheep@users.noreply.github.com>
Co-authored-by: Nathanael DEMACON <quantumsheep@users.noreply.github.com>
Co-authored-by: Laurence Jones <laurence.jones@live.co.uk>
2025-01-13 09:17:18 +01:00
blotus
303ce8e42c
gin: do not use gin context after returning response (#3398) 2025-01-10 16:00:24 +01:00
blotus
34c0e6a4bd
expand env var when loading acquis (#3375) 2025-01-10 14:57:05 +01:00
mmetc
866b0ad60c
Hubops tests (#3393) 2025-01-07 16:39:32 +01:00
dependabot[bot]
aebe9724f8
build(deps): bump golang.org/x/crypto from 0.26.0 to 0.31.0 (#3381)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.26.0 to 0.31.0.
- [Commits](https://github.com/golang/crypto/compare/v0.26.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-07 11:09:13 +01:00
dependabot[bot]
9dfa74bb52
build(deps): bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1 (#3380)
Bumps [github.com/golang-jwt/jwt/v4](https://github.com/golang-jwt/jwt) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/golang-jwt/jwt/releases)
- [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md)
- [Commits](https://github.com/golang-jwt/jwt/compare/v4.5.0...v4.5.1)

---
updated-dependencies:
- dependency-name: github.com/golang-jwt/jwt/v4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-07 10:24:58 +01:00
mmetc
57d7247a43
cscli hub: refact/split files; add some doc/examples (#3394) 2025-01-06 23:55:39 +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
90f7c56aab
wizard: unattended install w/ new hubops (#3392) 2025-01-02 16:41:11 +01:00
Laurence Jones
f938b0c602
enhancement: Hubtest respect patterndir option set via config.yaml (#3386)
* enhancement: Hubtest respect patterndir option set via config.yaml

* pass patternDir to Run()

---------

Co-authored-by: marco <marco@crowdsec.net>
2025-01-02 14:21:03 +00:00
mmetc
4e6e6dec65
lint: explicit error checks (#3388)
* errcheck: tests
* fflag errcheck
* http_test errcheck (avoid duplicate metric registration)
2025-01-02 12:33:54 +01:00
Laurence Jones
5c0c4f9fa6
enhancement: add logdata to appsec AccumlateTxToEvent (#3383) 2024-12-27 15:20:23 +00:00
mmetc
78f4b85311
pkg/cwhub - refact Downloader (#3382)
* pkg/cwhub - refact Downloader
* single method interfaces
* lint
2024-12-27 11:49:14 +01:00
mmetc
fc17c0c613
lint: replace type assertions and type switch on errors (#3376)
* errorlint: replace type assertions on errors
* errorlint: replace type switch on errors
* lint
2024-12-27 10:40:50 +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
4748720a07
refactor pkg/leakybucket (#3371)
* refact pkg/leakybucket - call LoadBuckets with Item instances
* extract compileScopeFilter()
2024-12-20 14:33:24 +01:00