{"record":{"id":"5735a443da24ea13","repo":"crowdsecurity/crowdsec","slug":"unknown-rule-format-s","errorCode":null,"errorMessage":"unknown rule format '%s'","messagePattern":"unknown rule format '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/appsec/appsec_rule/appsec_rule.go","lineNumber":69,"sourceCode":"func (v *CustomRule) Convert(ruleType string, appsecRuleName string, appsecRuleDescription string, ruleIndex int) (string, []uint32, error) {\n\tif v.Zones == nil && v.And == nil && v.Or == nil {\n\t\treturn \"\", nil, errors.New(\"no zones defined\")\n\t}\n\n\tif v.Match.Type == \"\" && v.And == nil && v.Or == nil {\n\t\treturn \"\", nil, errors.New(\"no match type defined\")\n\t}\n\n\tif v.Match.Value == \"\" && v.And == nil && v.Or == nil {\n\t\treturn \"\", nil, errors.New(\"no match value defined\")\n\t}\n\n\tswitch ruleType {\n\tcase ModsecurityRuleType:\n\t\tr := ModsecurityRule{}\n\t\treturn r.Build(v, appsecRuleName, appsecRuleDescription, ruleIndex)\n\tdefault:\n\t\treturn \"\", nil, fmt.Errorf(\"unknown rule format '%s'\", ruleType)\n\t}\n}\n","sourceCodeStart":51,"sourceCodeEnd":72,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/appsec/appsec_rule/appsec_rule.go#L51-L72","documentation":"CustomRule.Convert was called with a ruleType that does not match any known converter (only the modsecurity rule type is registered). The custom appsec rule's declared format is unrecognized, so it cannot be translated into a native rule.","triggerScenarios":"Thrown at pkg/appsec/appsec_rule/appsec_rule.go:69 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the rule's format field — custom appsec rules currently only support the modsecurity format","Remove or disable the malformed rule from the appsec config or hub collection"],"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-14T00:17:10.932Z"}