The term has a specific meaning on each platform. In Kubernetes, a ServiceAccount is a namespaced object that pods run as; the API server issues it tokens, and RoleBindings and ClusterRoleBindings decide what it may do. Every namespace has a default service account, used by any pod that names no other. In Google Cloud, a service account is a principal identified by an email address, which can hold IAM roles and, if allowed, user-managed keys. On AWS, the closest equivalents are IAM roles assumed by services and workloads, and on Azure, service principals and managed identities. Directory services and SaaS platforms have their own service or "bot" accounts.
How it is used in practice
Applications use service accounts to call APIs: a pod reads secrets from the Kubernetes API, a batch job writes to a cloud bucket, a deployment tool changes infrastructure. Platform teams create one service account per workload so that permissions and audit logs are specific, bind it to the narrowest role that works, and, in Kubernetes, link it to a cloud role through workload identity rather than mounting a cloud key. Security teams review service accounts like any other privileged identity: who owns it, what it can reach, and whether it is still used.
Common pitfalls
- Using
default. Permissions granted to a namespace's default account apply to every pod that forgot to name its own. - Automounted tokens. Kubernetes mounts a service-account token into pods by default; a pod that never calls the API still carries a credential an attacker can use.
- Cluster-admin bindings. A single ClusterRoleBinding to
cluster-adminturns one compromised pod into a compromised cluster. - Downloaded keys. Long-lived service-account keys exported from a cloud console tend to end up in repositories and laptops.
- Orphans. Accounts outlive the projects that created them and keep their access.
How TrustIvan relates to it
TrustIvan reads service accounts in two places. In AppSec, a connected Kubernetes cluster's collection records each service account's token-automounting setting and bound cloud identity, the RBAC bindings that grant cluster-admin, and which workloads run as which account; automounted tokens and cluster-admin bindings are posture findings. In NHI Security, the Kubernetes, Google Cloud and other connectors inventory service accounts as identities with owners, credentials and relationships, so access analysis can follow a workload to the account it runs as and on to the role that account is bound to, and policies such as stale_identity and unowned_identity apply. See Connectors.
Related terms
- Non-human identity (NHI) A non-human identity (NHI) is any identity that authenticates and acts without a person at the keyboard: a service account, IAM role, API key, OAuth application, CI/CD robot, workload identity or AI agent.
- Workload identity Workload identity is an identity issued to a running workload, such as a pod, function, VM or CI job, usually by the platform that runs it, and exchanged for short-lived credentials instead of a stored secret.
- Least privilege The principle of least privilege says that every user, process and machine identity should hold only the permissions it needs to do its job, and only for as long as it needs them.
- Credential rotation Credential rotation is the practice of replacing a secret, such as an API key, access key, token, password or certificate, with a new one and retiring the old, either on a schedule or in response to exposure.
- Machine identity A machine identity is the cryptographic credential, such as an X.509 certificate, an SSH key or a signed workload token, that a device, server, container or service uses to prove what it is to other systems.
Guides on Service account
- What Is Non-Human Identity (NHI) Security? Non-human identity (NHI) security governs service accounts, API keys and AI agents: the machine identities that now outnumber the people in most estates.
- Kubernetes Admission Control for Image Provenance Sign container images in CI, attest how they were built, and refuse unsigned or unpinned images at admission with Kyverno and ValidatingAdmissionPolicy.
- Least Privilege for CI/CD Identities: GitHub Actions OIDC Replace long-lived cloud keys in CI with GitHub Actions OIDC, then scope the trust policy, the role and GITHUB_TOKEN so a pipeline can do only its own job.
On the platform: Identity governance. All glossary terms