feat: always notify agent.lifecycle via SAC with telegram_via routing

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
PTah
2026-05-31 12:25:48 +10:00
parent 3d4d1f3c76
commit 366a9c83f7
6 changed files with 160 additions and 2 deletions
+23
View File
@@ -87,6 +87,29 @@ def test_event_telegram_includes_sac_source_for_sac_daily_report():
assert "📡 Оповещение: SAC (Security Alert Center)" in text
def test_lifecycle_started_template():
host = Host(hostname="WIN01", display_name="K6A-DC3", os_family="windows")
event = Event(
event_id="00000000-0000-4000-8000-000000000505",
host_id=1,
host=host,
occurred_at=datetime(2026, 5, 29, 9, 0, tzinfo=timezone.utc),
category="agent",
type="agent.lifecycle",
severity="info",
title="started",
summary="Мониторинг запущен",
details={"lifecycle": "started", "trigger": "boot", "telegram_via": "sac"},
payload={"source": {"product": "rdp-login-monitor", "product_version": "1.2.30-SAC"}},
)
text = format_event_telegram_html(event)
assert "Агент запущен" in text
assert "K6A-DC3" in text
assert "1.2.30-SAC" in text
assert "загрузка ОС" in text
assert "📡 Оповещение: агент" in text
def test_rdp_shadow_control_template():
host = Host(hostname="RDS01", display_name="RDS Farm", ipv4="10.0.0.5", os_family="windows")
event = Event(