feat(smtp_relay): ingest probe_forwarded as probe_relay bounty

Adds probe_forwarded to meaningful event kinds and stores it in the
bounty table as bounty_type=probe_relay with forwarded=true/false, so
the dashboard shows whether the upstream actually accepted the test email.
This commit is contained in:
2026-04-30 11:32:14 -04:00
parent 9a4fe2677b
commit 24cdef9246
2 changed files with 19 additions and 0 deletions

View File

@@ -41,6 +41,10 @@ INTERACTION_EVENT_TYPES: frozenset[str] = frozenset({
"rcpt_to",
"rcpt_denied",
"message_accepted",
# probe_forwarded fires when we actually relay the test email upstream
# so the attacker can verify receipt. forwarded=1 means the upstream
# accepted it; forwarded=0 means it failed (but the attacker still got 250).
"probe_forwarded",
# File / payload activity
"file_captured",
"upload",

View File

@@ -613,6 +613,21 @@ async def _extract_bounty(
"content_type": _fields.get("content_type"),
},
})
elif _evt == "probe_forwarded":
# Record whether the upstream relay accepted the probe. forwarded=1
# means the attacker's test email actually landed in their inbox;
# forwarded=0 means the upstream refused (attacker still got 250).
await repo.add_bounty({
"decky": log_data.get("decky"),
"service": log_data.get("service"),
"attacker_ip": log_data.get("attacker_ip"),
"bounty_type": "probe_relay",
"payload": {
"msg_id": _fields.get("msg_id"),
"forwarded": _fields.get("forwarded") == "1",
"delivery_count": _fields.get("delivery_count"),
},
})
# ─── IP-leak detection (XFF / Forwarded / X-Real-IP / CDN variants) ──────────