liveBook · Manning

Service account

As explained in Effective Platform Engineering

A service account is a non-human identity used by software or automation to access resources and perform authorized actions.

A service account, sometimes called a machine user, is an identity used by automation rather than controlled by one person. It lets pipelines keep working when an employee changes teams or leaves. Where an organizational token is unavailable, using a personal access token instead can make automation depend on that person’s continuing access. Keep service-account credentials in a team secrets store so the identity is managed as a team resource. section 6.2.1

For cloud infrastructure pipelines, separate the identity from its permissions. In the AWS pattern, a service account has permission to assume a role; the role grants the actions a particular pipeline needs. Give each pipeline a dedicated role limited to the resources it manages. Keep corresponding roles consistent across platform accounts to reduce complexity without giving every pipeline the same access. section 6.4.4 section 6.5

Make the identity lifecycle part of the platform workflow:

  • During team onboarding, provision the team’s secrets space and permissions alongside any service account needed by its pipelines or deployment integrations. section 6.2.2
  • Start with the minimum service-account configuration needed to run infrastructure pipelines, then let those pipelines manage accounts, roles, and credentials. section 6.4.4 section 6.5
  • Automate credential rotation. In the AWS example, the secrets store holds the newest credential while the previous one remains valid until the next rotation, avoiding disruption to jobs already running. section 6.4.4
Figure 6.19 Our service account has two valid credentials at any given time. Only the latest credential is maintained in the secrets store, and the prior keys remain valid until the next rotation to prevent workloads and orchestration from failing due to the race condition of the key being changed while a job is already in process.
A screenshot of a computer

AI-generated content may be incorrect.

The rotation diagram shows why replacing a stored credential need not immediately invalidate the key an in-progress job may still be using. section 6.4.4

A service account is not the only automation identity pattern. OIDC trust can connect tools and cloud resources directly, but it takes additional integration work to make that experience self-service. Choose the pattern your tools support, and account for provisioning, permission boundaries, credential management, and rotation rather than leaving those tasks to individual developers. section 6.2.1 section 6.2.2

How Effective Platform Engineering covers it

How deep it goes
Explains ownership, AWS role assumption, least-privilege permissions, provisioning, and credential rotation through a pipeline implementation pattern.
Examples
Illustrates AWS IAM service accounts assuming environment-specific roles and a scheduled pipeline rotating credentials.
What it assumes
Assumes familiarity with cloud accounts, pipelines, and secrets management while defining service accounts as team-managed machine users.
What you can do after
Operate/configure it by giving pipelines dedicated roles, storing credentials in team secrets, and automating rotation.
How it connects
Connects service accounts to personal access tokens, OIDC trust, secrets management, IAM roles, and infrastructure pipelines.

Also explained in

Compare how 10 books explain service account →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Effective Platform Engineering. The section links point to the parts of the book it draws on.