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: none-43description: 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 pl4domain: cybersecurity5subdomain: identity-access-management6tags: [iam, identity, access-control, service-accounts, audit, governance]7version: "1.0"8author: mahipal9license: MIT10metadata:11 source: https://skillmd.com/skills/njones17/none-412---1314# Performing Service Account Audit1516## Overview17Audit 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.1819## Objectives20- Discover all service accounts across AD, cloud, databases, and applications21- Identify orphaned accounts with no valid owner or associated application22- Assess privilege levels and flag over-privileged service accounts23- Check for non-rotating passwords and weak authentication24- Map service account dependencies for safe remediation25- Generate compliance reports for SOX, PCI DSS, and HIPAA audits2627## Key Concepts2829### Service Account Types301. **AD Service Accounts**: Windows services, scheduled tasks, IIS app pools312. **Managed Service Accounts (gMSA)**: AD-managed automatic password rotation323. **Cloud IAM Service Accounts**: AWS IAM roles/users, Azure service principals, GCP service accounts334. **Database Service Accounts**: Application connection accounts, replication accounts345. **Application Service Accounts**: API keys, bot accounts, integration accounts3536### Audit Dimensions37- **Ownership**: Who is responsible for this account?38- **Purpose**: What application/service uses this account?39- **Privileges**: What permissions does this account have?40- **Authentication**: How does this account authenticate (password, key, certificate)?41- **Rotation**: When was the credential last changed?42- **Activity**: When was this account last used?4344## Implementation Steps4546### Step 1: Discovery - Active Directory471. Query AD for all service accounts (filter by description, OU, naming convention)482. Identify accounts with `ServicePrincipalName` set493. List accounts in privileged groups (Domain Admins, Enterprise Admins)504. Check for gMSA vs traditional service accounts515. Identify accounts with `PasswordNeverExpires` flag5253### Step 2: Discovery - Cloud Platforms54- **AWS**: List IAM users with access keys, check last used date, identify unused roles55- **Azure**: Enumerate service principals, app registrations, managed identities56- **GCP**: List service accounts, check key age, identify unused permissions5758### Step 3: Assessment59- Flag accounts with admin/privileged group membership60- Check password age against rotation policy (90 days max)61- Identify accounts with no login activity in 90+ days62- Verify account ownership against CMDB/asset inventory63- Check for shared credentials (same password hash across accounts)6465### Step 4: Risk Classification66- **Critical**: Domain/cloud admin privileges, no password rotation67- **High**: Access to sensitive data, no identified owner68- **Medium**: Standard service permissions, password older than 90 days69- **Low**: Read-only access, managed credentials (gMSA, managed identity)7071### Step 5: Remediation72- Disable orphaned accounts after validation with application teams73- Convert traditional service accounts to gMSA where possible74- Rotate credentials older than policy threshold75- Reduce privileges to minimum required76- Assign owners and document dependencies7778## Security Controls79| Control | NIST 800-53 | Description |80|---------|-------------|-------------|81| Account Management | AC-2 | Service account lifecycle |82| Account Review | AC-2(3) | Periodic review of accounts |83| Least Privilege | AC-6 | Minimum service account permissions |84| Authenticator Management | IA-5 | Service credential rotation |85| Audit Review | AU-6 | Review service account activity |8687## Common Pitfalls88- Disabling service accounts without verifying application dependencies first89- Not discovering service accounts outside of Active Directory90- Missing cloud service principals and managed identities91- Not checking for interactive logon rights on service accounts92- Failing to document dependencies before remediation9394## Verification95- [ ] Service accounts inventoried across all platforms96- [ ] Each account has assigned owner97- [ ] Privileged service accounts documented with justification98- [ ] Password rotation compliance checked99- [ ] Orphaned accounts flagged for remediation100- [ ] gMSA migration candidates identified101- [ ] Compliance report generated