612 Commits
Author SHA1 Message Date
blotus 86110eec7f add cscli bot subcommand (#4666) 2026-10-09 10:38:40 +02:00
Thibault "bui" Koechlin 3d25833e78 revamp 'cscli console status' to be all-in-one (#4592) 2026-08-05 10:06:23 +02:00
Roshan Singh 95c854570e cscli lapi register: no error if the credentials file does not exist (#4570)
The lapi command group's PersistentPreRunE loads the API client
credentials before subcommands such as register and status run, so
register failed with "no such file or directory" unless the file it
is meant to create already existed. Skip that requirement for register
when a credentials path is configured, keeping the strict behavior for
subcommands that read the LAPI.

Fixes #4237
2026-07-23 17:46:03 +02:00
Thibault "bui" Koechlin 55dbc4a39d cscli: make hub list more human friendly 2026-07-22 14:44:13 +02:00
blotus 33049dd592 waf: track id/name pairs for all subrules (#4505) 2026-07-22 13:29:19 +02:00
Thibault "bui" Koechlin 66ab61fcfb Islegitimate bot evols (#4561)
* expose metrics in cscli

* associated metrics for ExemptFromChallenge

* tests

* metrics for Exempt

* new helper

* new helper

* up

* make it unspecified if the user didn't supply it

* reduce comments

* comments

* linter
2026-07-15 16:47:49 +02:00
blotus 1f5e9c8dea Waf challenge mode (#4268) 2026-07-01 17:30:50 +02:00
blotus 69090c80cc cscli metrics: don't attempt to create a DB client if there's no DB config (#4451) 2026-05-05 09:35:26 +02:00
blotus 7d4daefa77 cscli: add --quick flag to enroll command (#4350) 2026-04-15 12:02:40 +02:00
blotus b0f524555d Dependencies update (#4412)
- Update to go 1.26
 - Update all dependancies (expect Gin)
 - Replace all `ptr.Of()` usage by `new()`
2026-04-10 16:05:55 +02:00
blotus ac5e6f9708 cscli allowlists: add import command (#4378) 2026-03-23 12:17:44 +01:00
blotus 5eda72214b Add new kind alert attribute (#4351) 2026-03-19 14:36:02 +01:00
Thibault "bui" Koechlin 39f41f94e8 support for waf- alias in cscli (#4347) 2026-03-10 08:53:30 +01:00
mmetc ceb9987a45 pkg/parsers: light refact, remove redundant code (#4213)
* refact LoadParsers, consistent parameters and returns

* remove redundant nil check

* remove redundant assignment

* replace stageidx() function with stdlib
2026-02-23 10:47:18 +01:00
mmetc 6ecd27fd22 cscli: consistent status and usage message for unknown subcommands (#4320)
* cscli: consistent status and usage message for unknown subcommands

* lint/format
2026-02-20 16:44:19 +01:00
mmetc 7f29c376ce clipapi: replace tomb with errgroup (#4207) 2026-02-17 10:45:19 +01:00
mmetc 7b3b044c62 refact: remove unused code in crowdsec-cli, apiserver, acquisition, database (#4304)
* deadcode: remove unused ip helpers in pkg/database

* deadcode: remove unused require.DB from cmd/crowdsec-cli/core

* deadcode: remove unused LogAppsecEvent() from pkg/acquisition/modules/appsec

* deadcode: remove unused createAlertsForDecisions() from pkg/apiserver
2026-02-12 13:40:59 +01:00
mmetc b77ad895aa lint: enable bodyclose (ensure response bodies are closed to avoid leaks) (#4200) 2026-01-19 12:29:36 +01:00
mmetc 4e0cc464cc pkg/acquisition: refact configuration validation and tests (#4187) 2026-01-16 23:20:00 +01:00
mmetc 9ee3a1324a pkg/leakybucket: replace global variables with injected StateDumper (#4197)
* pkg/leakybucket: replace global variables with injected collector

* replace globals StageParse* with injected collector

* remove global bucketOverflows

* group collectors in a StateDumper{}
2026-01-16 13:48:37 +01:00
mmetc 69c0962e10 pkg/acquisition/registry, move datasource registration to avoid dependency (#4189)
* pkg/acquisition/types

* pkg/application/registry

* move datasource registration to pkg/application/modules

* reformat

* move datasource factory & getter

* RegisterTestFactory()

* register datasources for tests too
2026-01-12 11:03:18 +01:00
mmetc 91ffe2e83f extract method finalizeRun() (#4181)
there's no reason for it to be a persistent hook, "run" does not have
subcommands
2026-01-07 21:17:24 +01:00
mmetc 2302ec5fc0 fix typos in function name, error messages, comments (#4154) 2025-12-17 17:21:06 +01:00
mmetc 38051b47b8 lint: forbidigo (no print or printf in production, prefer fprint) (#4141) 2025-12-16 11:07:58 +01:00
mmetc a1aea2ccea CI: avoid using nolint with revive (#4144)
The "nolinlint" checks are flaky with revive checks,
triggering false positives.
So we use revive-specific comments or exclusions in .golangci.yml
2025-12-15 14:22:03 +01:00
mmetc 58c2147769 refact logging configuration; add log_media="syslog" (#4045) 2025-11-26 16:38:20 +01:00
mmetc 2398e7b1db refact cscli: define csconfig.Getter once (#4091) 2025-11-26 10:50:11 +01:00
mmetc f7554cf006 refact load/save apic token: dependencies and sentinel errors (#4081) 2025-11-25 10:07:13 +01:00
mmetc 6a739941dc replace prom2json with native Prometheus parser and context-aware scraping in CLI metrics (#3932)
* deps: update prometheus client

* remove dependency on prom2json

* lint: protogetter
2025-11-21 13:16:59 +01:00
mmetc c9105fac1b refact pkg/acquisition: journalctl configuration (#4057) 2025-11-18 12:32:07 +01:00
mmetc 9662e5fb66 cscli hubtest: better report docker/nuclei errors (#4052)
* cscli hubtest: better report docker/nuclei errors

* lint (print, space)
2025-11-18 11:23:01 +01:00
mmetc ecafe1dfe7 fix 2808: show certificate path in "lapi status" (#4053)
* fix 2808: show certificate path in "lapi status"

* lint (print, space)
2025-11-18 11:13:48 +01:00
mmetc 43abb8014a lint: unused parameters / 2 (#4055)
* lint: unused parameters / 2

* lint (print, spacing)
2025-11-17 16:28:20 +01:00
mmetc 4865e55efd lint: unused parameters (#4049)
* lint: unused parameters

* lint print, spacing
2025-11-14 11:51:13 +01:00
mmetc 6a5e3a088f pkg/acquisition: refact journalctl datasource and unified retry loop (#4023) 2025-11-07 16:03:58 +01:00
mmetc d97ac90981 enable linters: unnecessary-format, unused-receiver (#4001)
* lint: enable revive/unnecessary-format

* config usetesting

* lint: enable revive/unused-receiver

* update complexity metric

* windows build

* cyclomatic

* align struct tags

* lint (use-any)
2025-10-24 16:40:16 +02:00
mmetc 58a9f2b0ff refact: remove unused struct fields and params / 3; enable linter "unused" (#3334)
* lint: configure unused linter
* Remove unused AlertContext.Log field
* unused consoleOptions
* unused isSwarmManager
* unused withCurrentYear - rfc5424 has it by spec
* unused collectionName
* unused notificationConfigsByPluginType
* unused local vars
* unused: windows build
2025-10-24 15:20:08 +02:00
mmetc 298e75b8df lint: nilaway, unnecessary pointers (#3951)
* lint: nilaway

* lint: nilaway, unnecessary pointers

This removes *log.Level from configuration structs and logging
helpers and switches to value log.Level everywhere. It simplifies
defaults and inheritance, removes reliance on ptr.Of, and avoids nil
checks. Uses PanicLevel (natural zero value) as sentinel instead of nil.
2025-10-23 13:51:40 +02:00
mmetc 2f4d0398c7 cscli: allow "support dump" to run without hub index, add --fast option to skip cpu profiling (#3982)
* cscli: allow "support dump" to run without hub index, add --fast option to skip cpu profiling

* log.Info -> fmt.Fprint
2025-10-22 14:15:56 +02:00
mmetc 802a9c2017 lint: restrict some rules, complexity metrics (#3974)
* error check

* reduce max line length

* reduce max complexity

* comments
2025-10-17 11:49:46 +02:00
mmetc a76774b554 lint: unused-receiver / 1 (#3975) 2025-10-17 11:27:26 +02:00
mmetc f61c574411 cscli: move some packages to core/ (#3949) 2025-10-16 21:54:45 +02:00
mmetc 259d0f2e6e cscli: fix hubtest coverage (#3969) 2025-10-15 10:05:27 +02:00
Thibault "bui" Koechlin fee50b811c cscli hubtest --appsec : Bail when we cannot invoke nuclei (#3798) 2025-10-10 15:29:59 +02:00
mmetc 83d4a7a3da refact: remove unused struct fields / 2 (#3946) 2025-10-03 11:49:20 +02:00
mmetc 0f46930063 make: support CROWDSEC_API_DEV_ENV (#3931)
* make: support CROWDSEC_API_DEV_ENV

* lint
2025-10-02 13:47:07 +02:00
mmetc 5476977ee1 refact pkg/parser: extract RuntimeGrokPattern (#3916) 2025-09-26 12:10:25 +02:00
mmetc 7747b9ca96 refact pkg/parser: ExtraField / Static (#3913)
* refact parser: rename ExtraField -> Static

* refact parser: split Static - RuntimeStatic

* refact parser: extract RuntimeStatic.Apply()

* lint
2025-09-24 21:56:11 +02:00
mmetc bca0483f05 lint: fix nilaway warnings (part 11) (#3910) 2025-09-24 15:54:41 +02:00
mmetc ce984cd48d lint: errcheck (#3912) 2025-09-24 15:52:34 +02:00