Class AbusePatternMonitor
java.lang.Object
com.svenruppert.jsentinel.credential.abuse.AbusePatternMonitor
Higher-level abuse-pattern detector that sits next to the
AbuseDetectionService.
Patterns
AbusePattern.PASSWORD_SPRAYING— same client touches many distinct usernames inside a window.AbusePattern.CREDENTIAL_STUFFING— single username receives failures from many distinct clients.AbusePattern.RESET_ABUSE— single username or client generates many reset requests.
Each pattern keeps a privacy-minimised sliding-window record of
timestamps + the distinct-target set hashed to a string key. When
the configured threshold trips, the monitor emits an
AbusePatternSignal through the provided signalSink
— the signal carries aggregates only, never the usernames or
client addresses themselves (CWE-359).
This is the in-memory reference implementation. Production multi-node deployments must replace the backing maps with a clustered store; see Konzept §13.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordTunables for the three pattern detectors. -
Constructor Summary
ConstructorsConstructorDescriptionAbusePatternMonitor(AbusePatternMonitor.Config config, Consumer<AbusePatternSignal> signalSink) -
Method Summary
Modifier and TypeMethodDescriptionobserve(AbuseAttemptContext context, AttemptOutcome outcome) Feed one attempt + outcome into the monitor.Snapshot of internal state for diagnostics.
-
Constructor Details
-
AbusePatternMonitor
public AbusePatternMonitor(AbusePatternMonitor.Config config, Consumer<AbusePatternSignal> signalSink)
-
-
Method Details
-
observe
Feed one attempt + outcome into the monitor. Detectors are evaluated independently; each may emit at most one signal per call. -
snapshotCardinalities
Snapshot of internal state for diagnostics. The returned map is a copy; mutating it does not affect the monitor.
-