Skip to content

Commit d733494

Browse files
committed
update wildcard, fix bug with deprecated webhook_url field
1 parent ba24c19 commit d733494

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

nightfall/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
:license: MIT, see LICENSE for more details.
77
"""
88
from .api import Nightfall
9+
from .alerts import SlackAlert, EmailAlert, WebhookAlert, AlertConfig
910
from .detection_rules import (Regex, WordList, Confidence, ContextRule, MatchType, ExclusionRule, MaskConfig,
1011
RedactionConfig, Detector, LogicalOp, DetectionRule)
1112
from .findings import Finding, Range
1213

13-
__all__ = ["Nightfall", "Regex", "WordList", "Confidence", "ContextRule", "MatchType", "ExclusionRule", "MaskConfig",
14-
"RedactionConfig", "Detector", "LogicalOp", "DetectionRule", "Finding", "Range"]
14+
__all__ = ["Nightfall", "SlackAlert", "EmailAlert", "WebhookAlert", "AlertConfig", "Regex", "WordList", "Confidence",
15+
"ContextRule", "MatchType", "ExclusionRule", "MaskConfig", "RedactionConfig", "Detector", "LogicalOp",
16+
"DetectionRule", "Finding", "Range"]

nightfall/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,13 @@ def _file_scan_scan(self, session_id: str, detection_rules: Optional[List[Detect
230230
if policy_uuid:
231231
data = {"policyUUID": policy_uuid}
232232
else:
233-
data = {"policy": {"webhookURL": webhook_url}}
233+
data = {"policy": {}}
234234
if detection_rule_uuids:
235235
data["policy"]["detectionRuleUUIDs"] = detection_rule_uuids
236236
if detection_rules:
237237
data["policy"]["detectionRules"] = [d.as_dict() for d in detection_rules]
238+
if webhook_url:
239+
data["policy"]["webhookURL"] = webhook_url
238240
if alert_config:
239241
data["policy"]["alertConfig"] = alert_config.as_dict()
240242

0 commit comments

Comments
 (0)