{"record":{"id":"2486f31132dba5a2","repo":"crowdsecurity/crowdsec","slug":"no-appsec-config-provided","errorCode":null,"errorMessage":"no appsec_config provided","messagePattern":"no appsec_config provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/appsec/config.go","lineNumber":265,"sourceCode":"\t\t}\n\t} else if w.config.AppsecConfig != \"\" || len(w.config.AppsecConfigs) > 0 {\n\t\tentries := w.config.AppsecConfigs\n\t\tif w.config.AppsecConfig != \"\" {\n\t\t\tentries = []string{w.config.AppsecConfig}\n\t\t}\n\n\t\tnames, err := resolveAppsecConfigEntries(entries, w.hub)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor _, name := range names {\n\t\t\tif err := appsecCfg.Load(name, w.hub); err != nil {\n\t\t\t\treturn fmt.Errorf(\"unable to load appsec_config: %w\", err)\n\t\t\t}\n\t\t}\n\t} else {\n\t\treturn errors.New(\"no appsec_config provided\")\n\t}\n\n\t// Now we can set up the logger\n\tappsecCfg.SetUpLogger()\n\n\tappsecRuntime, err := appsecCfg.Build(ctx, w.hub)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to build appsec_config: %w\", err)\n\t}\n\n\tif appsecRuntime.NeedWASMVM {\n\t\tlogger.Info(\"Initializing WASM runtime for challenge obfuscation\")\n\n\t\tchallengeOpts, err := challenge.BuildOptions(appsecCfg.Challenge, appsecCfg.Logger)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to build challenge options: %w\", err)\n\t\t}\n","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/appsec/config.go#L247-L283","documentation":"The appsec datasource must be given at least one appsec_config (name referencing a hub item, or inline config). Configure() fails when the parsed YAML contains no appsec_config entries at all — the runtime cannot build the AppSec rules engine without one.","triggerScenarios":"appsec acquisition config missing the appsec_config key, or providing it with an empty/null value or an empty list, so the else branch errors out.","commonSituations":"Minimal appsec listener config without rules; typo like appsec_configs or appsec-config; an emptied-out config after removing all hub collections.","solutions":["Add appsec_config: [crowdsecurity/appsec-defaults] (or your own config names) to the appsec datasource config","Fix the key name/typo and ensure it's a non-empty list","Install the referenced appsec configs from the hub with cscli hub update && cscli hub install"],"exampleFix":"// before\nsource: appsec\nlisten_addr: 127.0.0.1:7422\n// after\nsource: appsec\nlisten_addr: 127.0.0.1:7422\nappsec_config:\n  - crowdsecurity/appsec-defaults","handlingStrategy":"validation","validationCode":"if len(cfg.AppsecConfigs) == 0 { return errors.New(\"appsec datasource requires at least one appsec_config\") }","typeGuard":null,"tryCatchPattern":"if err := src.Configure(ctx, yaml, logger, lvl); err != nil {\n    if strings.Contains(err.Error(), \"no appsec_config\") { /* add appsec_config entry */ }\n    return err\n}","preventionTips":["Always list at least crowdsecurity/appsec-defaults under appsec_config","Install required hub collections before enabling the appsec datasource","Use cscli to validate hub items referenced by name exist"],"tags":["appsec","configuration","hub","yaml"],"backgroundTag":"missing-required-config","analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}