Details
-
Bug
-
Status: Closed (View Workflow)
-
High
-
Resolution: Fixed
-
5.5.0, 5.6.2
-
None
-
None
-
1
-
Severity 3 - Minor
-
1
-
Description
Summary
The username field in the atlassian-bitbucket-access.log is empty and does not contain any information when performing Git operations via ssh.
This applies to operations performed by using an SSH Key or an Access Key.
Steps to Reproduce
- Perform a Git operation via ssh (e.g. clone or push a repository)
Expected Results
The username (charlie in the SSH Key example) and an id associated with the access key (b69a0c4a7aa114a0 in the Access Key one) is available in the access log.
Git operation using an SSH Key
# push operation 172.17.0.1 | ssh | i@YJILN0x263x126x0 | charlie | 2018-01-04 04:23:13,510 | SSH - git-receive-pack '/tp1/tp_rep1.git' | - | - | - | - | - | - | 1nc5d5q | 172.17.0.1 | ssh | o@YJILN0x263x126x0 | charlie | 2018-01-04 04:23:14,131 | SSH - git-receive-pack '/tp1/tp_rep1.git' | - | 0 | 855 | 190 | push, ssh:user:id:1 | 621 | 1nc5d5q | # clone operation 172.17.0.1 | ssh | i@YJILN0x263x127x0 | charlie | 2018-01-04 04:23:34,325 | SSH - git-upload-pack '/tp1/tp_rep1.git' | - | - | - | - | - | - | o9qsm4 | 172.17.0.1 | ssh | o@YJILN0x263x127x0 | charlie | 2018-01-04 04:23:34,482 | SSH - git-upload-pack '/tp1/tp_rep1.git' | - | 0 | 183 | 1271 | cache:miss, clone, ssh:user:id:1 | 156 | o9qsm4 |
Git operation using an Access Key
172.17.0.1 | ssh | i@326W7Ox388x83x0 | b69a0c4a7aa114a0 | 2018-01-04 06:28:30,819 | SSH - git-upload-pack '/tp1/tp_rep1.git' | - | - | - | - | - | - | 1239iho | 172.17.0.1 | ssh | o@326W7Ox388x83x0 | b69a0c4a7aa114a0 | 2018-01-04 06:28:31,053 | SSH - git-upload-pack '/tp1/tp_rep1.git' | - | 0 | 183 | 1271 | cache:miss, clone, ssh:user:id:52 | 234 | 1239iho |
Actual Results
The username is not added to the access log, the field shows an empty value instead {{ - }}.
Git operation using an SSH Key
# push operation 172.17.0.1 | ssh | i@16KZBADx289x149x0 | - | 2018-01-04 04:49:15,042 | SSH - git-receive-pack '/tp/tp_rep1.git' | "SSH-2.0-OpenSSH_7.4" | - | - | - | - | - | 1sqzc2 | 172.17.0.1 | ssh | o@16KZBADx289x149x0 | - | 2018-01-04 04:49:15,701 | SSH - git-receive-pack '/tp/tp_rep1.git' | "SSH-2.0-OpenSSH_7.4" | 0 | 855 | 197 | push, ssh:user:id:1 | 659 | 1sqzc2 | # clone operation 172.17.0.1 | ssh | i@16KZBADx292x170x0 | - | 2018-01-04 04:52:12,345 | SSH - git-upload-pack '/tp/tp_rep1.git' | "SSH-2.0-OpenSSH_7.4" | - | - | - | - | - | uon561 | 172.17.0.1 | ssh | o@16KZBADx292x170x0 | - | 2018-01-04 04:52:12,552 | SSH - git-upload-pack '/tp/tp_rep1.git' | "SSH-2.0-OpenSSH_7.4" | 0 | 207 | 1341 | cache:miss, clone, ssh:user:id:1 | 207 | uon561 |
Git operation using an Access Key
172.17.0.1 | ssh | i@16KZBADx380x269x0 | - | 2018-01-04 06:20:47,522 | SSH - git-upload-pack '/tp/tp_rep1.git' | "SSH-2.0-OpenSSH_7.4" | - | - | - | - | - | 114uesv | 172.17.0.1 | ssh | o@16KZBADx380x269x0 | - | 2018-01-04 06:20:47,618 | SSH - git-upload-pack '/tp/tp_rep1.git' | "SSH-2.0-OpenSSH_7.4" | 0 | 207 | 1341 | cache:hit, clone, refs, ssh:user:id:2 | 96 | 114uesv |
Workaround
The id in the label field can be used to retrieve the username or the access key used to perform the operation.
For example, in the cache:miss, clone, ssh:user:id:1 label, the id is 1.
This can be matched against the user_id in one of the following tables:
- sta_normal_user for Bitbucket Server users
- sta_service_user for access keys (see How to read the Bitbucket Server Log Formats for details)
The id will be unique across the two tables.
Attachments
Issue Links
- mentioned in
-
Page Loading...