Record Class AbusePatternMonitor.Config

java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.credential.abuse.AbusePatternMonitor.Config
Record Components:
sprayingDistinctUsers - number of distinct usernames per client per window that triggers SPRAYING; 0 to disable
sprayingWindow - sliding-window length for SPRAYING
stuffingDistinctClients - number of distinct clients per username per window that triggers STUFFING; 0 to disable
stuffingWindow - sliding-window length for STUFFING
resetAbuseAttempts - number of RESET_REQUEST attempts per username per window that triggers RESET_ABUSE; 0 to disable
resetAbuseWindow - sliding-window length for RESET_ABUSE
Enclosing class:
AbusePatternMonitor

public static record AbusePatternMonitor.Config(int sprayingDistinctUsers, Duration sprayingWindow, int stuffingDistinctClients, Duration stuffingWindow, int resetAbuseAttempts, Duration resetAbuseWindow) extends Record
Tunables for the three pattern detectors.
  • Constructor Details

    • Config

      public Config(int sprayingDistinctUsers, Duration sprayingWindow, int stuffingDistinctClients, Duration stuffingWindow, int resetAbuseAttempts, Duration resetAbuseWindow)
      Creates an instance of a Config record class.
      Parameters:
      sprayingDistinctUsers - the value for the sprayingDistinctUsers record component
      sprayingWindow - the value for the sprayingWindow record component
      stuffingDistinctClients - the value for the stuffingDistinctClients record component
      stuffingWindow - the value for the stuffingWindow record component
      resetAbuseAttempts - the value for the resetAbuseAttempts record component
      resetAbuseWindow - the value for the resetAbuseWindow record component
  • Method Details

    • defaults

      public static AbusePatternMonitor.Config defaults()
      Sensible default: 8 distinct usernames per client in 5 min → SPRAYING; 5 distinct clients per username in 15 min → STUFFING; 5 reset attempts per username in 1 h → RESET_ABUSE.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • sprayingDistinctUsers

      public int sprayingDistinctUsers()
      Returns the value of the sprayingDistinctUsers record component.
      Returns:
      the value of the sprayingDistinctUsers record component
    • sprayingWindow

      public Duration sprayingWindow()
      Returns the value of the sprayingWindow record component.
      Returns:
      the value of the sprayingWindow record component
    • stuffingDistinctClients

      public int stuffingDistinctClients()
      Returns the value of the stuffingDistinctClients record component.
      Returns:
      the value of the stuffingDistinctClients record component
    • stuffingWindow

      public Duration stuffingWindow()
      Returns the value of the stuffingWindow record component.
      Returns:
      the value of the stuffingWindow record component
    • resetAbuseAttempts

      public int resetAbuseAttempts()
      Returns the value of the resetAbuseAttempts record component.
      Returns:
      the value of the resetAbuseAttempts record component
    • resetAbuseWindow

      public Duration resetAbuseWindow()
      Returns the value of the resetAbuseWindow record component.
      Returns:
      the value of the resetAbuseWindow record component