Interface ITheBrig

All Known Implementing Classes:
TheBrig

public interface ITheBrig
Monitors the inmates who have misbehaved in our system.

a client who needs addressing will be stored in a map in this class for as long as required. After they have served their time, they are released.

It is expected that users of this program will add ip addresses plus a string for a complaint identifier, like "123.123.123.123_brute_forcing_login" or "123.123.123.123_failed_login_too_many_times" or some such. In particular, adding a suffix of "_vuln_seeking" will cause a client's connection to be immediately dropped at the onset - see code for WebFramework.dumpIfAttacker(com.renomad.minum.web.ISocketWrapper, com.renomad.minum.web.FullSystem)

From a technical standpoint, this program stores strings paired with timestamps, and removes those entries when hitting that time.

  • Method Summary

    Modifier and Type
    Method
    Description
    Get the current list of ip addresses that have been judged as having carried out attacks on the system.
     
    boolean
    isInJail(String clientIdentifier)
    Return true if a particular client ip address is found in the list.
    boolean
    sendToJail(String clientIdentifier, long sentenceDuration)
    Put a client in jail for some infraction, for a specified time.
    void
    Kills the infinite loop running inside this class.
  • Method Details

    • initialize

      ITheBrig initialize()
    • stop

      void stop() throws IOException
      Kills the infinite loop running inside this class.
      Throws:
      IOException
    • sendToJail

      boolean sendToJail(String clientIdentifier, long sentenceDuration)
      Put a client in jail for some infraction, for a specified time.
      Parameters:
      clientIdentifier - the client's ip address plus some complaint identifier, like 1.2.3.4_too_freq_downloads. One special string to use is "_vuln_seeking" - if this is appended to an ip address, then that client will have its connection immediately dropped upon connecting. For example, that would look like "123.123.123.123_vuln_seeking"
      sentenceDuration - length of stay, in milliseconds
      Returns:
      whether we put this client in jail
    • isInJail

      boolean isInJail(String clientIdentifier)
      Return true if a particular client ip address is found in the list.
    • getInmates

      Collection<Inmate> getInmates()
      Get the current list of ip addresses that have been judged as having carried out attacks on the system.