policy 0 is deny
This commit is contained in:
@@ -25,6 +25,22 @@ class RecommendationTests(unittest.TestCase):
|
||||
self.assertIn("4", recommendations[0].related_policy_ids)
|
||||
self.assertIn("https", recommendations[0].related_services)
|
||||
|
||||
def test_policy_zero_is_implicit_deny_not_related_policy(self):
|
||||
events = [
|
||||
parse_log_line(
|
||||
'type=traffic srcip=203.0.113.8 dstip=10.0.0.10 policyid=0 '
|
||||
'service=ssh action=deny severity=warning'
|
||||
)
|
||||
for _ in range(12)
|
||||
]
|
||||
anomalies = detect_source_anomalies(events)
|
||||
|
||||
recommendations = build_recommendations(events, anomalies)
|
||||
|
||||
self.assertEqual(recommendations[0].related_policy_ids, [])
|
||||
self.assertEqual(recommendations[0].title, "Implicit deny/drop traffic observed")
|
||||
self.assertIn("policyid=0", recommendations[0].recommendation)
|
||||
|
||||
def test_threat_intel_disabled_by_default(self):
|
||||
with patch.dict(os.environ, {}, clear=True):
|
||||
client = ThreatIntelClient(cache_file="/tmp/fgai-test-threat-cache.json")
|
||||
|
||||
Reference in New Issue
Block a user