@@ -736,6 +736,7 @@ class SigmaRuleBase:
736736 title : str = ""
737737 id : Optional [UUID ] = None
738738 name : Optional [str ] = None
739+ taxonomy : str = "sigma"
739740 related : Optional [SigmaRelated ] = None
740741 status : Optional [SigmaStatus ] = None
741742 description : Optional [str ] = None
@@ -823,6 +824,25 @@ class instantiation of an object derived from the SigmaRuleBase class and the er
823824 else :
824825 rule_name = rule_name
825826
827+ # Rule taxonomy
828+ rule_taxonomy = rule .get ("taxonomy" , "sigma" )
829+ if rule_taxonomy is not None :
830+ if not isinstance (rule_taxonomy , str ):
831+ errors .append (
832+ sigma_exceptions .SigmaTaxonomyError (
833+ "Sigma rule taxonomy must be a string" , source = source
834+ )
835+ )
836+ else :
837+ if rule_taxonomy == "" :
838+ errors .append (
839+ sigma_exceptions .SigmaTaxonomyError (
840+ "Sigma rule taxonomy must not be empty" , source = source
841+ )
842+ )
843+ else :
844+ rule_taxonomy = rule_taxonomy
845+
826846 # Rule related validation
827847 rule_related = rule .get ("related" )
828848 if rule_related is not None :
@@ -985,6 +1005,7 @@ class instantiation of an object derived from the SigmaRuleBase class and the er
9851005 "title" : rule_title ,
9861006 "id" : rule_id ,
9871007 "name" : rule_name ,
1008+ "taxonomy" : rule_taxonomy ,
9881009 "related" : rule_related ,
9891010 "level" : level ,
9901011 "status" : status ,
0 commit comments