Active Directory Assessment skill for Codex

Fewer, longer paths to Domain Admins. Codex works from authorized, read-only Active Directory assessment data: PingCastle health reports and BloodHound Community Edition attack paths. It turns them into a hardening backlog ordered by how many paths to Tier 0 each fix removes, covering tiering, privileged group hygiene, LAPS, gMSA, delegation, AD CS templates and signing, with change control for domain controllers.

  • Security
  • $active-directory-assessment
  • 110 lines
  • 2 files
  • ~1,650 tokens
  • MIT
  • Updated

Install

curl -fsSL codexskills.dev/install.sh \  | sh -s -- active-directory-assessment

Installs to ~/.agents/skills/active-directory-assessment/ for every project on this machine.

104-line POSIX script. No sudo, no telemetry. Read install.sh

Use it in Codex

Start a prompt with $active-directory-assessment, or pick it from /skills. You can also just describe the task: Codex reads the description below and loads the playbook when your request matches.

What Codex reads before loading it

Interprets authorized Active Directory security assessments and turns them into a prioritised hardening plan - reading PingCastle health reports and BloodHound Community Edition attack-path data, reviewing tiering, privileged group membership, LAPS and gMSA coverage, delegation settings, AD CS template safety, and LDAP/SMB signing - to reduce paths to Tier 0. Use when an owner wants an internal AD hardening review, needs to make sense of a PingCastle or BloodHound export, or wants a backlog of concrete remediation steps with change control.

Use it when

  • An owner wants an internal AD hardening review
  • You have a PingCastle or BloodHound export to interpret
  • You need remediation ordered by impact, not a raw finding list
  • Privileged access and delegation have grown unchecked

Use something else when

How to check the result

Re-running PingCastle and the BloodHound path queries after fixes shows a lower risk score and the targeted paths no longer resolving, with signing and LAPS confirmed and no new authentication failures.

The mistake it prevents

Enforcing LDAP signing, SMB signing or NTLM restrictions without an audit-mode phase, locking out legacy apps and appliances.

~/.agents/skills/active-directory-assessment/SKILL.md

--- name: active-directory-assessment description: Interprets authorized Active Directory security assessments and turns them into a prioritised hardening plan - reading PingCastle health reports and… license: MIT ---

The goal is a defensible directory: fewer and longer paths to Tier 0 (Domain Admins and the systems that control them), least privilege on everything that can escalate, and modern defaults for credentials and signing. Done well means the review was authorized and read-only, each finding names the exact objects it concerns, and the fixes are ordered by how much exposure they remove, with change control for anything touching domain controllers.

Gate 0: authorization and read-only scope

Assessment tools query every object in the directory and EDR products flag that activity. Before running anything, confirm in writing with the user:

  • Written approval from the AD owner, and notice to the SOC, naming the assessor, the domains and in-scope trusts, and the window.
  • This is a read-only hardening assessment. Interpreting collected data and recommending fixes is the scope here; actively exploiting findings is a separate engagement with its own rules of engagement and is not covered by this skill.
  • Who applies changes, and the change-control process for domain controllers.

Run collection from an account with normal domain-user read rights where possible; no step here needs to write to the directory.

Inputs to work from

Prefer existing exports the owner already produced. The common sources:

SourceGives you
PingCastle health report (HTML/XML)A scored risk report: stale accounts, trusts, delegation, obsolete OS, GPO issues
BloodHound CE data (collected with SharpHound, read-only)Graph of rights between principals; shortest paths to high-value groups
Get-ADUser/Get-ADGroup/Get-ADObject (RSAT PowerShell, read-only)Specific object attributes to confirm a finding
AD CS inspection (certificate template ACLs and flags)Risky certificate templates that allow privilege escalation

Treat these exports as sensitive: they map the whole org’s privilege. Store them in a restricted location and never upload them to third-party services.

What to look for, and the fix

AreaFindingHardening
TieringDAs log on to workstations; no admin tier separationImplement a tier model; Tier 0 accounts only on Tier 0 hosts; authentication policy silos
Privileged groupsLarge or stale Domain/Enterprise/Schema Admins; nested groups hiding membersEmpty standing membership; just-in-time elevation; review nested paths
KerberosService accounts with SPNs and weak/old passwords (Kerberoastable)Move to Group Managed Service Accounts (gMSA); strong passwords; remove unused SPNs
DelegationUnconstrained delegation on non-DC hosts; risky constrained/RBCD configRemove unconstrained delegation; mark Tier 0 accounts “sensitive, cannot be delegated”
Local adminShared local admin password across machinesDeploy Windows LAPS; unique rotated local admin passwords
AD CSTemplates allowing requester-supplied subject + client auth to low-priv usersFix vulnerable template ACLs and flags; restrict enrollment; enforce manager approval
SigningLDAP signing not required; SMB signing offRequire LDAP channel binding and signing; enforce SMB signing via GPO
ProtocolsNTLMv1 or LM allowed; legacy authDisable NTLMv1/LM; plan NTLM reduction; audit before enforce
HygieneStale accounts/computers, passwords that never expire, krbtgt not rotatedDisable stale objects; rotate krbtgt twice (with the documented interval between); enforce password policy and MFA for admins

Prioritise by path reduction

Use the BloodHound graph to rank fixes by effect, not by raw count:

  1. List the shortest paths to Tier 0 groups.
  2. For each, find the single edge whose removal breaks the most paths (an over-permissive group ACL, an unconstrained-delegation host, a reused local admin credential).
  3. Fix the edges with the widest effect first. One corrected ACL often removes dozens of paths.
  4. Re-collect and re-run the pathing query to confirm the paths are gone.

Applying changes safely

  • Everything touching domain controllers or domain-wide GPOs goes through change control and the owner’s maintenance window, never ad hoc. Propose the change and get explicit confirmation; the user applies it.
  • Roll out signing and NTLM changes in audit mode first (log what would break), fix the flagged legacy clients, then enforce. Enforcing LDAP signing or SMB signing cold can lock out line-of-business apps and appliances.
  • krbtgt rotation twice in quick succession invalidates existing tickets; schedule it and warn the owner about the short-lived disruption.
  • Keep a rollback for each GPO change and test on a pilot OU before domain-wide linkage.

Gotchas

  • Collection data is a point in time; privilege changes daily. Date every export and note the collection account’s own rights (they appear in the graph).
  • “Domain Admins is small” can still be unsafe if a group it is nested in, or a GPO it depends on, is writable by many users. Follow the edges, not just the memberships.
  • Disabling, not deleting, stale privileged accounts first; deletion can break services that silently depend on them.
  • Azure AD / Entra ID hybrid paths (Entra Connect sync account, PHS/PTA servers) extend Tier 0 into the cloud; include the sync server as a Tier 0 host.

Verification and output

  • Re-run PingCastle and the BloodHound path queries after fixes; the risk score drops and the targeted paths no longer resolve.
  • Confirm LAPS is populating and rotating, gMSA accounts are in use, and signing GPOs applied (gpresult, event logs) without new auth failures.
## AD hardening assessment: CONTOSO.LOCAL (collected 2026-10-20, read-only, PingCastle 3.x + BloodHound CE)
Score: 70 -> target < 30 | Paths to Domain Admins: 214 -> after top 5 fixes (modelled) 23

| # | Finding | Objects | Paths cut | Fix | Change window |
|---|---|---|---|---|---|
| 1 | Unconstrained delegation on APP03 | APP03$ | 88 | Remove delegation; mark Tier 0 sensitive | CR-1420, Sat 02:00 |
| 2 | Helpdesk group has GenericAll on Servers OU | GG-Helpdesk | 46 | Scope ACL to needed objects | CR-1421 |
| 3 | 12 Kerberoastable SPNs, passwords > 2y | svc-* | 31 | Migrate to gMSA; remove dead SPNs | CR-1430 |

Validation that a specific change is appropriate for the environment rests with the AD owner; flag anything that could disrupt authentication before it is enforced.

What the zip contains

SKILL.md plus the interface file below. Nothing runs on install.

agents/openai.yamlgenerated from this page

Gives the Codex app a display name, a one-line description and a starter prompt for this skill.

interface:
  display_name: "Active Directory Assessment"
  short_description: "Fewer, longer paths to Domain Admins"
  default_prompt: "$active-directory-assessment Read this PingCastle report and tell me the top five things to fix"

About this skill

Written and maintained by the Codex Skills editors to the same editorial standard as every skill here: a selective description, a real workflow, known pitfalls and a way to verify the work. First published , last updated . MIT licensed. Something wrong or out of date? Tell us.

esc