SYN flood, brute force fail2ban + session.mail.is-allowed expression (closes #482 closes #688 closes #609)

This commit is contained in:
mdecimus
2024-08-29 12:22:44 +02:00
parent 7e1b6bd06d
commit 36fd5797b7
35 changed files with 325 additions and 114 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "jmap"
version = "0.9.2"
version = "0.9.3"
edition = "2021"
resolver = "2"

View File

@@ -885,11 +885,10 @@ impl ToRequestError for trc::Error {
trc::AuthEvent::MissingTotp => {
RequestError::blank(403, "TOTP code required", cause.message())
}
trc::AuthEvent::TooManyAttempts | trc::AuthEvent::Banned => {
RequestError::too_many_auth_attempts()
}
trc::AuthEvent::TooManyAttempts => RequestError::too_many_auth_attempts(),
_ => RequestError::unauthorized(),
},
trc::EventType::Security(_) => RequestError::too_many_auth_attempts(),
trc::EventType::Resource(cause) => match cause {
trc::ResourceEvent::NotFound => RequestError::not_found(),
trc::ResourceEvent::BadParameters => RequestError::blank(