As part of the setting up backups for bitbucket server using the atlassian-bitbucket-diy-backup (https://bitbucket.org/atlassianlabs/atlassian-bitbucket-diy-backup) it requires that you provide a system administrator account to the script. This account is used to put bitbucket in downtime.
I see a security issue with this as it means that the username and password for an system administrator is stored in plain text on disk on the server.
Of course one can protect the file by giving it appropriate ownership and permissions. But is there not a better way?
Hi Jason! There are also other options, like for example you can create a token associated to the admin and then use this token for the backup. This token will still not be encrypted within the script, but it provides more security as it can not be used to access the instance. You can find this information at
On the Authentication part:
Any authentication that works against Bitbucket will work against the REST API. The preferred authentication methods are HTTP Basic (when using SSL) and OAuth. Other supported methods include: HTTP Cookies and Trusted Applications.
You can find OAuth code samples in several programming languages at bitbucket.org/atlassian_tutorial/atlassian-oauth-examples.
Hope this helps :)
Thank you for the reply, but sadly I am still confused.
You mention using a token associated to the admin account. I cannot find any evidence in the bitbucket interface of how to create this token. The link to the Bitbucket Rest API is not very enlightening. It seems that all the examples use username and password based authentication.
I took a look at using the other recommended method: Oauth. Sadly this didnt go anywhere because the oauth based authentication requires a application link url. (see step 2 at oauth) and I am not using an application, just the atlassian provided backup bash script.
This script does not have a url associated with it.
Could you please point me in the correct direction ?
We’ve been building a plugin to integrate Bitbucket Server and Jenkins CI, and I’m excited to announce that our alpha is ready to download and install. It lets you seamlessly configure a Jenkins job ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events