Commit graph

1786 commits

Author SHA1 Message Date
Laurence Jones d1bfaddb69
[Plugin] Pass down ctx and use it (#2626)
* Pass down cancellable context and update http plugin

* Use context where we can
2023-12-04 12:05:26 +00:00
Laurence Jones bfc92ca1c5
[Explain] Ignore blank lines as crowdsec will anyways (#2630)
* Ignore blank lines within file and stdin

* change cleanup to be persistent postrun so if we exit early it always cleans

* When using log flag we should add a newline so we know where EOF is

* Inverse the check for log line since we dont want to modify the line itself

* Wrap run explain with a function that returns the error after cleaning up

* Wrap run explain with a function that returns the error after cleanup

* Use a defer iif instead of global var

* Add invalid len input to err count so it more obvious what is happening

---------

Co-authored-by: Manuel Sabban <github@sabban.eu>
2023-12-04 11:48:12 +00:00
Sebastien Blot 3d3bf0bb0e
lint 2023-12-04 11:46:01 +01:00
Sebastien Blot 393a8b8ef5
linting 2023-12-04 11:31:31 +01:00
Sebastien Blot 2a920124fe
return an error if a custom rule has both and and or 2023-12-04 11:08:58 +01:00
Laurence Jones ed3d501081
[Metabase] QOL Changes and chown wal files (#2627)
* Add detection sqlie wal for dashboard chown

* Lean it down a little

* Change to for loop with extensions

* Keep existing uid on files incase user is running as a unpriviledge user

* I have no idea 🤷

* Exclude dash.go and update windows

* Update

* Renam

* Remove the os check since we no longer get to this stage for those os's

---------

Co-authored-by: Manuel Sabban <github@sabban.eu>
2023-12-04 10:06:41 +00:00
Sebastien Blot 60faeaa7d7
add post_eval hook 2023-12-04 10:29:14 +01:00
Sebastien Blot d9355e8c3a
fix hubtest for waap 2023-12-04 10:07:16 +01:00
blotus 872e218b31
Merge branch 'master' into coraza_poc_acquis 2023-12-04 10:00:10 +01:00
bui 17cfc9909e add request dumper with filters 2023-12-04 09:45:47 +01:00
bui 410e36e6a3 Merge branch 'coraza_poc_acquis' of github.com:crowdsecurity/crowdsec into coraza_poc_acquis 2023-12-04 09:45:28 +01:00
Sebastien Blot 7e1fd33c7e
enable expr debugging for hooks 2023-12-01 14:20:36 +01:00
bui 1ffece8872 Merge branch 'coraza_poc_acquis' of github.com:crowdsecurity/crowdsec into coraza_poc_acquis 2023-12-01 14:13:02 +01:00
bui 3836780d90 up 2023-12-01 14:12:57 +01:00
Sebastien Blot 68148e031c
add evt to on_match hoks 2023-12-01 14:04:18 +01:00
Sebastien Blot a258cc0b4a
default waap path to / 2023-12-01 13:22:44 +01:00
Sebastien Blot 1eab34eb3f
send event for in-band match 2023-12-01 11:16:01 +01:00
mmetc 7e5ab344a2
command "cscli hub types" (#2632)
* Command "cscli hub types"; de-duplicate test/bin/preload-hub-items
* don't export Hub.Items -> hub.items
2023-12-01 09:36:38 +01:00
Sebastien Blot 0cd2a2da20
fix http code and remediation 2023-11-30 16:45:26 +01:00
Sebastien Blot 008480420c
typo 2023-11-30 16:28:52 +01:00
Sebastien Blot 4b7b138be7
Merge branch 'master' into coraza_poc_acquis 2023-11-29 22:02:51 +01:00
Sebastien Blot eed9ff0c46
up 2023-11-29 22:02:38 +01:00
Sebastien Blot 5f254769ae
up 2023-11-29 17:45:06 +01:00
Sebastien Blot fe005f87e5
up 2023-11-29 16:52:24 +01:00
Sebastien Blot b31d48a797
rename headers 2023-11-29 16:23:49 +01:00
Sebastien Blot 8999154f76
up 2023-11-29 12:58:45 +01:00
Cristian Nitescu 7c5cbef51a
manage force_pull message for one blocklist (#2615)
* manage force_pull message for one blocklist

* fix info message on force pull blocklist
2023-11-29 11:37:46 +01:00
mmetc 6b0bdc5eeb
Refact pkg/cwhub: fix some known issues and reorganize files (#2616)
* bump gopkg.in/yaml.v3
* test: cannot remove local items with cscli
* test dangling links
* test: cannot install local item with cscli
* pkg/cwhub: reorg (move) functions in files
* allow hub upgrade with local items
* data download: honor Last-Modified header
* fatal -> warning when attempting to remove a local item (allows remove --all)
* cscli...inspect -o yaml|human: rename remote_path -> path
* Correct count of removed items
Still no separate counter for the --purge option, but should be clear enough
2023-11-28 23:51:51 +01:00
mmetc 1aa4fc5949
CI: avoid pipe in makefile, correctly report error in CI when tests fail (#2621)
so we don't assume bash+pipefail for the makefile
2023-11-28 17:10:44 +01:00
blotus 380cbf70a9
force rfc 3339 date format in metrics push (#2402) 2023-11-28 16:30:20 +01:00
alteredCoder 5ca2ee2f2e update 2023-11-28 15:10:32 +01:00
Laurence Jones 05c1825622
Add to dump after postoverflow so we can test within hubtest (#2511)
Co-authored-by: Thibault "bui" Koechlin <thibault@crowdsec.net>
2023-11-28 13:18:41 +00:00
Laurence Jones 6a61b919e7
[cscli] notifications test command and slight re write (#2391)
* Merge main and apply stash

* Rework some of cscli notif stuff and add a generic test which works with non active profiles

* Update wording

* Fix merge

* Final version

* Cleanup
2023-11-28 13:17:54 +00:00
alteredCoder 3683a7a02a up 2023-11-28 11:05:29 +01:00
alteredCoder 3eb272c4e0 Add metrics 2023-11-28 10:15:12 +01:00
Sebastien Blot d851490790
up 2023-11-27 13:41:00 +01:00
Sebastien Blot dc39866250
merge from master 2023-11-27 13:34:22 +01:00
Sebastien Blot e7505f5b2e
up 2023-11-27 13:14:40 +01:00
Sebastien Blot b1653aea63
up 2023-11-27 10:43:32 +01:00
mmetc 15542b78fb
refact BulkDeleteDecisions (#2308)
Code cleanup and de-duplication.
2023-11-26 22:30:03 +01:00
mmetc b164373997
update dependencies: k8s apiserver, docker and related (#2476) 2023-11-24 16:20:39 +01:00
Sebastien Blot 946fbbb8a2
up 2023-11-24 15:57:49 +01:00
mmetc ffcab0b2bc
Refactor hub management and cscli commands (#2545) 2023-11-24 15:57:32 +01:00
mmetc 32e9eb4be4
Minor dependency updates (#2505)
* update AlecAivazis/survey
* update Masterminds/semver
* update Masterminds/sprig
* update alexliesenfeld/health
* update golang.org/x/net
2023-11-24 15:30:54 +01:00
mmetc 76d4bc7788
cscli bouncers: increase key size, deprecate and ignore --length option (#2531)
the switch to base64 made the keys shorter (24 characters), this PR increases their size to 32 bytes, 42 chars once encoded

Also deprecate the --length option, users can already provide a key
2023-11-24 15:01:13 +01:00
mmetc ec199162dc
iso8601: use yyyy-mm-dd in log timestamps instead of dd-mm-yyyy (#2564)
Co-authored-by: Thibault "bui" Koechlin <thibault@crowdsec.net>
2023-11-24 14:59:28 +01:00
Thibault "bui" Koechlin 1dcf9d1ae1
Improved expr debugger (#2495)
* new expr debugger

---------

Co-authored-by: mmetc <92726601+mmetc@users.noreply.github.com>
2023-11-24 11:10:54 +01:00
Sebastien Blot f77d9e043a
up 2023-11-23 14:51:05 +01:00
mmetc 7ffa0cc787
docker: replace cp -an with rsync to allow bind-mount of files in /etc/crowdsec (#2611)
fix for https://github.com/crowdsecurity/crowdsec/issues/2480
2023-11-23 11:08:14 +01:00
blotus ec53c672dc
Kafka acquisition: warn if no consumer group id and allow to read from a specific partition (#2612) 2023-11-23 10:02:53 +01:00