Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion examples/dos-mitigation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
// SPDX-License-Identifier: Apache-2.0

/// Example mitigation for Slowloris-style Denial of Service attacks. For details on this attack,
/// see [QUIC Transport RFC](https://www.rfc-editor.org/rfc/rfc9000.html#name-slowloris-attacks).
/// see [QUIC§21.6](https://www.rfc-editor.org/rfc/rfc9000.html#name-slowloris-attacks).
///
/// The Connection Supervisor used in this example may also be used to mitigate the more general
/// Peer Denial of Service attack described in [QUIC§21.9](https://www.rfc-editor.org/rfc/rfc9000.html#name-peer-denial-of-service).
pub mod slowloris {
use s2n_quic::provider::{
event,
Expand Down
7 changes: 7 additions & 0 deletions quic/s2n-quic-transport/src/connection/connection_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,13 @@ impl<Config: endpoint::Config> ConnectionImpl<Config> {
//# a connection is allowed to have, and restricting the length of time
//# an endpoint is allowed to stay connected.

//= https://www.rfc-editor.org/rfc/rfc9000#section-21.9
//# While there are legitimate uses for all messages, implementations
//# SHOULD track cost of processing relative to progress and treat
//# excessive quantities of any non-productive packets as indicative of
//# an attack. Endpoints MAY respond to this condition with a connection
//# error or by dropping packets.

// Applications may implement the `on_supervisor_timeout` trait function to
// close the connection based on data in the supervisor context and in the
// connection and endpoint events.
Expand Down