Skip to content

Commit df704f3

Browse files
author
Dan Hertz
committed
fix detection rule name
1 parent a9004f8 commit df704f3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nightfall/detection_rules.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,10 @@ class DetectionRule:
247247
"""
248248
detectors: List[Detector]
249249
logical_op: LogicalOp = LogicalOp.ANY
250-
name: str = ""
250+
name: Optional[str] = None
251251

252252
def as_dict(self):
253-
return {"detectors": [d.as_dict() for d in self.detectors], "logicalOp": self.logical_op.value}
253+
result = {"detectors": [d.as_dict() for d in self.detectors], "logicalOp": self.logical_op.value}
254+
if self.name:
255+
result["name"] = self.name
256+
return result

0 commit comments

Comments
 (0)