Skip to content

sodejm/ad-assessment-workbench

v0.1.0PolyForm-Noncommercial-1.0.0

Analyze scoped Active Directory inventory, provenance, and candidate privilege paths offline.

COPS AD Assessment Workbench

The AD Assessment Workbench validates an explicitly scoped, offline Active Directory graph export and traces bounded candidate privilege paths across forests, domains, groups, hosts, and trust relationships. It preserves collection provenance and marks paths that depend on inferred edges, partial collection, protected identities, or trust boundaries.

The package does not collect from AD, LDAP, Kerberos, or hosts. A candidate path is a review lead based on supplied relationships; it does not prove the privileges are usable or exploitable. A missing path does not prove absence when collection is partial or unknown.

Prerequisites and quick start

Run from the repository root with Python 3.14 or later:

PYTHON="${PYTHON:-python3.14}"
"$PYTHON" -m cops demo ad-assessment-workbench

The public command creates an owner-only temporary workspace, verifies both runs and the expected rejection, and removes the workspace. Use the package runner directly when you need to retain that evidence in a new directory:

PYTHON="${PYTHON:-python3.14}"
scratch="$(mktemp -d "${TMPDIR:-/tmp}/cops-ad-playback.XXXXXX")"
chmod 700 "$scratch"
"$PYTHON" plugins/identity-access/ad-assessment-workbench/scripts/run_demo.py \
  --workspace "$scratch/playback"
cat "$scratch/playback/playback-summary.json"

The runner requires a workspace path that does not already exist. mktemp creates a private parent while leaving the playback child available for the runner. The artifacts remain under $scratch/playback for review. When you no longer need them, optionally remove the private parent with rm -rf "$scratch" in the same shell.

Analyze the bundled fixture without writing files:

PYTHON="${PYTHON:-python3.14}"
"$PYTHON" plugins/identity-access/ad-assessment-workbench/scripts/analyze.py \
  plugins/identity-access/ad-assessment-workbench/fixtures/synthetic-two-forest.json

Replace the fixture path with a separately authorized export only after reviewing the input contract below. The analyzer reads one local file and does not collect from a directory service.

Design and data flow

  1. load_export reads one regular local JSON file under a one-megabyte limit, rejects symlinks, duplicate keys, non-finite constants, excessive nesting, and malformed JSON.
  2. analyze validates the declared scope, collections, nodes, edges, references, timestamps, and bounded queries.
  3. Breadth-first traversal evaluates at most the configured node, edge, depth, path, and expansion limits.
  4. The report keeps edge provenance and attaches review flags to every candidate path.

Input and output contract

Contract or artifactPurposeKey fieldsProducer and consumerDefinition and validation
AD export v1.0Declares scope, evidence, and questions in one opaque filescope, collections, nodes, edges, queriesApproved export process → load_export and analyzeadwb/inventory.py; strict keys, IDs, references, timestamps, enums, sizes, and traversal bounds
Collection recordStates where and when evidence was gatheredsource, forest, domain, host, collected_at, completenessExport process → coverage calculationMust refer to in-scope objects and use complete or partial
Edge recordConnects graph objects to source evidencesource, target, kind, collector_id, supportExport process → path traversalReference and relation validation; support distinguishes observed from inferred evidence
Assessment reportReturns coverage and bounded query resultsassessment, coverage, queriesAnalyzer → reviewerDeterministic output from a validated export
playback-summary.jsonRecords the demo's acceptance factsquery/path counts, rerun and failure checksDemo → reviewerWritten only after semantic assertions pass

The synthetic fixture returns one four-edge candidate path and one not_found_in_collected_graph query. The candidate includes all four review flags. Review the underlying edge evidence before acting.

See the playback guide and verification notes. Synthetic results validate the local contract only; they do not establish production coverage or live AD security.