File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " pySigma-validators-sigmahq"
3- version = " 0.12.0 "
3+ version = " 0.12.1 "
44description = " pySigma SigmaHQ validators"
55authors = [" François Hubaut <frack113@users.noreply.github.com>" ]
66license = " LGPL-2.1-only"
Original file line number Diff line number Diff line change @@ -238,8 +238,15 @@ class SigmahqUnknownFieldValidator(SigmaRuleValidator):
238238 def validate (self , rule : SigmaRuleBase ) -> List [SigmaValidationIssue ]:
239239 if len (rule .custom_attributes ) > 0 :
240240 custom_keys = list (rule .custom_attributes .keys ())
241- if "regression_tests_path" not in custom_keys or "simulation" not in custom_keys :
242- return [SigmahqUnknownFieldIssue ([rule ], custom_keys )]
241+ allowed_fields = {"regression_tests_path" , "simulation" }
242+
243+ # Find any custom attributes that are not in the allowed list
244+ unknown_fields = [key for key in custom_keys if key not in allowed_fields ]
245+
246+ if unknown_fields :
247+ return [SigmahqUnknownFieldIssue ([rule ], unknown_fields )]
248+ else :
249+ return []
243250 else :
244251 return []
245252
You can’t perform that action at this time.
0 commit comments