TL;DR
- A service account is a directory identity created for an application, not a person.
- Active Directory, Linux, and databases are the three classical hosts; cloud platforms add their own equivalents.
- The top risks: stale accounts, shared passwords, over-privilege, human use of service accounts (OWASP NHI10).
- Mature governance combines inventory, ownership, scheduled rotation, and migration toward workload identity where possible.
Definition
A service account is a user-like identity created in a directory (Active Directory, LDAP, Linux, a database, or a cloud IAM system) for the purpose of authenticating an application, daemon, or automated process, not a human user. It is the oldest category of non-human identity in most enterprises.
Varieties of service account
- Active Directory service accounts, a large category in Windows-centred enterprises. Includes "managed service accounts" (MSA) and "group managed service accounts" (gMSA), both of which handle password rotation automatically and are a substantial improvement over plain AD service accounts.
- Linux service accounts, local Unix accounts or directory-integrated LDAP accounts under which daemons run. Local daemon accounts usually have no interactive login at all; where remote access is needed, an SSH key pair is the usual credential.
- Database service accounts, accounts in Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, or Snowflake that applications use for database access. High risk because of the data access they grant.
- Cloud-native service accounts, Google Cloud service accounts, AWS IAM roles, Azure service principals and managed identities.
- Kubernetes service accounts, covered under service accounts in our taxonomy; they are service accounts scoped to a Kubernetes cluster.
- SaaS "integration users", a user-style account in a SaaS platform (Salesforce, ServiceNow, Workday) created for an integration. Similar pattern, different host.
Top service-account risks
Risk numbers refer to the OWASP Non-Human Identities Top 10 (2025).
1. Stale accounts (OWASP NHI1)
Service accounts created for applications that no longer exist. Each is a live credential that could be compromised and used.
2. Shared or static passwords (OWASP NHI7)
A service account password set at creation and never changed. Found in configuration files, runbooks, Slack messages, and password managers across the organisation. Password rotation is often avoided because "the application will break", which it will, unless the rotation is choreographed with the application's credential-retrieval pattern.
3. Over-privilege (OWASP NHI5)
Service accounts often accumulate permissions because "it's easier to grant admin and move on." In Active Directory specifically, Domain Admin membership for a service account is a common path from application compromise to full domain compromise.
4. Human use of service accounts (OWASP NHI10)
Humans logging in as service accounts to perform operational tasks. This breaks the identity principle (who did what, when) and exposes the service-account credential to human-access risk patterns like typing it into the wrong window.
5. Password exposure in code and configs
Service-account passwords hardcoded in code, embedded in scripts, or sitting in plaintext configuration files, the secret-leakage pattern (OWASP NHI2) applied to the classical category.
A service-account governance programme
The same seven capabilities from the NHI management page apply, with service-account specifics. As a control baseline, account management control AC-2 in NIST SP 800-53 Rev. 5 applies to service accounts as it does to any system account.
- Inventory: extract service-account lists from Active Directory (filter by naming convention, by password-never-expires flag, by specific OU), from /etc/passwd on Linux hosts, from database user catalogues, from SaaS integration-user lists. Reconcile with a CMDB of applications.
- Ownership: every service account has a named individual owner, with the owning team recorded for continuity. Orphaned ones are decommissioned. The naming convention encodes the owning application.
- Credentials: passwords move to a centralised secret store; rotation is scheduled and automated. On Active Directory, adopt gMSA where supported; for everything else, secret-store integration handles rotation.
- Privileges: right-sized at creation; quarterly review for accounts that can write to production or cross a third-party boundary, annual for low-privilege internal ones; remove local admin, remove Domain Admin, remove broad database roles.
- Lifecycle: decommissioning tied to application retirement in the CMDB. Inactive service accounts (no logon in 90 days) are flagged.
- Monitoring: behavioural baselining. A service account that has logged on from the same server for two years and suddenly logs on from elsewhere is a high-confidence signal.
- Human-use prevention: block interactive logon for service accounts; break-glass human use is logged separately.
Active Directory service account specifics
AD has specific features that matter for service-account governance:
- Managed Service Accounts (MSA) and Group Managed Service Accounts (gMSA), available from Windows Server 2008 R2 and Windows Server 2012 respectively. Windows manages the password for you and changes it periodically (Microsoft, Group Managed Service Accounts overview). This is the recommended default for any new Windows service-account use case that supports it.
- "Password never expires" flag, historically set to avoid breakage, this creates permanently stale credentials. Inventory queries that filter by this flag often surface the highest-risk accounts in the environment.
- Service Principal Names (SPNs), the mechanism by which Kerberos authentication binds a service to an account. Any account with an SPN and a weak, static password is exposed to offline password cracking (Kerberoasting).
- Tiered administration model, Microsoft's guidance for separating accounts by privilege tier to prevent credential-theft pivots, on which Microsoft's enterprise access model builds.
Cloud service accounts
Cloud providers call them different things:
- Google Cloud Platform, explicitly called "service accounts"; they have email-like identifiers (myapp@project.iam.gserviceaccount.com) and can use JSON key files or attached identity tokens.
- AWS, the most-analogous concept is an IAM role, assumed by a workload. AWS also has IAM users (a human-like construct that can be used for applications but is discouraged).
- Azure, "service principals" for app-based identities and "managed identities" for workload-bound identities. Managed identities are the recommended modern default.
Cloud providers steer customers toward short-lived credentials and workload-bound identities, which removes some of the classical failure modes. The others (over-privilege, orphans, unused identities) still apply.
Migrating off service accounts
Where possible, the modern pattern is to replace service accounts with workload identities, identities bound cryptographically to the running workload rather than carried as a static credential. The migration paths:
- Windows workloads → gMSA, then → Workload Identity Federation to Azure / Entra ID
- Linux workloads → SPIFFE/SPIRE issuing SVIDs, or cloud-native workload identity federation
- Kubernetes workloads → service account token projection with OIDC-based federation to cloud IAM
- Database access → short-lived credentials issued by HashiCorp Vault or cloud-native secrets managers
- SaaS integrations → OAuth (service-to-service patterns) in place of shared integration users where the SaaS supports it
Migration is slow and pragmatic. Expect to run hybrid models for years. The important thing is to stop creating new static-credential service accounts for use cases that have a workload-identity alternative.
Frequently asked questions
What is service account management?
Service account management is the practice of controlling accounts used by applications, scripts and services rather than by people: knowing which exist, who is accountable for each, what each may access, and how their credentials are issued and rotated. It is the longest-established part of non-human identity governance, and a natural place to start an NHI programme because service accounts are already visible in directories.
How do you audit service accounts?
Start with an inventory export that includes owner, last-use timestamp, privilege level and credential age. Then run four tests: sample leavers from the last twelve months and trace the accounts they created, list accounts with no recorded use in ninety days, list accounts with non-expiring credentials, and check whether service accounts appear in access-review campaigns at all.
What is a good service account naming convention?
Encode the information a future responder needs when the creator is unavailable: a clear non-human prefix so the account is never mistaken for a person, the owning team or system, and the purpose. Avoid encoding environment or privilege level in the name, because those change while names rarely do. The convention matters less than enforcing it at creation, since retrofitting names across an existing estate is rarely worth the disruption.
What are the alternatives to service accounts?
For workloads, runtime-attested identity is the modern alternative: cloud workload identity federation, Kubernetes projected tokens, and SPIFFE-issued SVIDs all let a workload prove what it is without holding a static credential. For scheduled tasks and integrations, managed identities and short-lived tokens issued on demand replace the standing account. The general direction is away from accounts that persist and toward credentials that are minted per use.
Which controls matter most for service account governance?
Five that consistently matter: every account has a named individual owner rather than a team, every credential has an expiry, privileges are scoped to observed usage rather than requested usage, unused accounts are retired automatically past a defined threshold, and exceptions are registered with an approver and a review date. The fifth is the one that turns a policy breach into a governance decision.
Are service accounts the same as non-human identities?
No. A service account is one type of non-human identity, but the NHI umbrella also covers service principals, cloud IAM roles, workload identities, OAuth applications, CI/CD identities and AI agents, together with the API keys, tokens, certificates and SSH keys that prove them. Treating the two as synonymous is a common scoping error, because it leaves the other categories outside the programme.
Which CIS Control covers service accounts?
CIS Controls v8.1 Safeguard 5.5 asks for an inventory of service accounts that records at least the department owner, review date and purpose, with reviews at least quarterly to confirm every active account is authorised. Safeguard 5.1 includes service accounts in the general account inventory, 4.7 covers default accounts, and Control 6 applies access granting, revocation and least privilege to service accounts.
What does UK NCSC guidance say about service accounts?
The NCSC's zero trust architecture design principles (guidance, version 1.1, reviewed 16 January 2026) say an identity can represent a user, a service or a device, and each should be uniquely identifiable. A service should have its own unique identity, for example a unique certificate per service used for mutual TLS, with minimum privileges. When it acts for a user, each action should use an access token limited in scope and time.
From the publisher
HumanAudit, which publishes this site, is preparing the NHI Governance pack: an NHI policy, ownership register, lifecycle procedures and one control set mapped, as our interpretation, to PCI DSS v4.0.1, ISO/IEC 27001:2022, NIS2 and DORA. Planned for March 2027; not yet on sale, and no price has been published.