crowdsec: allow -t to work if using appsec and allowlists (#3484)

This commit is contained in:
blotus 2025-02-27 14:26:38 +01:00 committed by GitHub
parent 0bdb1f7f27
commit c5f5896625
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 60 additions and 31 deletions

View file

@ -76,3 +76,19 @@ teardown() {
assert_stderr --partial "datasource type missing in $ACQUIS_DIR/journal.yaml (position 0): detected 'source=journalctl'"
assert_stderr --partial "datasource type mismatch in $ACQUIS_DIR/bad.yaml (position 0): found 'docker' but should probably be 'journalctl'"
}
@test "test mode does not fail because of appsec and allowlists" {
rune -0 cscli collections install crowdsecurity/appsec-virtual-patching
cat >"$ACQUIS_DIR/appsec.yaml" <<-EOT
source: appsec
appsec_config: crowdsecurity/virtual-patching
labels:
type: appsec
EOT
config_set '.common.log_level="debug" | .common.log_media="stdout"'
rune -0 "$CROWDSEC" -t --trace
assert_stderr --partial "Configuration test done"
}