java.lang.Object
com.renomad.minum.security.TheBrig
- All Implemented Interfaces:
ITheBrig
See
ITheBrig-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the current list of ip addresses that have been judged as having carried out attacks on the system.booleanReturn true if a particular client ip address is found in the list.booleansendToJail(String clientIdentifier, long sentenceDuration) Put a client in jail for some infraction, for a specified time.voidstop()Kills the infinite loop running inside this class.
-
Constructor Details
-
TheBrig
-
TheBrig
In this class we create a thread that runs throughout the lifetime of the application, in an infinite loop removing keys from the list under consideration.
-
-
Method Details
-
initialize
- Specified by:
initializein interfaceITheBrig
-
stop
Description copied from interface:ITheBrigKills the infinite loop running inside this class.- Specified by:
stopin interfaceITheBrig- Throws:
IOException
-
sendToJail
Description copied from interface:ITheBrigPut a client in jail for some infraction, for a specified time.- Specified by:
sendToJailin interfaceITheBrig- 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
Description copied from interface:ITheBrigReturn true if a particular client ip address is found in the list. -
getInmates
Description copied from interface:ITheBrigGet the current list of ip addresses that have been judged as having carried out attacks on the system.- Specified by:
getInmatesin interfaceITheBrig
-