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
Laurence Jones
46e6398868
enhance: Allow the use of 'd' suffix in profiles ( #3594 )
2025-04-29 12:18:06 +01:00
mmetc
620bd0117a
Refact pkg/database/decisions.go ( #3541 )
2025-04-16 11:53:52 +02: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
26c15a1267
refact pkg/database: clean up code and error messages ( #3263 )
...
* refact pkg/database: extract alertfilter.go
* refact pkg/database: extract function rollbackOnError(); dry error messages
2024-12-19 17:01:16 +01:00
mmetc
3945a991bd
context propagation: pkg/database/alerts ( #3252 )
...
* alerts
* drop CTX from dbclient
* lint
* pkg/database/alerts: context.TODO()
* cscli: context.Background() -> cmd.Context()
2024-09-24 14:13:45 +02:00
mmetc
fee3debdcc
context propagation: pkg/database/machines ( #3248 )
2024-09-20 16:00:58 +02:00
mmetc
519693270e
refact: alerts query ( #3216 )
...
* refact alerts: log messages
* refact: AlertPredicatesFromFilter
2024-09-18 15:00:19 +02:00
mmetc
6810b41dd8
refact pkg/database: context propagation (start) ( #3226 )
...
* refact pkg/database: context propagation (part)
* more context propagation (usagemetrics)
* propagate errors when updating metrics
2024-09-12 17:28:16 +02:00
blotus
c4bfdf1991
Store alert remediations status in DB ( #3115 )
2024-07-16 10:08:00 +02:00
mmetc
bd4540b1bf
refactor context (cscli, pkg/database) ( #3071 )
...
* cscli: helper require.DBClient()
* refactor pkg/database: explicit context to dbclient constructor
* lint
2024-06-11 12:13:18 +02:00
mmetc
9e859c0c8c
refactor pkg/database, pkg/models ( #3022 )
...
* pkg/models: Source.String()
* pkg/models: Alert.FormatAsStrings()
* cscli alerts list: sort remediation keys
avoid printing
"ban: ... captcha: ..."
in one line, and
"captcha: ... ban: ..."
in another
* remove unused methods; drop else branch
* lint
2024-06-05 12:01:13 +02:00
mmetc
9101de95d8
pkg/database: refactor & rename "soft delete" to "expire" ( #3025 )
...
* pkg/database: replace parameter with explicit methods
* merge methods with recusion
* rename "soft delete" -> "expire"
* lint
2024-06-04 13:19:46 +02:00
mmetc
91fbc63533
db: review update timestamps, immutable columns ( #2981 )
...
* orm: correct behavior of created_at, updated_at, define immutable fields
* remove updatedefault for last_push, last_heartbeat
* re-generate db schema
* update last_push in CreateAlert()
* lint
2024-05-02 12:56:41 +02:00
Thibault "bui" Koechlin
f4ed7b3520
Truncate meta data ( #2966 )
...
* truncate meta-data if they are too big
2024-04-25 13:43:38 +02:00
mmetc
f75cdeb239
lint: enalble linter "wastedassign" ( #2772 )
2024-01-24 17:31:11 +01:00
mmetc
455acf7c90
lapi/papi: when receiving alerts, log and discard invalid addr/range ( #2708 )
...
https://github.com/crowdsecurity/crowdsec/issues/2687
2024-01-22 12:24:26 +01:00
mmetc
08694adf1b
lint (errorlint) ( #2644 )
2023-12-18 09:35:28 +01:00
Thibault "bui" Koechlin
e4dcdd2572
fix include_capi filter ( #2478 )
2023-09-20 11:56:00 +02:00
Thibault "bui" Koechlin
4c08e1e68c
exclude 'lists' too if we exclude CAPI ( #2474 )
2023-09-19 13:56:22 +02:00
Thibault "bui" Koechlin
0040569fa9
if 'include capi' is false, only exclude capi alerts instead of assuming they necessarily have attached decisions ( #2435 )
2023-09-12 11:19:36 +02:00
mmetc
d45bec4047
minor log message improvements ( #2455 )
2023-09-12 11:04:56 +02:00
mmetc
fd94e2c056
refactor alert/decisions insert/update to avoid database locking in bulk operations ( #2446 )
2023-09-04 14:21:45 +02:00
mmetc
25868f27de
option db_client.decision_bulk_size ( #2440 )
2023-08-25 17:05:17 +02:00
mmetc
e36df40ba7
pkg/types cleanup ( #2398 )
...
* move function GetLineCountForFile from pkg/types to cscli
* move ParseDuration from pkg/types to pkg/database
* remove unused types.Profile, types.RemediationProfile
2023-08-24 09:44:46 +02:00
mmetc
9967d60987
errors.Wrap -> fmt.Errorf ( #2333 )
2023-07-06 10:14:45 +02:00
mmetc
85839b0199
support for stdin with "cscli decision import" and raw values ( #2291 )
...
and remove Origin from the struct, which was ignored anyway
2023-06-27 14:29:42 +02:00
mmetc
8bfeb7d90d
Update go dependencies ( #2293 )
...
- update fatih/color (fix windows issue)
- update mongo-driver (fix build issue)
- go.mod: merge two "require" blocks
- update semver dependency (same version as indirect dep), fix test checks in cscli setup
- remove gotest.tools dependency (use testify, cstest)
- update x/ exp, mod, sys dependencies
2023-06-22 11:31:41 +02:00
mmetc
f7409d47be
fix error message when failing to parse ip address ( #2292 )
...
Co-authored-by: Thibault "bui" Koechlin <thibault@crowdsec.net>
2023-06-21 09:22:25 +02:00
Thibault "bui" Koechlin
8f71edaadd
do not error on this filter ( #2182 )
2023-05-04 13:06:15 +02:00
Thibault "bui" Koechlin
3041023ed8
add an optional flag to disable the fetch ( #2169 )
2023-04-14 11:39:16 +02:00
mmetc
20a1bc7d44
chore: simplify pkg/database/alerts ( #2062 )
2023-02-23 10:25:01 +01:00
mmetc
76ea3a063f
fix message "empty scenario"
2023-02-21 09:59:56 +01:00
Cristian Nitescu
987f119c4b
v3 capi and blocklists links support ( #2019 )
...
* v3 model generation
* v3 model generation
* comms
* fixes after master merge
* missing reader close
* use constants defined for types
---------
Co-authored-by: bui <thibault@crowdsec.net>
2023-02-06 14:06:14 +01:00
Thibault "bui" Koechlin
e927717fa0
Polling API Integration ( #1715 )
...
Co-authored-by: alteredCoder <kevin@crowdsec.net>
Co-authored-by: he2ss <hamza.essahely@gmail.com>
Co-authored-by: Sebastien Blot <sebastien@crowdsec.net>
2023-01-31 14:47:44 +01:00
blotus
b7c4bfd4e3
Use explicit transaction when inserting community blocklist ( #1835 )
2022-10-26 10:48:17 +02:00
blotus
bb2f0e938f
Blocklist: Do not duplicate decisions when pulling ( #1796 )
2022-10-19 15:51:40 +02:00
Thibault "bui" Koechlin
ae6bf39495
support decisions deletion via scenario + alerts delete via ID ( #1798 )
2022-10-19 14:37:27 +02:00
Shivam Sandbhor
74659a82ab
Fast bulk alert delete ( #1791 )
2022-10-07 12:40:30 +02:00
mmetc
9b3be5c2e8
Bulk delete alert optimization ( #1782 )
2022-10-05 17:07:44 +02:00
AlteredCoder
02e0f3c095
Fix event.timestamp pointer usage ( #1621 )
...
* Fix event.timestamp pointer usage
* avoid returning an error when creating alerts if something goes wrong during the parsing
Co-authored-by: Sebastien Blot <sebastien@crowdsec.net>
2022-06-30 17:35:42 +02:00
Thibault "bui" Koechlin
15902dcba6
fix #1615 : cleanup based on heartbeat instead ( #1617 )
2022-06-29 13:21:58 +02:00
mmetc
628d7be1d8
simplify err.Error() to err when used in printf context ( #1603 )
2022-06-22 15:53:53 +02:00
he2ss
3d6f015211
Add duration expr to add duration formula ( #1556 )
...
* add duration expr to add duration formula
2022-06-22 11:29:52 +02:00
Thibault "bui" Koechlin
a6ed08b239
Add alerts and decisions metrics, LAPI and agent timing prom metrics ( #1546 )
2022-06-22 11:14:34 +02:00
mmetc
d71279f023
added flag crowdsec --warning ( #1461 )
2022-06-22 09:38:23 +02:00
mmetc
10585bfecc
enabled linters and fixes for: misspell, predeclared, unconvert, ineffassign, gosimple, govet ( #1595 )
2022-06-16 14:41:54 +02:00
blotus
9c1b78395a
reduce verbosity of TLS auth and FlushAgentsAndBouncers ( #1588 )
2022-06-13 16:08:00 +02:00
Thibault "bui" Koechlin
1c0fe09576
Add support for certificate authentication for agents and bouncers ( #1428 )
2022-06-08 16:05:52 +02:00