Class LockEvents
AccountHold), told ONCE whatever the path it came by (CC-FIX-LOCK-PATHS-AND-RESET, rulings LH-D-6, LH-D-8 and LG-D-4).The start. The place that counts a wrong password - UserAuthentication.validateUser and validatePasswordSignIn - answers the length of the lock its counted failure started (UserAuthenticationInfo.getHoldMillis(); an attempt during a lock is not counted, so it starts none). Every caller that can start a lock hands that answer to this class:
- the sign-in (
performInternalLogin) logs the security event throughstart(String, UserAuthenticationInfo, SecurityEventLog.Context)and keeps the attempt as a failed sign-in, whose mail says that the account is locked (FailedSignInNotifier.onAttempt(FailedSignInStore.Attempt, BasicUserInfo, boolean)): nothing more is mailed for it; - the paths that keep NO failed sign-in - a change of the password (the current password was wrong), a signed-in session asked for its password again, and the Push API's HTTP Basic sign-in (
FailedSignInMails.LockPath) - callstartWithoutAttempt(FailedSignInMails.LockPath, UserAuthenticationInfo, IClientSessionGyro): the security event, and the lock mail throughFailedSignInRecorder.onLockStarted(FailedSignInMails.LockPath, UserAuthenticationInfo, IClientSessionGyro, InetAddress), which nothing else would send.
The early end. A completed password reset clears the failed sign-ins with the password it writes (BasicUserInfo.resetPasswordTo, since r20302), which ends a lock: endByReset(BasicUserInfo, boolean, int, SecurityEventLog.Context) logs that as an administrator's Unlock logs it (AdminAccountChanges.endHold); so does an administrator's "Reset & mail password", which ends a lock since CC-FIX-LOCK-SMALLS: endByAdministratorReset(BasicUserInfo, boolean, int).
Nothing here throws to its caller, and nothing changes the answer to the client.
- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptionstatic voidendByAdministratorReset(BasicUserInfo user, boolean held, int failures) Logs that an administrator's "Reset & mail password" (ServerAdmin;PasswordResetMail.resetAndMailwithBasicUserInfo.resetPassword(Connection,StringBuilder)) cleared the failed sign-ins of an account with the generated password it wrote, asendByReset(BasicUserInfo, boolean, int, SecurityEventLog.Context)logs it for a completed reset: one INFO with the failures cleared, and - when the account was locked - one WARNING security eventACCOUNT_HOLD_ENDEDwith the account (CC-FIX-LOCK-SMALLS, ruling LK-D-1).static voidendByReset(BasicUserInfo user, boolean held, int failures, SecurityEventLog.Context where) Logs that a completed password reset cleared the failed sign-ins of an account, as an administrator's Unlock logs it: one INFO with the failures cleared, and - when the account was locked - one WARNING security eventACCOUNT_HOLD_ENDEDwith the account and the client's address and place.static booleanChecks if the answer of a password check says that its counted failure started a lock.static voidstart(String path, UserAuthenticationInfo info, SecurityEventLog.Context where) Logs the security event of a lock that started: one WARNINGACCOUNT_HELDwith the account - which the session does not have at this point, so it is put into the context here - and the client's address and place ofwhere.static voidstartWithoutAttempt(FailedSignInMails.LockPath path, UserAuthenticationInfo info, IClientSessionGyro clientGyro) Tells the lock a wrong password started on a path of a client session that keeps no failed sign-in for it: the security event now - the session knows its address and place - and the lock mail off the path.static voidstartWithoutAttempt(FailedSignInMails.LockPath path, UserAuthenticationInfo info, InetAddress address) Tells the lock a wrong password started on a path WITHOUT a client session - the Push API's HTTP Basic sign-in - that keeps no failed sign-in for it: the security event and the lock mail, both off the path, where the place of the address is looked up.
Method Details
isStart
Checks if the answer of a password check says that its counted failure started a lock.- Parameters:
info- The answer of the password check, null for none.- Returns:
- true when a lock started.
start
Logs the security event of a lock that started: one WARNINGACCOUNT_HELDwith the account - which the session does not have at this point, so it is put into the context here - and the client's address and place ofwhere. The text says how long the lock lasts and when it ends. Nothing is logged when the answer started no lock. Never throws.- Parameters:
path- The path the wrong password came by, for the text: the calling method, or the label of aFailedSignInMails.LockPath.info- The answer of the password check, null for none.where- Where the attempt came from: its application, device, address and place; null for nothing known.
startWithoutAttempt
public static void startWithoutAttempt(FailedSignInMails.LockPath path, UserAuthenticationInfo info, IClientSessionGyro clientGyro) Tells the lock a wrong password started on a path of a client session that keeps no failed sign-in for it: the security event now - the session knows its address and place - and the lock mail off the path. Nothing when the answer started no lock. Never throws.- Parameters:
path- The path.info- The answer of the password check, null for none.clientGyro- The client session the wrong password came from, null for none.
startWithoutAttempt
public static void startWithoutAttempt(FailedSignInMails.LockPath path, UserAuthenticationInfo info, InetAddress address) Tells the lock a wrong password started on a path WITHOUT a client session - the Push API's HTTP Basic sign-in - that keeps no failed sign-in for it: the security event and the lock mail, both off the path, where the place of the address is looked up. Nothing when the answer started no lock. Never throws.- Parameters:
path- The path.info- The answer of the password check, null for none.address- The client address the wrong password came from, null when unknown.
endByReset
public static void endByReset(BasicUserInfo user, boolean held, int failures, SecurityEventLog.Context where) Logs that a completed password reset cleared the failed sign-ins of an account, as an administrator's Unlock logs it: one INFO with the failures cleared, and - when the account was locked - one WARNING security eventACCOUNT_HOLD_ENDEDwith the account and the client's address and place. Nothing when there were no failures. Never throws.- Parameters:
user- The user whose password was reset.held- true when the account was locked right before the reset.failures- The failed sign-ins the account had right before the reset.where- Where the reset was completed from; null for nothing known.
endByAdministratorReset
Logs that an administrator's "Reset & mail password" (ServerAdmin;PasswordResetMail.resetAndMailwithBasicUserInfo.resetPassword(Connection,StringBuilder)) cleared the failed sign-ins of an account with the generated password it wrote, asendByReset(BasicUserInfo, boolean, int, SecurityEventLog.Context)logs it for a completed reset: one INFO with the failures cleared, and - when the account was locked - one WARNING security eventACCOUNT_HOLD_ENDEDwith the account (CC-FIX-LOCK-SMALLS, ruling LK-D-1). Called once the reset is committed. Nothing when there were no failures. Never throws.- Parameters:
user- The user whose password was reset.held- true when the account was locked right before the reset.failures- The failed sign-ins the account had right before the reset.