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.
When to Use
- When conducting security assessments that involve performing service account audit
- When following incident response procedures for related security events
- When performing scheduled security testing or auditing activities
- When validating security controls through hands-on testing
Prerequisites
- Familiarity with identity access management concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities
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?
Workflow
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-audit
3description: Audit service accounts across enterprise infrastructure to identify orphaned,
4 over-privileged, and non-compliant accounts. This skill covers discovery of service
5 accounts in Active Directory, cloud pl
6domain: cybersecurity
7subdomain: identity-access-management
8tags:
9- iam
10- identity
11- access-control
12- service-accounts
13- audit
14- governance
15version: '1.0'
16author: mahipal
17license: Apache-2.0
18nist_csf:
19- PR.AA-01
20- PR.AA-02
21- PR.AA-05
22- PR.AA-06
23mitre_attack:
24- T1078
25- T1110
26- T1556
27- T1098
28- T1069
29source: https://github.com/mukul975/Anthropic-Cybersecurity-Skills
30source_commit: 04450304b12645cb2b974ab96d28c0664758a88d
31metadata:
32 source: https://skillmd.com/skills/yanacuti1121/performing-service-account-audit
33---
34
35# Performing Service Account Audit
36
37## Overview
38Audit 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.
39
40
41## When to Use
42
43- When conducting security assessments that involve performing service account audit
44- When following incident response procedures for related security events
45- When performing scheduled security testing or auditing activities
46- When validating security controls through hands-on testing
47
48## Prerequisites
49
50- Familiarity with identity access management concepts and tools
51- Access to a test or lab environment for safe execution
52- Python 3.8+ with required dependencies installed
53- Appropriate authorization for any testing activities
54
55## Objectives
56- Discover all service accounts across AD, cloud, databases, and applications
57- Identify orphaned accounts with no valid owner or associated application
58- Assess privilege levels and flag over-privileged service accounts
59- Check for non-rotating passwords and weak authentication
60- Map service account dependencies for safe remediation
61- Generate compliance reports for SOX, PCI DSS, and HIPAA audits
62
63## Key Concepts
64
65### Service Account Types
661. **AD Service Accounts**: Windows services, scheduled tasks, IIS app pools
672. **Managed Service Accounts (gMSA)**: AD-managed automatic password rotation
683. **Cloud IAM Service Accounts**: AWS IAM roles/users, Azure service principals, GCP service accounts
694. **Database Service Accounts**: Application connection accounts, replication accounts
705. **Application Service Accounts**: API keys, bot accounts, integration accounts
71
72### Audit Dimensions
73- **Ownership**: Who is responsible for this account?
74- **Purpose**: What application/service uses this account?
75- **Privileges**: What permissions does this account have?
76- **Authentication**: How does this account authenticate (password, key, certificate)?
77- **Rotation**: When was the credential last changed?
78- **Activity**: When was this account last used?
79
80## Workflow
81
82### Step 1: Discovery - Active Directory
831. Query AD for all service accounts (filter by description, OU, naming convention)
842. Identify accounts with `ServicePrincipalName` set
853. List accounts in privileged groups (Domain Admins, Enterprise Admins)
864. Check for gMSA vs traditional service accounts
875. Identify accounts with `PasswordNeverExpires` flag
88
89### Step 2: Discovery - Cloud Platforms
90- **AWS**: List IAM users with access keys, check last used date, identify unused roles
91- **Azure**: Enumerate service principals, app registrations, managed identities
92- **GCP**: List service accounts, check key age, identify unused permissions
93
94### Step 3: Assessment
95- Flag accounts with admin/privileged group membership
96- Check password age against rotation policy (90 days max)
97- Identify accounts with no login activity in 90+ days
98- Verify account ownership against CMDB/asset inventory
99- Check for shared credentials (same password hash across accounts)
100
101### Step 4: Risk Classification
102- **Critical**: Domain/cloud admin privileges, no password rotation
103- **High**: Access to sensitive data, no identified owner
104- **Medium**: Standard service permissions, password older than 90 days
105- **Low**: Read-only access, managed credentials (gMSA, managed identity)
106
107### Step 5: Remediation
108- Disable orphaned accounts after validation with application teams
109- Convert traditional service accounts to gMSA where possible
110- Rotate credentials older than policy threshold
111- Reduce privileges to minimum required
112- Assign owners and document dependencies
113
114## Security Controls
115| Control | NIST 800-53 | Description |
116|---------|-------------|-------------|
117| Account Management | AC-2 | Service account lifecycle |
118| Account Review | AC-2(3) | Periodic review of accounts |
119| Least Privilege | AC-6 | Minimum service account permissions |
120| Authenticator Management | IA-5 | Service credential rotation |
121| Audit Review | AU-6 | Review service account activity |
122
123## Common Pitfalls
124- Disabling service accounts without verifying application dependencies first
125- Not discovering service accounts outside of Active Directory
126- Missing cloud service principals and managed identities
127- Not checking for interactive logon rights on service accounts
128- Failing to document dependencies before remediation
129
130## Verification
131- [ ] Service accounts inventoried across all platforms
132- [ ] Each account has assigned owner
133- [ ] Privileged service accounts documented with justification
134- [ ] Password rotation compliance checked
135- [ ] Orphaned accounts flagged for remediation
136- [ ] gMSA migration candidates identified
137- [ ] Compliance report generated