agentleFS
kaandgnshkaandgnsh/Claude-Blue/skills/active-directory-security/gpo-security-review/SKILL.md

gpo-security-review

Skill0 starsChanged 14 days agoMITView on GitHub

Review Group Policy for security baseline compliance, dangerous settings, GPP passwords, excessive edit rights and malicious GPO changes; detect GPO-based malware deployment via event 5136. Use when auditing GPOs, comparing to Microsoft/CIS baselines, or investigating ransomware deployed through Group Policy.

The file

Files
SKILL.md

GPO Security Review

Collection

Get-GPO -All | Select-Object DisplayName, Id, ModificationTime, GpoStatus
Get-GPOReport -All -ReportType Xml -Path C:\review\gpos.xml
# Who can edit each GPO
Get-GPO -All | ForEach-Object { $g=$_; Get-GPPermission -Guid $g.Id -All |
  Where-Object { $_.Permission -in 'GpoEdit','GpoEditDeleteModifySecurity' } |
  Select-Object @{n='GPO';e={$g.DisplayName}}, Trustee, Permission }
# GPP cpassword remnants (MS14-025)
Select-String -Path "\\$env:USERDNSDOMAIN\SYSVOL\*\Policies\*\*.xml" -Pattern 'cpassword' -List

Compare with Microsoft Security Compliance Toolkit baselines using Policy Analyzer.

What to flag

  • Non-Tier-0 principals with edit rights on GPOs linked to DCs/Tier 0 OUs (or at domain root).
  • GPP XML containing cpassword (decryptable, key is public).
  • Startup/logon scripts or Scheduled Task (GPP) items pointing to writable shares.
  • Settings weakening security: WDigest enabled, LM hash storage, NTLMv1 allowed (LmCompatibilityLevel < 5), SMB signing not required on DCs, LDAP signing/channel binding not enforced, Defender disabled/exclusions, Restricted Groups adding broad groups to local Administrators.
  • Audit policy GPO missing or weaker than recommended (windows-event-log-analysis).
  • Orphaned/unlinked GPOs and SYSVOL folders without GPO objects.

Detecting malicious GPO changes

5136 (directory object modified) on groupPolicyContainer objects, especially gPCMachineExtensionNames / versionNumber changes; 5137 new GPO; 5141 deleted. File changes in SYSVOL\...\Machine\Preferences\ScheduledTasks\ScheduledTasks.xml or Scripts\ (file integrity monitoring on SYSVOL).

SecurityEvent
| where EventID == 5136 and ObjectClass == "groupPolicyContainer"
| project TimeGenerated, SubjectUserName, ObjectDN, AttributeLDAPDisplayName, AttributeValue

Output

GPO | Linked to | Finding | Setting/ACL | Risk | Recommended change | Owner

Related skills

ad-privileged-access-review, ransomware-response, endpoint-hardening

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.