-
Suggestion
-
Resolution: Unresolved
-
None
-
8
-
14
-
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
- When authenticating in Bamboo (Internal Directory), there is no database table that holds information on user's latest authentication against the application.
- 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-home>/logs/atlassian-bamboo.log using a shell command. The command below, tested on Unix machines, allows for multiple atlassian-bamboo.log files in multiple directories, for example in the case of upgrades:
find / -name atlassian-bamboo.log -exec grep "BambooAuthenticator" {} \; |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:
- The command provided will only work on terminals which support GNU tools
- This can be run from any directory accessible by the Bamboo user
- This command may take some time to run, dependent on the size of your {{atlassian-bamboo.log }}file(s)
- This suggestion is provided as-is and support will not be available from Atlassian Support