After understanding Service Accounts , we need to set them up. Thanks again to @Darryl Lee for the review and contribution!
Before we go crazy with the account creation though, there are a few things that we should consider.
For one, Account creation and setup needs Organization Administration privileges. As a regular user, you will need help. However, you can come prepared if you are aware of all the info your Org Admin will need for you. Jump straight ahead to the step-by-step guide and come back for part 3. That one’s for you.
Secondly, Atlassian is not making it very easy to keep track of all Accounts, Tokens, Owners etc. That’s why we need some…
Service accounts often end up with a lot of power and very long lives. There is a team or person that requested the account and therefore a use case. If we create accounts with documentation of that, we will not remember in a few years when an audit is coming up and we need to account for everything happening on our sites.
For every service account, track at least:
You can use the description field in the Service Account at a minimum. I would recommend setting up something a little more sophisticated, so you can later run checks automatically. Some ideas:
Only widen when there is a justified need. Beware that Service Accounts will be added to Default App Access groups just like any regular user. You might want to manage App Access via separate groups that have limited Global Permissions or Space permissions.
If your company is in need of a lot of Service Accounts, you as an Org Admin may get very busy with Account and Token creation. Depending on the expiration, new Tokens need to be created at least every year. There is no API support for automated creation but you can provide your users with enough documentation so you at least don’t have to ask for all the details separately.
Consider things like
Right. Let’s jump into the actual guide.
Before creating or requesting anything, write down:
What will this integration do?
Then map that into scopes using the REST API docs:
💡
Make sure that a Service Account is actually what you need. Some Use Cases may be better covered by Personal API Access Tokens, Filter Subscriptions, Out-of-the-Box Features, Marketplace Apps… Check out Part 1 of this series.
💡
jira-ci-cd-botconfluence-reporting-botDetails to this flow can change over time, so always check Atlassian’s docs: https://support.atlassian.com/user-management/docs/understand-service-accounts/
💡
You may want to manage App Access for Service Accounts via special groups so they are not added to any Default Access groups automatically. Default Groups may be used for Global or Space Level Permissions.
If so:
💡
See https://support.atlassian.com/user-management/docs/manage-api-tokens-for-service-accounts/ for reference.
Once the service account exists:
💡
Don’t mix granular with classic token scopes. Some granular scopes are not part of any classic scope so they need to be granted specifically.
Best practise for scope: start with least privilege and create other access tokens when your integration proves it needs more.
Atlassian doesn’t store the raw token; if you lose it, you need to create a new one.
Also: You cannot view or edit the token scope after creation. Documentation is key for later troubleshooting.
💡
Now that the Service Account is created, you need to give it access on App level. Add it to your Confluence or Jira Space, your Compass team or wherever else it needs access to. This step can be completed by the respective Space Admins.
You can find and add Service Account like any other regular User and simply search for their name.
https://support.atlassian.com/confluence-cloud/docs/assign-space-permissions/
https://support.atlassian.com/jira-software-cloud/docs/add-users-to-space-roles-in-your-space/
That's the Service Account all set. But how do we actually use it?
Part 3: Atlassian Service Accounts in Practice
And in case you missed it. Part 1: What are they (for)
Rebekka Heilmann _viadee_
2 comments