mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
chore(snownet): log attributes on message integrity failure (#7577)
We are receiving multiple reports of message, especially error messages from relays, where the message integrity check fails. To get more information as to why, this patch extends this error message with the attributes of the request and response message.
This commit is contained in:
@@ -309,7 +309,14 @@ impl Allocation {
|
||||
let passed_message_integrity_check = self.check_message_integrity(&message);
|
||||
|
||||
if message.method() != BINDING && !passed_message_integrity_check {
|
||||
tracing::warn!("Message integrity check failed");
|
||||
// We don't want to `remove` the message here otherwise an attacker could change our state with unauthenticated messages.
|
||||
let request = self
|
||||
.sent_requests
|
||||
.get(&transaction_id)
|
||||
.map(|(_, r, _, _, _)| r.attributes().map(display_attr).collect::<Vec<_>>());
|
||||
let response = message.attributes().map(display_attr).collect::<Vec<_>>();
|
||||
|
||||
tracing::warn!(?request, ?response, "Message integrity check failed");
|
||||
return true; // The message still indicated that it was for this `Allocation`.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user