{"record":{"id":"c623e81f18e7c193","repo":"crowdsecurity/crowdsec","slug":"appsec-config-or-appsec-config-path-must-be-set","errorCode":null,"errorMessage":"appsec_config or appsec_config_path must be set","messagePattern":"appsec_config or appsec_config_path must be set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/appsec/config.go","lineNumber":90,"sourceCode":"\tif w.config.Path == \"\" {\n\t\tw.config.Path = \"/\"\n\t}\n\n\tif w.config.Path[0] != '/' {\n\t\tw.config.Path = \"/\" + w.config.Path\n\t}\n\n\tif w.config.Mode == \"\" {\n\t\tw.config.Mode = configuration.TAIL_MODE\n\t}\n\n\t// always have at least one appsec routine\n\tif w.config.Routines == 0 {\n\t\tw.config.Routines = 1\n\t}\n\n\tif w.config.AppsecConfig == \"\" && w.config.AppsecConfigPath == \"\" && len(w.config.AppsecConfigs) == 0 {\n\t\treturn errors.New(\"appsec_config or appsec_config_path must be set\")\n\t}\n\n\tif (w.config.AppsecConfig != \"\" || w.config.AppsecConfigPath != \"\") && len(w.config.AppsecConfigs) != 0 {\n\t\treturn errors.New(\"appsec_config and appsec_config_path are mutually exclusive with appsec_configs\")\n\t}\n\n\tif w.config.Name == \"\" {\n\t\tif w.config.ListenSocket != \"\" && w.config.ListenAddr == \"\" {\n\t\t\tw.config.Name = w.config.ListenSocket\n\t\t}\n\n\t\tif w.config.ListenSocket == \"\" {\n\t\t\tw.config.Name = fmt.Sprintf(\"%s%s\", w.config.ListenAddr, w.config.Path)\n\t\t}\n\t}\n\n\treturn nil\n}","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/appsec/config.go#L72-L108","documentation":"Validation guard in UnmarshalConfig (called from Configure): the appsec datasource was given none of appsec_config, appsec_config_path, or appsec_configs. Without at least one appsec config reference there is no ruleset to load, so configuration is rejected outright.","triggerScenarios":"Thrown at pkg/acquisition/modules/appsec/config.go:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set appsec_config to a hub-owned appsec config name (e.g. crowdsecurity/virtual-patching), or appsec_config_path to a local file","Alternatively provide a list under appsec_configs to load several configs","Pick exactly one of the three mechanisms — they are alternatives, not accumulations"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}