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
Source: mukul975/Anthropic-Cybersecurity-Skills → skills/performing-service-account-audit/SKILL.md
1---
2name: performing-service-account-audit
3description: "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 pl"
4category: security-and-compliance
5source_repo: mukul975/Anthropic-Cybersecurity-Skills
6source_path: "skills/performing-service-account-audit/SKILL.md"
7source_url: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/HEAD/skills/performing-service-account-audit/SKILL.md
8metadata:
9 source: https://skillmd.com/skills/thedixitjain/performing-service-account-audit
10---
11
12# Performing Service Account Audit
13
14## Overview
15Audit 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.
16
17
18## When to Use
19
20- When conducting security assessments that involve performing service account audit
21- When following incident response procedures for related security events
22- When performing scheduled security testing or auditing activities
23- When validating security controls through hands-on testing
24
25## Prerequisites
26
27- Familiarity with identity access management concepts and tools
28- Access to a test or lab environment for safe execution
29- Python 3.8+ with required dependencies installed
30- Appropriate authorization for any testing activities
31
32## Objectives
33- Discover all service accounts across AD, cloud, databases, and applications
34- Identify orphaned accounts with no valid owner or associated application
35- Assess privilege levels and flag over-privileged service accounts
36- Check for non-rotating passwords and weak authentication
37- Map service account dependencies for safe remediation
38- Generate compliance reports for SOX, PCI DSS, and HIPAA audits
39
40## Key Concepts
41
42### Service Account Types
431. **AD Service Accounts**: Windows services, scheduled tasks, IIS app pools
442. **Managed Service Accounts (gMSA)**: AD-managed automatic password rotation
453. **Cloud IAM Service Accounts**: AWS IAM roles/users, Azure service principals, GCP service accounts
464. **Database Service Accounts**: Application connection accounts, replication accounts
475. **Application Service Accounts**: API keys, bot accounts, integration accounts
48
49### Audit Dimensions
50- **Ownership**: Who is responsible for this account?
51- **Purpose**: What application/service uses this account?
52- **Privileges**: What permissions does this account have?
53- **Authentication**: How does this account authenticate (password, key, certificate)?
54- **Rotation**: When was the credential last changed?
55- **Activity**: When was this account last used?
56
57## Workflow
58
59### Step 1: Discovery - Active Directory
601. Query AD for all service accounts (filter by description, OU, naming convention)
612. Identify accounts with `ServicePrincipalName` set
623. List accounts in privileged groups (Domain Admins, Enterprise Admins)
634. Check for gMSA vs traditional service accounts
645. Identify accounts with `PasswordNeverExpires` flag
65
66### Step 2: Discovery - Cloud Platforms
67- **AWS**: List IAM users with access keys, check last used date, identify unused roles
68- **Azure**: Enumerate service principals, app registrations, managed identities
69- **GCP**: List service accounts, check key age, identify unused permissions
70
71### Step 3: Assessment
72- Flag accounts with admin/privileged group membership
73- Check password age against rotation policy (90 days max)
74- Identify accounts with no login activity in 90+ days
75- Verify account ownership against CMDB/asset inventory
76- Check for shared credentials (same password hash across accounts)
77
78### Step 4: Risk Classification
79- **Critical**: Domain/cloud admin privileges, no password rotation
80- **High**: Access to sensitive data, no identified owner
81- **Medium**: Standard service permissions, password older than 90 days
82- **Low**: Read-only access, managed credentials (gMSA, managed identity)
83
84### Step 5: Remediation
85- Disable orphaned accounts after validation with application teams
86- Convert traditional service accounts to gMSA where possible
87- Rotate credentials older than policy threshold
88- Reduce privileges to minimum required
89- Assign owners and document dependencies
90
91## Security Controls
92| Control | NIST 800-53 | Description |
93|---------|-------------|-------------|
94| Account Management | AC-2 | Service account lifecycle |
95| Account Review | AC-2(3) | Periodic review of accounts |
96| Least Privilege | AC-6 | Minimum service account permissions |
97| Authenticator Management | IA-5 | Service credential rotation |
98| Audit Review | AU-6 | Review service account activity |
99
100## Common Pitfalls
101- Disabling service accounts without verifying application dependencies first
102- Not discovering service accounts outside of Active Directory
103- Missing cloud service principals and managed identities
104- Not checking for interactive logon rights on service accounts
105- Failing to document dependencies before remediation
106
107## Verification
108- [ ] Service accounts inventoried across all platforms
109- [ ] Each account has assigned owner
110- [ ] Privileged service accounts documented with justification
111- [ ] Password rotation compliance checked
112- [ ] Orphaned accounts flagged for remediation
113- [ ] gMSA migration candidates identified
114- [ ] Compliance report generated
115
116---
117
118**Source:** [`mukul975/Anthropic-Cybersecurity-Skills`](https://github.com/mukul975/Anthropic-Cybersecurity-Skills) → `skills/performing-service-account-audit/SKILL.md`