{"record":{"id":"116f32f6cc2f40e7","repo":"crowdsecurity/crowdsec","slug":"unknown-zone-s","errorCode":null,"errorMessage":"unknown zone '%s'","messagePattern":"unknown zone '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/appsec/appsec_rule/modsecurity.go","lineNumber":326,"sourceCode":"\n\tr.WriteString(\"SecRule \")\n\n\tzonePrefix := \"\"\n\tvariablePrefix := \"\"\n\n\thasCount := slices.Contains(rule.Transform, \"count\")\n\tif hasCount {\n\t\tzonePrefix = \"&\"\n\t}\n\n\tfor idx, zone := range rule.Zones {\n\t\tif idx > 0 {\n\t\t\tr.WriteByte('|')\n\t\t}\n\n\t\tmappedZone, ok := zonesMap[zone]\n\t\tif !ok {\n\t\t\treturn \"\", fmt.Errorf(\"unknown zone '%s'\", zone)\n\t\t}\n\n\t\tif len(rule.Variables) == 0 {\n\t\t\tr.WriteString(mappedZone)\n\t\t} else {\n\t\t\tfor j, variable := range rule.Variables {\n\t\t\t\tif j > 0 {\n\t\t\t\t\tr.WriteByte('|')\n\t\t\t\t}\n\n\t\t\t\tr.WriteString(fmt.Sprintf(\"%s%s:%s%s\", zonePrefix, mappedZone, variablePrefix, variable))\n\t\t\t}\n\t\t}\n\t}\n\n\tr.WriteByte(' ')\n\n\tif rule.Match.Type != \"\" {","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/appsec/appsec_rule/modsecurity.go#L308-L344","documentation":"While serializing a custom appsec rule to modsecurity syntax, a zone name in rule.Zones was not found in zonesMap (the fixed zone→SecRule variable mapping). The zone string comes from the rule YAML and is invalid or misspelled.","triggerScenarios":"Thrown at pkg/appsec/appsec_rule/modsecurity.go:326 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the zone name in the custom rule to one of the documented appsec zones (path, method, query, headers, body, ...)","Check the installed crowdsec version's zone list — newer zones may not exist on old versions"],"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"}