Skip to content

Commit fb75403

Browse files
committed
strings
1 parent 215117e commit fb75403

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

sigma/processing/conditions/rule.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ def match(
4747
) -> bool:
4848
if isinstance(rule, SigmaRule):
4949
res = (
50-
rule.logsource.category.__str__() == self.logsource.category.__str__()
51-
and rule.logsource.product.__str__() == self.logsource.product.__str__()
52-
and rule.logsource.service.__str__() == self.logsource.service.__str__()
50+
str(rule.logsource.category) == str(self.logsource.category)
51+
and str(rule.logsource.product) == str(self.logsource.product)
52+
and str(rule.logsource.service) == str(self.logsource.service)
5353
)
5454
res = res and self.match_ocsf(rule=rule)
5555
return res
@@ -61,11 +61,10 @@ def match(
6161
return True
6262
return False
6363

64-
def match_ocsf(self, rule: SigmaRule):
65-
res = False
64+
def match_ocsf(self, rule: SigmaRule) -> bool:
6665
rule_ocsf = rule.custom_attributes.get("ocsf")
6766
if rule_ocsf:
68-
res = rule_ocsf["class_uid"].__str__() == self.logsource.custom_attributes["class_uid"]
67+
res = str(rule_ocsf["class_uid"]) == str(self.logsource.custom_attributes["class_uid"])
6968
else:
7069
res = True
7170
return res

0 commit comments

Comments
 (0)