Monitor Active Directory (AD) and cloud environments for new user or service account creation events, validate for legitimacy, and document findings.
Given:
All new account creations (local + cloud) are discovered, validated, and documented.
4720
→ User account created (Windows 7+/Windows Server 2008+)624
→ User account created (Windows 2003 and older)4722
→ Account enabled4725
→ Account disabled4726
→ Account deletedList users created in last 5 days:
$When = ((Get-Date).AddDays(-5)).Date
Get-ADUser -Filter {whenCreated -ge $When} -Properties whenCreated
Alternative AD query:
import-module activedirectory
Get-QADUser -CreatedAfter (Get-Date).AddDays(-5)
Get-ADUser -Filter * -Properties whenCreated | Where-Object {$_.whenCreated -ge ((Get-Date).AddDays(-5)).Date}
Get-EventLog Security -InstanceId 4720 -after ((get-date).AddDays(-1))
Operator Note: 4720 is the most important → direct user creation.
Get-ADGroup -Identity "some_group_name"
Get-ADGroup -Identity S-1-5-32-544
wmic useraccount where name='some_username' get sid
whoami /user
wmic useraccount where (name='administrator' and domain='%computername%') get name,sid
wmic useraccount where sid='S-1-3-12-XYZAA-1111' get name
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=CreateUser
Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-1) -Operations "Add user"
or via Portal → Azure AD → Audit Logs
gcloud logging read "protoPayload.methodName=\"google.admin.directory.user.insert\""
Operator Note: Validate if new user/service account was provisioned automatically or manually.
.\\AD_AccountCreationDetection.ps1
Operator Note: This should be run at intervals (command-directed or daily).
Tool | Platform | Installation | Usage |
---|---|---|---|
Security Onion (via Winlogbeat) | Network | Native | SMB + AD event ingest |
BloodHound | AD | Native | Visualize and audit AD permissions and accounts |
OSSEC / Wazuh | Cross-platform | Native | Detect user additions |
AWS CloudTrail | AWS | Native | IAM user creation |
Azure AD Audit Logs | Azure | Native | User creation tracking |
GCP Cloud Audit Logs | GCP | Native | Service/User account creation |
Date | Version | Description | Author |
---|---|---|---|
2025-05-02 | 1.0 | Original retained and expanded for cloud + operator workflow | Leo |