From e78ef04e6cc55b3e9b01f22ab701fd99534569ce Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Fri, 24 Jan 2025 14:55:30 +1100 Subject: [PATCH] chore(snownet): don't log missing attribute for binding requests (#7852) STUN binding requests & responses are not authenticated on purpose because they are so easy to fulfill that having to perform the computational work to check the authentication is more work than actually just sending the request. With #7819, we send STUN binding requests more often because they are used as keep-alives to the relay. This spams the debug log because we see > Message does not have a `MessageIntegrity` attribute for every BINDING response. This information isn't interesting for BINDING responses because those will never have a `MessageIntegrity` attribute. --- rust/connlib/snownet/src/allocation.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rust/connlib/snownet/src/allocation.rs b/rust/connlib/snownet/src/allocation.rs index 01eb9a583..17db4c50b 100644 --- a/rust/connlib/snownet/src/allocation.rs +++ b/rust/connlib/snownet/src/allocation.rs @@ -1103,7 +1103,9 @@ impl Allocation { #[cfg(not(test))] fn check_message_integrity(&self, message: &Message) -> bool { let Some(mi) = message.get_attribute::() else { - tracing::debug!("Message does not have a `MessageIntegrity` attribute"); + if message.method() != BINDING { + tracing::debug!("Message does not have a `MessageIntegrity` attribute"); + } return false; };