Skip to content
Audit & ReportsMarkdown

Look into a locked account

When a user is locked out, read the failed sign-ins and the lockout behind it, with why each attempt failed and when, to tell mistyping from someone else trying.

API

maya calls the help desk: she can’t sign in. Before anything is reset, you want to know whether she mistyped her password a few times or someone else has been trying it. Her trail holds every failed sign-in against her account, with why each one failed and when, and the lockout records show when the account was locked.

Before you start: you hold READ on the realm (RealmViewer is enough), and are signed in with your session in $CVYUH_SESSION (Call the API shows how).

After repeated wrong passwords or codes, maya’s sign-in is refused even with the right password, until the lock ends. If your realm warns users, she was told how many attempts were left before it locked. See Lockout.

  1. Look up her id:

    Terminal window
    curl https://foobar.cvyuh.com/api/v0/am/objects/v1/user/maya \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
  2. Read her trail, newest first:

    Terminal window
    curl "https://foobar.cvyuh.com/api/v0/am/audit/v1/trail?person=<maya's id>&pageSize=100" \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
  3. In events.data, find the LOGIN_FAILED records. Each has its eventTime, the name as it was typed in context.name, and why it failed in context.code:

    context.codeMeans
    AUTH_INVALID_PASSWORD, AUTH_INVALID_PASSWORD_WARNEDA wrong password or code
    AUTH_MAX_ATTEMPTSThe attempt that locked the account
    AUTH_USER_LOCKEDAn attempt while it was locked
  4. Read the lockout records. They are kept under the name she signs in with, in lower case, rather than her id:

    Terminal window
    curl "https://foobar.cvyuh.com/api/v0/am/audit/v1/trail?person=maya&pageSize=100" \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"

    AUTH_FAILURE_RECORDED is each failure counted, ACCOUNT_LOCKED the moment the account locked, and LOCKOUT_CLEARED the count cleared by a successful sign-in.

  5. Compare the times. A few failures close together, then a successful LOGIN, read as mistyping. Many failures spread over hours, attempts that keep coming while the account is locked (AUTH_USER_LOCKED), or the name typed in forms she doesn’t use, read as someone else trying her password.

Once she signs in again, a LOGIN record with "result": "SUCCESSFUL" is on her trail, and a LOCKOUT_CLEARED record on the name read. A lock that simply runs out writes no record of its own.

Nothing to undo: reading the trail changes nothing. If someone else has been trying her password, have her change it once she is back in, and consider a second sign-in step for her.

SymptomCauseFix
No LOGIN_FAILED records under her idThe name typed didn’t match her accountRead by the name typed, in lower case, as in step 4
No ACCOUNT_LOCKED on her trailLockout records are kept under the name, not her idStep 4
The step 4 read shows attempts for Maya and MAYA togetherNames are counted in lower caseExpected: they are one account’s attempts
403You don’t hold READ on the realmAsk for RealmViewer