add a new mode to enable only appsec checking (#128)

*  add a new mode to enable only appsec checking

* 🍱 fix comments
This commit is contained in:
maxlerebourg
2024-02-06 19:42:28 +01:00
committed by GitHub
parent bd71b58f19
commit 6c183d9231
3 changed files with 14 additions and 4 deletions
+3 -2
View File
@@ -23,6 +23,7 @@ const (
StreamMode = "stream"
LiveMode = "live"
NoneMode = "none"
AppsecMode = "appsec"
HTTPS = "https"
HTTP = "http"
)
@@ -264,8 +265,8 @@ func validateParamsRequired(config *Config) error {
return fmt.Errorf("%v: cannot be less than 1", key)
}
}
if !contains([]string{NoneMode, LiveMode, StreamMode, AloneMode}, config.CrowdsecMode) {
return fmt.Errorf("CrowdsecMode: must be one of 'none', 'live', 'stream' or 'alone'")
if !contains([]string{NoneMode, LiveMode, StreamMode, AloneMode, AppsecMode}, config.CrowdsecMode) {
return fmt.Errorf("CrowdsecMode: must be one of 'none', 'live', 'stream', 'alone' or 'appsec'")
}
if !contains([]string{HTTP, HTTPS}, config.CrowdsecLapiScheme) {
return fmt.Errorf("CrowdsecLapiScheme: must be one of 'http' or 'https'")