feat: refine logging for honeypot trap requests
This commit is contained in:
@@ -394,13 +394,6 @@ async def trap_page(request: Request, path: str):
|
|||||||
|
|
||||||
is_suspicious = tracker.is_suspicious_user_agent(user_agent)
|
is_suspicious = tracker.is_suspicious_user_agent(user_agent)
|
||||||
|
|
||||||
if is_suspicious:
|
|
||||||
access_logger.warning(
|
|
||||||
f"[SUSPICIOUS] {client_ip} - {user_agent[:50]} - {full_path}"
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
access_logger.info(f"[REQUEST] {client_ip} - {full_path}")
|
|
||||||
|
|
||||||
# Record access unless the router dependency already handled it
|
# Record access unless the router dependency already handled it
|
||||||
# (attack pattern or honeypot path → already recorded by _track_honeypot_request)
|
# (attack pattern or honeypot path → already recorded by _track_honeypot_request)
|
||||||
if not tracker.detect_attack_type(full_path) and not tracker.is_honeypot_path(
|
if not tracker.detect_attack_type(full_path) and not tracker.is_honeypot_path(
|
||||||
|
|||||||
Reference in New Issue
Block a user