Performing Service Account Audit
Overview
Audit service accounts across enterprise infrastructure to identify orphaned, over-privileged, and non-compliant accounts. This skill covers discovery of service accounts in Active Directory, cloud platforms, databases, and applications, assessing privilege levels, identifying missing owners, and enforcing lifecycle policies.
Objectives
- Discover all service accounts across AD, cloud, databases, and applications
- Identify orphaned accounts with no valid owner or associated application
- Assess privilege levels and flag over-privileged service accounts
- Check for non-rotating passwords and weak authentication
- Map service account dependencies for safe remediation
- Generate compliance reports for SOX, PCI DSS, and HIPAA audits
Key Concepts
Service Account Types
- AD Service Accounts: Windows services, scheduled tasks, IIS app pools
- Managed Service Accounts (gMSA): AD-managed automatic password rotation
- Cloud IAM Service Accounts: AWS IAM roles/users, Azure service principals, GCP service accounts
- Database Service Accounts: Application connection accounts, replication accounts
- Application Service Accounts: API keys, bot accounts, integration accounts
Audit Dimensions
- Ownership: Who is responsible for this account?
- Purpose: What application/service uses this account?
- Privileges: What permissions does this account have?
- Authentication: How does this account authenticate (password, key, certificate)?
- Rotation: When was the credential last changed?
- Activity: When was this account last used?
Implementation Steps
Step 1: Discovery - Active Directory
- Query AD for all service accounts (filter by description, OU, naming convention)
- Identify accounts with
ServicePrincipalName set
- List accounts in privileged groups (Domain Admins, Enterprise Admins)
- Check for gMSA vs traditional service accounts
- Identify accounts with
PasswordNeverExpires flag
Step 2: Discovery - Cloud Platforms
- AWS: List IAM users with access keys, check last used date, identify unused roles
- Azure: Enumerate service principals, app registrations, managed identities
- GCP: List service accounts, check key age, identify unused permissions
Step 3: Assessment
- Flag accounts with admin/privileged group membership
- Check password age against rotation policy (90 days max)
- Identify accounts with no login activity in 90+ days
- Verify account ownership against CMDB/asset inventory
- Check for shared credentials (same password hash across accounts)
Step 4: Risk Classification
- Critical: Domain/cloud admin privileges, no password rotation
- High: Access to sensitive data, no identified owner
- Medium: Standard service permissions, password older than 90 days
- Low: Read-only access, managed credentials (gMSA, managed identity)
Step 5: Remediation
- Disable orphaned accounts after validation with application teams
- Convert traditional service accounts to gMSA where possible
- Rotate credentials older than policy threshold
- Reduce privileges to minimum required
- Assign owners and document dependencies
Security Controls
| Control |
NIST 800-53 |
Description |
| Account Management |
AC-2 |
Service account lifecycle |
| Account Review |
AC-2(3) |
Periodic review of accounts |
| Least Privilege |
AC-6 |
Minimum service account permissions |
| Authenticator Management |
IA-5 |
Service credential rotation |
| Audit Review |
AU-6 |
Review service account activity |
Common Pitfalls
- Disabling service accounts without verifying application dependencies first
- Not discovering service accounts outside of Active Directory
- Missing cloud service principals and managed identities
- Not checking for interactive logon rights on service accounts
- Failing to document dependencies before remediation
Verification
1---2name: performing-service-account-audit3description: Audit service accounts across enterprise infrastructure to identify orphaned, over-privileged, and non-compliant accounts. This skill covers discovery of service accounts in Active Directory, cloud pl4license: Apache-2.05---6# Performing Service Account Audit78## Overview9Audit service accounts across enterprise infrastructure to identify orphaned, over-privileged, and non-compliant accounts. This skill covers discovery of service accounts in Active Directory, cloud platforms, databases, and applications, assessing privilege levels, identifying missing owners, and enforcing lifecycle policies.1011## Objectives12- Discover all service accounts across AD, cloud, databases, and applications13- Identify orphaned accounts with no valid owner or associated application14- Assess privilege levels and flag over-privileged service accounts15- Check for non-rotating passwords and weak authentication16- Map service account dependencies for safe remediation17- Generate compliance reports for SOX, PCI DSS, and HIPAA audits1819## Key Concepts2021### Service Account Types221. **AD Service Accounts**: Windows services, scheduled tasks, IIS app pools232. **Managed Service Accounts (gMSA)**: AD-managed automatic password rotation243. **Cloud IAM Service Accounts**: AWS IAM roles/users, Azure service principals, GCP service accounts254. **Database Service Accounts**: Application connection accounts, replication accounts265. **Application Service Accounts**: API keys, bot accounts, integration accounts2728### Audit Dimensions29- **Ownership**: Who is responsible for this account?30- **Purpose**: What application/service uses this account?31- **Privileges**: What permissions does this account have?32- **Authentication**: How does this account authenticate (password, key, certificate)?33- **Rotation**: When was the credential last changed?34- **Activity**: When was this account last used?3536## Implementation Steps3738### Step 1: Discovery - Active Directory391. Query AD for all service accounts (filter by description, OU, naming convention)402. Identify accounts with `ServicePrincipalName` set413. List accounts in privileged groups (Domain Admins, Enterprise Admins)424. Check for gMSA vs traditional service accounts435. Identify accounts with `PasswordNeverExpires` flag4445### Step 2: Discovery - Cloud Platforms46- **AWS**: List IAM users with access keys, check last used date, identify unused roles47- **Azure**: Enumerate service principals, app registrations, managed identities48- **GCP**: List service accounts, check key age, identify unused permissions4950### Step 3: Assessment51- Flag accounts with admin/privileged group membership52- Check password age against rotation policy (90 days max)53- Identify accounts with no login activity in 90+ days54- Verify account ownership against CMDB/asset inventory55- Check for shared credentials (same password hash across accounts)5657### Step 4: Risk Classification58- **Critical**: Domain/cloud admin privileges, no password rotation59- **High**: Access to sensitive data, no identified owner60- **Medium**: Standard service permissions, password older than 90 days61- **Low**: Read-only access, managed credentials (gMSA, managed identity)6263### Step 5: Remediation64- Disable orphaned accounts after validation with application teams65- Convert traditional service accounts to gMSA where possible66- Rotate credentials older than policy threshold67- Reduce privileges to minimum required68- Assign owners and document dependencies6970## Security Controls71| Control | NIST 800-53 | Description |72|---------|-------------|-------------|73| Account Management | AC-2 | Service account lifecycle |74| Account Review | AC-2(3) | Periodic review of accounts |75| Least Privilege | AC-6 | Minimum service account permissions |76| Authenticator Management | IA-5 | Service credential rotation |77| Audit Review | AU-6 | Review service account activity |7879## Common Pitfalls80- Disabling service accounts without verifying application dependencies first81- Not discovering service accounts outside of Active Directory82- Missing cloud service principals and managed identities83- Not checking for interactive logon rights on service accounts84- Failing to document dependencies before remediation8586## Verification87- [ ] Service accounts inventoried across all platforms88- [ ] Each account has assigned owner89- [ ] Privileged service accounts documented with justification90- [ ] Password rotation compliance checked91- [ ] Orphaned accounts flagged for remediation92- [ ] gMSA migration candidates identified93- [ ] Compliance report generated