@@ -235,7 +235,6 @@ class Macsecurityrule(BaseModelWithAccessors):
235235 Attributes:
236236 title (str): The title of the security rule.
237237 rule_id (str): Unique identifier for the rule.
238- severity (str): Severity level of the rule.
239238 discussion (str): Detailed discussion or rationale for the rule.
240239 references (References): Reference information (e.g., NIST, CIS) associated with the rule.
241240 odv (dict[str, Any] | None): Organizational Defined Values for the rule, if applicable.
@@ -255,7 +254,7 @@ class Macsecurityrule(BaseModelWithAccessors):
255254 os_version: float = Field(default_factory=float)
256255 check (str): The commands to evaluate the state of a rule.
257256 fix: (str): The commands to remediate and set the configuration for a rule.
258- severity: (dict[ str, Any] ): The category for impact assigned to a rule for associated benchmarks.
257+ severity: (str): The category for impact assigned to a rule for associated benchmarks.
259258 default_state: (str): The command to restore the system to the default configuration for a rule.
260259
261260 Class Methods:
@@ -300,7 +299,7 @@ class Macsecurityrule(BaseModelWithAccessors):
300299 os_version : float = Field (default_factory = float )
301300 check : str | None = None
302301 fix : str | None = None
303- severity : dict [ str , Any ] | None = None
302+ severity : str | None = None
304303 default_state : str | None = None
305304
306305 @classmethod
@@ -361,7 +360,7 @@ def load_rules(
361360 default_state_value : str | None = None
362361 mechanism : str = "Manual"
363362 payloads : list [Mobileconfigpayload ] | None = []
364- severity : dict [ str , Any ] | None = {}
363+ severity : str | None = None
365364 tags : list [str ] = []
366365
367366 rule_file = next (
@@ -502,8 +501,8 @@ def load_rules(
502501 if benchmarks :
503502 for benchmark in benchmarks :
504503 name = benchmark .get ("name" )
505- if "severity" in benchmark :
506- severity [ name ] = benchmark [ "severity" ]
504+ if "severity" in benchmark and name == parent_values :
505+ severity = benchmark . get ( "severity" , "" )
507506
508507 match tags :
509508 case "inherent" :
0 commit comments