Uploaded image for project: 'Bamboo'
  1. Bamboo
  2. BAM-17728

Get last timestamp users authenticated in Bamboo and from where

    XMLWordPrintable

    Details

    • UIS:
      2
    • Support reference count:
      14
    • Feedback Policy:

      Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Description

      Summary

      Currently, there is no way to tell when was the latest date/time a user logged in Bamboo, regardless the authentication type (e.g.: Internal Directory, External Directory)

      Steps to Reproduce

      1. When authenticating in Bamboo (Internal Directory), there is no database table that holds information on user's latest authentication against the application.
      2. When authenticating in Bamboo (External Directory, e.g.: JIRA) you can run the following SQL statement against JIRA's database:
        select Attr.attribute_value as LAST_AUTHENTICATED
          from cwd_user as Person
          join cwd_user_attributes as Attr
               on Person.id = Attr.user_id
         where Person.user_name = 'USERNAME'
           and Attr.attribute_name = 'lastAuthenticated';
        
        LAST_AUTHENTICATED
        1467639110107

        However, when authenticating with the same USERNAME in JIRA and re-running the SQL statement above, the same gets updated:

        LAST_AUTHENTICATED
        1467639474640

        Due to the information above, you cannot tell whether the authentication was from Bamboo or JIRA.

      Expected Results

      Be able to determine when a particular last authenticate against the application.

      Actual Results

      Information cannot be retrieved.

      Notes

      In Bamboo, there is a table "AUTH_ATTEMPT_INFO" that stores failure login attempts.

      id USER_NAME AUTH_COUNT LAST_AUTH_TIMESTAMP
      4030465 USERNAME 0 2016-07-04

      This table could store information related to not only failure login attempts but actual login as well.
      LAST_AUTH_TIMESTAMP should store date/time.

      Workaround

      Last login date can be pulled from log files, such as <bamboo-install>/logs/catalina.out using a shell command. The command below, tested on Unix machines, allows for multiple catalina.out files in multiple directories, for example in the case of upgrades:

      find / -name catalina.out -exec grep "Finished doing authentication checks for" {} \; |awk -F ' ' 'BEGIN {date = $1} {if ($1 > date && $1 > a[$11]) a[$11] = $1} END {for (i in a) print i" : " a[i]}'
      

      Sample output:

      nonadmin, : 2017-02-15
      bamboo, : 2017-02-24
      

      Notes:

      1. The command provided will only work on terminals which support GNU tools
      2. This can be run from any directory accessible by the Bamboo user
      3. This command may take some time to run, dependent on the size of your catalina.out file(s)
      4. This suggestion is provided as-is and support will not be available from Atlassian Support

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              rsperafico Rafael Sperafico (Inactive)
              Votes:
              23 Vote for this issue
              Watchers:
              16 Start watching this issue

                Dates

                Created:
                Updated: