Service Accounts
Service Accounts, under Administration in the menu next to People, is for administrators. A service account is a member of your organization that is not a person: a build pipeline, a script or another system that calls the API with an API key.
What a Service Account Is
Section titled “What a Service Account Is”- It has roles of its own: Author, Assessor, Auditor and Central Team, never administrator. It can do what a person with those roles can, and no more.
- It sees what a person with the same roles would. Need-to-know applies to it: a restricted model is shared with it the same way, by adding it to the model’s allowed list, where it is marked “Service account”. See Who can see a model.
- It never signs in. It has no password, authenticator app, passkey or session, and it cannot open the workspace. It calls the API with its keys only.
- It takes no seat, and it is not listed on the People page.
- What it does is recorded under its name, as a person’s work is: a model it adds says it added it, and the activity log names it.
- It is not deleted. When it is no longer needed, deactivate it: its keys stop at once, and its history stays.
Before You Start
Section titled “Before You Start”- API keys are off for every organization until an administrator turns them on, under People, in its ways to sign in: see API keys. Until then the screen says API Keys Are Turned Off, and every key is refused. You can still add accounts and make keys.
- Every change asks you to confirm it is you, with a code from your authenticator app or a passkey, when you have not in the last 10 minutes. Without either, add one at Sign-in security first.
- If the screen says API Keys Cannot Be Made on This Instance, the instance’s operators have not set the secret that keys are kept under (
ServiceAccounts:KeyHashSecret, see Settings).
On an instance with the sample data, the sample organization Brindlemoor Regional Utility has one service account already, Brindlemoor Records Export, an auditor, with API keys turned on. It has no key: make one to try it.
Add a Service Account
Section titled “Add a Service Account”- Choose Add a Service Account. The dialog goes step by step: Name and Purpose, Roles, then Review.
- Name and Purpose: in Name, say where it calls from, such as the pipeline that runs it. What It Is For is optional.
- Roles: switch on the roles it needs, and only those.
- Review: check the account, then choose Add the Account.
Central Team sees every restricted model. As for a person, only an administrator who is on the central team gives it, unless nobody active is on the team yet.
The Accounts
Section titled “The Accounts”The list shows each account’s Name, Roles, Live Keys (how many of its keys work now), Last Used (when, and from which address, noted at most once a minute) and Status, Active or Deactivated.
Change, Deactivate or Reactivate an Account
Section titled “Change, Deactivate or Reactivate an Account”- Change sets its name, what it is for, and its roles, in the same steps; every step can be chosen at the top, and Save is on Review. A change of roles reaches its keys at their next call. If someone else changed the account after you opened it, the form says so and keeps your changes: see When someone else saved first.
- Deactivate stops every key of the account at once. Its keys, roles and what it did stay.
- Reactivate lets its live keys work again.
Create a Key
Section titled “Create a Key”- Choose Keys beside the account, then Create a Key. The dialog goes step by step: Name, How Long It Lasts, Allowed Addresses, then Review.
- Name: say where the key is kept, such as the pipeline that holds it.
- How Long It Lasts: Lasts for (Days) is 90 unless you choose otherwise, and never more than your organization allows: 366 at the most. There is no key without an end.
- Allowed Addresses is optional. Give one address or network a line, IPv4 or IPv6, such as
203.0.113.0/24or2001:db8::/32; up to 20. An IPv4 address that arrives inside IPv6 counts as the IPv4 address. Left empty, the key works from any address. - Review: check the key, then choose Create the Key.
The whole key is shown now, and never again, under Copy the Key Now. Choose Copy, put it in your pipeline’s secret store, then choose Done. Only its last four characters are kept, beside its name. If it is lost, create another and revoke the one that was lost.
A key is nbf_ followed by 38 letters and digits. The prefix lets a secret scanner recognise it, and its last six characters check the rest, so a key copied wrongly is told at once.
Each Key
Section titled “Each Key”Under Keys, each key shows its name and last four characters, when it was Created and by whom, when it expires, when and from where it was Last Used, its Allowed Addresses, and whether it is Live, Expired or Revoked.
Rotate the Key
Section titled “Rotate the Key”An account has at most two live keys, so that one can replace the other without a gap.
- Choose Rotate the Key on the key to replace.
- The Old Key’s Days: in Old Key Works for (Days), choose how long the old key keeps working beside the new one: 0 to 7, and 7 unless you change it. With 0 the old key stops at once. Choose Next.
- Review: check the days, then choose Rotate the Key. The new key is shown once, as when you create one, with the same name and allowed addresses.
- Put the new key where the old one was before the overlap ends.
A key can keep working beside its replacement only when the account has no other live key. Otherwise revoke one first, or rotate with 0.
Revoke a Key
Section titled “Revoke a Key”Choose Revoke on the key, then Revoke again. It stops at once, for every call made with it, for good.
When a Key Is Refused
Section titled “When a Key Is Refused”A call with a key that is expired, revoked, of a deactivated account, of an organization that is suspended or archived, made while API keys are turned off, or from an address the key does not list, is refused with the reason. Sign-In, Tokens and API Keys lists them for whoever runs the script.
What Is Recorded
Section titled “What Is Recorded”Each change is in the activity log, by who made it: Service account created, Service account changed (its name and roles before and after), Service account deactivated, Service account reactivated, Service account key created, Service account key rotated and Service account key revoked. A key is named by its last four characters, never more.
A refused key is recorded as Service account key refused, with the reason and the address, at most once an hour for one key and one reason, so a script left running with a dead key does not fill the log.
What a Service Account Cannot Do
Section titled “What a Service Account Cannot Do”It cannot sign in, set up its own sign-in security, draft with the assistant, read notifications, keep saved views, use the live channel, give support access, or administer anything, service accounts included. Those are for people.