A service account used by several applications or hosts cannot be rotated, restricted or investigated cleanly, so finding those shared accounts and splitting them into one identity per workload is one of the most practical identity clean ups a team can do. This guide shows how to collect the evidence that an account is shared, map every consumer, and then split the account in stages without breaking production. It covers Active Directory service accounts in most detail, with the same method applied to cloud access keys and other non-human identities.
The framework view of this risk is covered in the OWASP NHI Top 10 NHI9 NHI Reuse Guide. This page is the task level procedure: how to find the accounts and what to do with them.
Key takeaways
- A shared account is one credential used by more than one application, host or team. It breaks rotation, least privilege and attribution at the same time.
- The best evidence comes from authentication logs: the same account authenticating from several source hosts or with several distinct process names or client agents.
- Configuration evidence (services, scheduled tasks, application pools, connection strings, secret store entries) tells you where the credential is stored, which logs alone cannot.
- Split in stages: create a new identity per consumer, move one consumer at a time, watch the old account's usage fall to zero, then disable before you delete.
- Where several instances of one application genuinely need one identity, a group managed service account (gMSA) gives a single principal without a shared, human known password.
Why shared service accounts are a problem
Service accounts tend to be shared for convenient reasons. A team creates one account for a project, then reuses it for the next job because it already has the right permissions. A vendor installation guide asks for "a service account" and the same one is typed into every server. A cloud access key is copied from one pipeline to another. Each step is small. The result is an identity nobody can safely change.
- Rotation becomes an outage. Changing the password or key means updating every consumer at once. If one is missed, it fails, so rotation is postponed indefinitely.
- Permissions accumulate. The account needs the union of every consumer's access. Each application gets far more than it needs.
- Attribution is lost. When the account does something unexpected, the logs show the account, not which application or host acted. Investigations stall.
- Blast radius grows. Compromise of any one host that stores the credential gives access to everything every other consumer can reach.
- Ownership blurs. Several teams use the account, so nobody owns it. See How to assign owners to orphaned service accounts.
Step 1: start from an inventory
You need a list of service accounts before you can test which are shared. If you do not have one, build it first using How to build a service account inventory from Active Directory, and add cloud access keys, service principals and database logins from their own consoles. For each account, record the name, the directory or platform, the stated owner, the stated purpose and when the credential last changed.
Prioritise accounts with high privilege, old passwords or keys, and vague descriptions such as "app service" or a project code. Those are the most likely to be shared and the most damaging if they are.
Step 2: collect authentication evidence
Authentication logs show where an account is actually used. The question for each account is simple: how many distinct sources use it?
Windows and Active Directory
Microsoft's documentation for event 4624 (generated by the Audit Logon subcategory) lists the fields that matter here. Under New Logon, the Account Name and Account Domain identify the service account. Under Network Information, the Workstation Name and Source Network Address show where a network logon came from. Under Process Information, the Process Name shows which executable used the account on the local host. The Logon Type tells you how: type 3 is Network, type 4 is Batch (used by batch servers such as scheduled work) and type 5 is Service, where the Service Control Manager started a service.
On domain controllers, event 4769 (Audit Kerberos Service Ticket Operations) is generated each time the Key Distribution Center receives a service ticket request. It records the Account Name, the Service Name requested, and the Client Address under Network Information. That gives a domain wide view of which hosts request tickets as a given account and for which services.
An illustrative analysis, to be adapted to your log platform:
- For each service account, count distinct Source Network Address values in 4624 events with Logon Type 3 over 30 days.
- For each service account, count distinct hosts recording 4624 with Logon Type 4 or 5, and list the distinct Process Name values.
- For each service account, count distinct Client Address and Service Name pairs in 4769 events.
- Flag any account where these counts exceed what its documented purpose explains.
A count above one is not proof of sharing by itself. A clustered application or a load balanced farm can legitimately use one identity from several hosts. The point is to compare the evidence with the documented purpose, and to ask questions where they do not match. The How to Detect Service Account Misuse guide covers the detection side of the same events.
Cloud access keys
For AWS, the CloudTrail record contents reference describes the fields to group on. The userIdentity element identifies the IAM identity that made the request. The sourceIPAddress field records the address the request came from, and userAgent records the agent used, such as the console, an AWS service, an SDK or the CLI. The eventSource and eventName fields show which service and action were called.
An illustrative analysis: for each long lived access key or IAM user, count distinct sourceIPAddress and userAgent values and list the services called. A key used from a build system, a developer laptop and a production workload, with three different SDK agents, is shared. Apply the same grouping to the sign in or audit logs of any other cloud or SaaS platform you use, using the field names from that platform's own documentation.
Step 3: collect configuration evidence
Logs show use. Configuration shows where the credential is stored, which you need to plan the split. Search these places for each candidate account:
- Windows services and scheduled tasks on every server, recording the "log on as" or "run as" account.
- Web server application pools and their configured identities.
- Database logins and linked server definitions. The How to audit SQL Server service accounts and logins guide covers this in depth.
- Application configuration and connection strings in repositories, deployment templates and configuration management.
- Secret store entries, where one vault path or secret may be read by several applications. Check the access policies on each entry, not only its value.
- CI/CD variables shared across projects or environments.
Build one row per consumer: account, host or workload, how it uses the credential (service, task, pool, connection string, pipeline), owning team, and the permissions that consumer actually needs. That table is your split plan.
Step 4: decide what each consumer should become
Not every consumer needs the same replacement. Choose per row.
| Situation | Replacement |
|---|---|
| Several Windows hosts run instances of the same service and need one principal | A group managed service account for that service only |
| A single Windows service on one host | A dedicated managed account or a dedicated service account for that service |
| Different applications using one account | One new identity per application, each with only its own permissions |
| Cloud workload using a copied access key | The platform's workload identity or role for that workload, with no static key |
| Pipeline using a shared key | A separate identity per pipeline, preferably federated rather than static |
| A human using the service account interactively | The human's own account with appropriate rights; remove interactive use from the service account |
Microsoft's gMSA overview explains why gMSAs fit the first row. A gMSA can be used across multiple servers, such as a server farm, and gives all service instances the same principal, while Windows manages the password so administrators do not need to synchronise it between instances. Member hosts retrieve the current password from a domain controller. That is "shared" in the narrow, intended sense: one service, several instances, a password no person knows. It is not a fix for several different applications sharing one account; give each application its own gMSA instead. For the conversion steps, see How to convert AD service accounts to gMSA.
Step 5: split the account in stages
The split procedure is the same whatever the platform. The aim is never to break more than one consumer at a time, and to be able to roll back each move.
- Freeze new use. Announce that the shared account is being retired, and add a control so it cannot be added to new services, tasks or pipelines. Record the date.
- Create the new identities. One per consumer row, named for the application and environment, with an owner recorded. Grant only the permissions that consumer needs, based on Step 3, not a copy of the shared account's rights.
- Move one consumer. Update its service, task, pool, connection string or pipeline to the new identity. Restart and test. Keep the old credential in place for that consumer until the test passes, so you can roll back.
- Confirm in the logs. Check that the moved consumer's host or workload now appears under the new identity and no longer under the shared account, using the same events you used in Step 2.
- Repeat for each consumer. Start with the lowest risk consumers to learn the process, then move the higher impact ones in change windows.
- Watch for stragglers. When you believe every consumer has moved, keep watching the shared account's authentication events for at least one full business cycle, including month end and any quarterly jobs. Any remaining use points to a consumer you missed.
- Rotate the shared credential. Change the password or deactivate the key. Anything still using it will now fail, and the failure tells you where it lives. The Rotating a Windows or Linux Service Account Password runbook covers the mechanics.
- Disable, then delete. Disable the account and keep it disabled for an agreed period before deletion, so that a missed consumer can be found and moved rather than restored blindly.
Step 6: tighten the new identities
Splitting gives you the chance to fix what the shared account got wrong.
- Least privilege per identity. Remove rights each consumer does not use. NIST SP 800-53 control AC-6 (Least Privilege) is the reference most audit teams will recognise.
- Restrict where each identity can log on. For Windows accounts, limit logon to the hosts that run the service and deny interactive and remote interactive logon. See How to detect interactive logons by service accounts.
- Record ownership and purpose on each new identity, in the directory and in your inventory, in line with AC-2 (Account Management).
- Set a rotation schedule for any remaining static credential, now that rotation affects one consumer only, in line with IA-5 (Authenticator Management).
- Baseline the new identity's behaviour. One source host, one process, one set of services. Any new source becomes a clear alert rather than noise.
Preventing new shared accounts
Without a prevention step, new shared accounts will appear within months.
- Require every service account request to name exactly one application, environment and owner. The Service Account Request Form Template gives a starting point.
- Run the Step 2 counts on a schedule and raise a ticket when an identity gains a new source host or agent outside its documented purpose.
- Scope secret store access policies to one application per secret, so a credential cannot be read by a second consumer without a change request.
- Include "one identity per workload" in architecture and change review checklists.
Common failure patterns
- Copying the shared account's permissions to every new identity. You end up with many over privileged accounts instead of one.
- Moving all consumers in one change. One missed dependency takes everything down and the split is abandoned.
- Deleting the old account straight away. A quarterly job fails weeks later with no easy way back.
- Using a gMSA for several different applications. It removes the human known password but keeps the shared permissions and the attribution problem.
- Trusting logs alone. A consumer that runs rarely may not appear in 30 days of events; configuration evidence catches it.
- No owner for the new identities. The same drift starts again.
Practitioner checklist
- Build or refresh the service account inventory, including cloud keys, service principals and database logins.
- For each account, count distinct source hosts, processes and agents from authentication logs over at least 30 days.
- Search services, tasks, application pools, connection strings, secret stores and CI/CD variables for each candidate account.
- Produce a consumer table with owner and needed permissions for every shared account.
- Create one identity per consumer, or a gMSA per multi instance Windows service, with only the permissions needed.
- Move consumers one at a time, confirm in logs, then rotate, disable and finally delete the shared account.
- Restrict logon locations, record owners and baseline each new identity.
- Schedule recurring checks so new sharing is caught early.
Standards and references
- Microsoft: 4624(S) An account was successfully logged on
- Microsoft: 4769(S, F) A Kerberos service ticket was requested
- Microsoft: Group Managed Service Accounts overview
- AWS: CloudTrail record contents
- OWASP: Non-Human Identities Top 10 2025
- NIST: SP 800-53 Rev. 5 (AC-2 Account Management, AC-6 Least Privilege, IA-5 Authenticator Management)
- MITRE ATT&CK: T1078 Valid Accounts
- CIS: CIS Controls v8.1
Related NHI Mgmt Group resources: OWASP NHI Top 10 NHI9 NHI Reuse Guide · How to build a service account inventory from Active Directory · How to convert AD service accounts to gMSA · Service Account Security Guide