fix(backend): logge les tentatives de connexion échouées sur /auth/login - #26
Merged
Merged
Conversation
Audit de trafic suspect en prod : aucune requête HTTP n'est loggée (RUST_LOG=info désactive les traces par requête), et surtout un échec d'authentification (AuthError::InvalidCredentials) n'était jamais loggé du tout, même en cas de brute-force actif sur /auth/login - zéro trace possible. Ajout d'un tracing::warn avec l'email tenté (jamais le mot de passe) sur échec de login. warn passe le filtre RUST_LOG=info par défaut, donc visible en prod sans changer la config. Vérifié en dev : un login avec des identifiants invalides produit bien une ligne WARN avec l'email, l'IP cliente et le user-agent (déjà capturés par le span HTTP existant). Suite e2e complète (flake préexistant sur offline-entry.spec.ts, déjà documenté, confirmé indépendant de ce changement en le relançant seul).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Résumé
Suite à un audit de trafic suspect en prod (rien trouvé au niveau réseau/système, SSH bien durci, aucune activité anormale en base) : le backend ne loggue aucune requête HTTP en prod (RUST_LOG=info désactive les traces par requête), et surtout un échec d'authentification n'était jamais loggé du tout - impossible de détecter un brute-force sur
/auth/logina posteriori.Ajout d'un
tracing::warn(email tenté uniquement, jamais le mot de passe) sur échec de login.warnpasse le filtreRUST_LOG=infopar défaut, donc visible en prod sans rien changer à la config.Test plan
cargo build+cargo test --lib: 9/9cargo fmt --check