When an Active Directory service account is misused, the obvious first move, disabling it, can take down the payroll run, the backup job or the line-of-business application that depends on it, while a careless password reset can leave the attacker a second way back in. This playbook covers the response to a compromised on-premises service account: a domain user account, managed service account or computer account that runs a Windows service, scheduled task, IIS application pool or application connection. It focuses on the parts that general identity playbooks treat in a line or two: mapping every dependency before you cut access, issuing an interim credential, reviewing service principal names (SPNs) and Kerberos delegation, and converting the account to a group managed service account (gMSA) once the incident is closed. It is written for identity engineers, Windows administrators and incident responders. See the Identity Incident Response Playbook for the overall structure and the Active Directory Domain Compromise Response Playbook if the domain itself is no longer trusted.
Key takeaways
- Map before you cut. A service account rarely runs one thing: find every host, service, task, application pool, connection string and SPN that uses it before you disable it or change its password.
- Contain in layers. Restrict where the account can sign in and strip its group memberships first, then rotate the password in a controlled window, then disable, so the business keeps running while the attacker loses reach.
- Review SPNs and delegation as attack surface. Attackers add SPNs to make an account roastable and write delegation attributes to gain impersonation rights; both survive a password reset unless you remove them.
- Treat everything the account could read as exposed. Secrets, connection strings and other credentials the account could reach need rotation too, because an attacker with the account had the same access.
- Close the incident with a better account type. Moving the service to a gMSA, where Windows manages the password, removes the shared, never-rotated password that made the compromise possible.
How the incident shows up
Service account compromise is often found indirectly, because the account is expected to authenticate all day. The signals worth acting on are deviations from its known pattern rather than activity itself. Microsoft's guidance on governing on-premises service accounts recommends monitoring sign-in data against the account's intended usage, alerting on anomalous use and auditing account changes with the Audit Directory Service Changes subcategory.
| Signal | Where to look | Why it matters |
|---|---|---|
| Interactive or Remote Desktop sign-in by the account | Event 4624 on member servers and workstations, logon types 2 (interactive) and 10 (remote interactive) | Most service accounts should only use service (5) or batch (4) logons; an interactive session suggests a person is using the password. See How to detect interactive logons by service accounts. |
| Kerberos service tickets for the account requested with RC4 | Event 4769 on domain controllers, Ticket Encryption Type 0x17 | Microsoft's event reference says any encryption type other than 0x11 or 0x12 (AES) is worth alerting on for modern systems; RC4 requests against SPN accounts are a common Kerberoasting signal (ATT&CK T1558.003). |
| Ticket requests from unexpected client addresses | Event 4769 Client Address field | The account normally authenticates from a short list of application servers; requests from a workstation subnet or VPN pool are anomalous. |
| New SPN, delegation flag or group membership on the account | Event 5136 (attribute changes such as servicePrincipalName, userAccountControl, msDS-AllowedToDelegateTo), event 4738 (user account changed), events 4728/4732/4756 (member added to a security group) | These are persistence or privilege escalation moves (ATT&CK T1098 Account Manipulation). |
| Password reset by an unexpected principal | Event 4724 (password reset attempt) | An attacker with rights over the object may reset the password to take the account over outright. |
| Access to data or systems outside the application's scope | File server auditing, SQL Server audit, application logs | A reporting service account opening HR shares or connecting to unrelated databases shows the credential is being used for something else. |
Event 5136 is only written when the object's SACL audits writes to the changed attribute, so confirm the auditing exists before relying on its absence. Microsoft notes that one change usually produces a Value Deleted and a Value Added event that share a Correlation ID, which is how you recover the previous value of a modified attribute. See the Active Directory Security Monitoring and Event IDs Guide for the wider event set.
Triage questions
Answer these in the first hour. They decide whether this is a contained service account incident or the start of a domain compromise.
- What kind of account is it? A domain user account with a static password, a standalone or group managed service account, or a computer account. Microsoft notes that when LocalSystem reaches the network it uses the computer account, and you cannot tell from that which service on the host made a change, which limits what logs can show.
- Is it privileged? Check direct and nested membership of Domain Admins, Enterprise Admins, Administrators, Account Operators, Backup Operators and Server Operators, plus local Administrators on servers. A privileged service account means the attacker may already hold the domain: escalate to the domain compromise playbook. See How to find service accounts with Domain Admin rights.
- How was the credential obtained? Kerberoasting of an SPN account, a password found in a script, share or configuration file, theft from a compromised host's memory, or a password reset by someone with write rights over the object. The route decides what else must be rotated.
- What does it have SPNs and delegation for? Record servicePrincipalName, the userAccountControl flags for unconstrained delegation (0x80000) and protocol transition (0x1000000), msDS-AllowedToDelegateTo, and whether any resource lists it in msDS-AllowedToActOnBehalfOfOtherIdentity.
- What could it read? Shares, databases, vaults, configuration files and other credentials. Every secret in that list is treated as exposed.
- Who owns it? Find the application owner and the person who knows where the password is configured. Microsoft recommends recording an owner in the description attribute; if nobody is recorded, start with the change history and the application team. See How to assign owners to orphaned service accounts.
Map every dependency before you act
This is the step that separates a controlled response from an outage. The dependency map is also your rollback plan: if a service fails after containment, the map tells you where to put the interim credential. The live Rotating a Windows or Linux Service Account Password covers discovery queries in detail for routine rotation; in an incident you run the same discovery under time pressure, and you add sign-in evidence to catch uses nobody documented.
| Dependency type | How to find it | What breaks if missed |
|---|---|---|
| Windows services | Query each server's service configuration for the account in the "Log On As" field (service start name); see How to find Windows services running as domain accounts | Service fails to start after the next reboot or restart, often days later |
| Scheduled tasks | Task Scheduler "run as" user on every server, including tasks set to run whether or not the user is logged on | Overnight jobs such as exports, backups and reports fail silently |
| IIS application pools | Application pool identity in IIS configuration | Web application returns errors once the pool recycles |
| Application and connection strings | Configuration files, ODBC data sources, middleware and integration platforms, SQL Server linked servers | Integrations break and may lock the account out with repeated bad passwords |
| SPNs and Kerberos clients | servicePrincipalName on the account; client applications that request tickets for those SPNs | Kerberos authentication to the service fails or falls back to NTLM |
| Undocumented use | Event 4624 logons and event 4769 ticket requests for the account over the last 30 to 90 days, grouped by source host | A forgotten host keeps the old password in use, or keeps failing and locking the account |
Compare the documented list with the sign-in evidence. A host that appears in the logs but not in the documentation is either an undocumented dependency or the attacker's foothold, and you must find out which before you proceed. Cloudflare's 2023 incident shows the cost of assuming: credentials believed unused were left unrotated after an earlier breach and were later used to get in. See the Cloudflare Thanksgiving Breach 2023.
Containment priorities
Order the steps so each one reduces attacker reach without needing the next.
- Remove privilege first. Take the account out of privileged groups it does not need for the service to run. Microsoft's guidance on user-based service accounts is to remove them from privileged groups and grant only the rights the service needs, consulting the vendor. This is usually the least disruptive change with the largest effect.
- Restrict where it can sign in. Set the logon workstations restriction (LogonWorkstations, the "Log On To" list) to the application servers from the dependency map, and apply "Deny log on locally" and "Deny log on through Remote Desktop Services" user rights to the account on servers through Group Policy. A stolen password then only works from hosts you control.
- Remove attacker-added SPNs and delegation. Compare current values with the last known good state (from 5136 history, backups or documentation) and remove anything added. Removing an unexpected SPN takes away the roasting target; removing delegation takes away impersonation rights.
- Issue an interim credential. Generate a long random password, store it in your privileged access vault, update every dependency from the map in one coordinated window, then reset the account password. Ask the service owner to restart services so no process keeps running with a cached session.
- Purge existing tickets. Kerberos tickets already issued stay valid until they expire. Restart the dependent services and purge tickets on the hosts that used the account so the next authentication uses the new password.
- Disable only when the service is replaced. If the account is no longer needed, or the attacker kept access despite the steps above, disable it and accept the outage. Microsoft's decommissioning steps are to remove permissions, check related accounts, prevent sign-in, confirm the account is unused, keep it disabled for a set period and then delete it.
Rollback: if a dependency fails, set the interim credential on it from the vault rather than reverting the password. Never reinstate the compromised password.
Eradication: SPN, delegation and access review
Containment stops the current use. Eradication removes whatever the attacker built with the account's rights. Work through the account itself, then the objects and systems it could change.
| Check | Attribute or location | What to look for | Action |
|---|---|---|---|
| SPNs | servicePrincipalName | SPNs that no client uses, or added during the incident window | Remove; keep only SPNs the application owner confirms |
| Unconstrained delegation | userAccountControl TRUSTED_FOR_DELEGATION (0x80000) | Any service account or server with this flag | Remove, or replace with constrained or resource-based constrained delegation |
| Constrained delegation and protocol transition | msDS-AllowedToDelegateTo; userAccountControl TRUSTED_TO_AUTH_FOR_DELEGATION (0x1000000) | Targets beyond what the application needs, especially domain controller services | Trim to the documented back-end SPNs |
| Resource-based constrained delegation | msDS-AllowedToActOnBehalfOfOtherIdentity on computer and service objects | The compromised account, or an attacker-created computer account, listed as allowed to delegate | Remove entries; check who had write access to the attribute |
| Rights over other objects | ACLs on users, groups, OUs and GPOs | The account granted GenericAll, WriteDACL, WriteOwner or reset password rights, or rights it should not have | Remove; see the Active Directory ACL and Delegation Hygiene Guide |
| New accounts and persistence | Objects created by the account; scheduled tasks and services created on hosts it reached | Computer accounts, users, tasks or services created in the incident window | Remove after evidence is preserved |
| Reachable secrets | Shares, databases, configuration files, vault paths | Credentials the account could read | Rotate them; treat them as compromised |
Microsoft's resource-based constrained delegation documentation explains that control of that delegation sits with the resource's owner rather than domain administrators, which is why write access to msDS-AllowedToActOnBehalfOfOtherIdentity on computer objects deserves a check during eradication. If the account had rights that reach domain controllers, directory replication (ATT&CK T1003.006 DCSync) or Kerberos ticket forging (T1558.001 Golden Ticket) become possible, and the response moves to the domain compromise playbook, including a krbtgt reset plan.
The Dropbox Sign incident in 2024 shows why reachable secrets matter: an attacker took over a back-end service account through a configuration tool and used its production rights to reach API keys, OAuth tokens and MFA data. See the Dropbox Sign Breach 2024.
Recovery: move the service to a gMSA
Recovery is not complete when the interim password is in place, because the conditions that allowed the compromise, a human-known password that rarely changes, are still there. Microsoft's on-premises service account guidance ranks the options: use a gMSA wherever possible, a standalone managed service account (sMSA) if not, then a computer account, and a domain user account only when none of these is supported.
| Account type | Password handling | Use after an incident when |
|---|---|---|
| Group managed service account (gMSA) | Managed by Windows; the domain controller computes it from Key Distribution Service keys and authorised hosts retrieve it | The service supports gMSA, including services on several servers or behind a load balancer |
| Standalone managed service account (sMSA) | Managed by Windows, single server | gMSA is not possible and the service runs on one server |
| Computer account | Managed by the host | The service runs as LocalSystem or Network Service and needs network access, accepting that you cannot tell which service on the host acted |
| Domain user account | Static, set by an administrator | Only when the application cannot use the options above; vault the password, rotate it on a schedule, restrict logon |
A practical conversion sequence, after the application vendor confirms gMSA support:
- Confirm prerequisites. A Key Distribution Services root key must exist (its creation is recorded as event 4004 in the KdsSvc Operational log), and Microsoft states the domain and forest functional levels should be Windows Server 2012 or later.
- Create a security group for the hosts allowed to use the account, and create the gMSA with that group in PrincipalsAllowedToRetrieveManagedPassword. Set the password change interval at creation: Microsoft states it defaults to 30 days and can only be set when the gMSA is created.
- Configure encryption types. Microsoft notes that every system that logs on as or installs a gMSA must support the Kerberos encryption types gMSA requires, so check this on each host first.
- Install and test on each host with Install-ADServiceAccount and Test-ADServiceAccount, then change the service, task or application pool identity to the gMSA.
- Move SPNs from the old account to the gMSA, and grant the gMSA only the rights the service needs.
- Pilot, then retire the old account. Run on the gMSA through a full business cycle (month end, backup rotation), watch for any remaining sign-ins by the old account, then disable and later delete it.
See How to convert AD service accounts to gMSA for step-by-step commands and the Group Managed Service Accounts (gMSA) Guide for design choices. Where a gMSA is not possible, apply Microsoft's governance controls: account expiry, the "can't change password" flag, logon workstation restrictions and periodic owner attestation.
Evidence to preserve
Collect before you remove attacker changes, and keep hashes of exported files; this evidence also feeds root cause analysis (CSF 2.0 RS.AN-03).
- Directory state: an export of the account object (all attributes, including servicePrincipalName, userAccountControl, delegation attributes, memberOf, pwdLastSet and lastLogonTimestamp) taken before any change, plus object metadata showing when each attribute last changed.
- Domain controller logs: events 4768, 4769, 4771, 4624, 4724, 4738, 5136 and group membership events for the account across every domain controller, for at least the period since the suspected credential theft.
- Host logs: 4624 and 4688 (process creation, if enabled) on hosts where the account signed in, plus PowerShell logs and scheduled task and service creation events.
- Configuration evidence: the files or scripts where the password was found, with their access history.
- Change log: every containment action with its time, so investigators can separate attacker changes from responder changes.
Notification triggers
A service account incident becomes a notifiable event because of what the account could reach, not because of the account itself. Use the access review from triage to decide.
- Personal data: if the account could read personal data, assess whether there was a personal data breach. Under UK GDPR and EU GDPR Article 33, a notifiable breach is reported to the supervisory authority without undue delay and, where feasible, within 72 hours of becoming aware of it.
- Sector and contract duties: check sector regulators, cyber incident reporting rules that apply to your organisation, and customer contracts with notification clauses. Record the decision and the reasoning even when you decide not to notify.
- Downstream credentials: if secrets the account could read belong to partners or customers, tell those owners so they can rotate.
Detection and measurement
After the incident, keep watching the account and measure whether the programme is reducing exposure.
- Old account sign-in attempts: any 4624 or 4769 for the retired account after cutover. Target: zero after the pilot period.
- Time to dependency map: hours from detection to a confirmed dependency list. A long time here means the inventory is weak.
- Service accounts with SPNs and static passwords: count, trending down as accounts move to gMSA.
- Accounts with unconstrained delegation: count outside domain controllers. Target: zero.
- RC4 service ticket requests: share of 4769 events with encryption type 0x17, trending to zero.
- Service accounts with an owner and attestation date: percentage of the inventory.
Framework mapping
| Framework | Reference | Where it applies in this playbook |
|---|---|---|
| MITRE ATT&CK | T1078.002 Domain Accounts; T1558.003 Kerberoasting; T1098 Account Manipulation; T1550.003 Pass the Ticket | How the account is obtained, abused and modified |
| NIST CSF 2.0 | RS.MI-01 Incidents are contained; RS.AN-03 analysis and root cause; RC.RP-01 recovery plan executed; PR.AA-01 identities and credentials managed | Containment, evidence, recovery and the gMSA move |
| NIST SP 800-53 Rev. 5 | IR-4 Incident Handling; AC-2 Account Management; AC-6 Least Privilege; IA-5 Authenticator Management; AU-6 Audit Record Review | Response process, account restrictions, password handling and log review |
Common failure patterns
- Disabling first, mapping later. The account is disabled at 2am, the ERP integration fails, the business forces a re-enable with the old password, and the attacker keeps access.
- Rotating the account but not what it could read. The password changes, but the database credentials and API keys in files the account could open stay the same.
- Leaving attacker-added SPNs and delegation in place. A new password stops current use, but the attacker can roast the account again or impersonate users through delegation written during the incident.
- Trusting "unused" without evidence. Credentials skipped because someone believed they were unused, as in the Cloudflare Thanksgiving Breach 2023, become the way back in.
Practitioner checklist
- Confirm account type, privilege and owner, and escalate to the domain compromise playbook if the account was privileged.
- Export the account object and pull domain controller and host logs before changing anything.
- Build the dependency map from configuration and from 30 to 90 days of 4624 and 4769 evidence; reconcile the two.
- Remove unneeded privileged group membership and restrict logon to the mapped servers.
- Remove SPNs and delegation settings that are not confirmed by the application owner.
- Issue a vaulted interim password, update all dependencies in one window, reset, restart services and purge tickets.
- Rotate every secret the account could read, and review objects and ACLs it could change.
- Convert the service to a gMSA (or sMSA), pilot through a full business cycle, then retire the old account.
- Assess notification duties from what the account could reach and record the decision.
- Add the account and its replacement to monitoring and track the metrics above.
Standards and references
- NIST: SP 800-61 Rev. 3, Incident Response Recommendations and Considerations for Cybersecurity Risk Management
- CISA and partners: Detecting and Mitigating Active Directory Compromises
- Microsoft: Secure on-premises service accounts
- Microsoft: Govern on-premises service accounts
- Microsoft: Secure user-based service accounts in Active Directory
- Microsoft: Get started with group managed service accounts
- Microsoft: Kerberos constrained delegation overview
- Microsoft: Event 4769, a Kerberos service ticket was requested
Related NHI Mgmt Group resources: Identity Incident Response Playbook · Rotating a Windows or Linux Service Account Password · How to Detect Service Account Misuse · Kerberoasting and AS-REP Roasting Defence Guide · Active Directory Domain Compromise Response Playbook