Skip to content

sodejm/host-assessment-workbench

v0.1.0PolyForm-Noncommercial-1.0.0

Offline Linux and Windows evidence classification with a bounded read-only native Windows bridge.

COPS Host Assessment Workbench

Review sanitized Linux and Windows privilege-boundary exports and identify which observations apply to the reported host context. On Windows, the package also provides a bounded read-only collector and an independently validated, assessment-owned cleanup receipt. It does not attempt privilege escalation or read credential values.

Start here

Use Python 3.14 or newer and run from the repository root:

python3 -m cops info host-assessment-workbench
python3 -m cops demo host-assessment-workbench
python3 -m cops check host-assessment-workbench

The demo checks Linux positive, negative, fixed, unknown-context, and invalid-cleanup inputs plus Windows vulnerable, protected, remediated, and unsupported exports through the public importer. Follow the practitioner playback for individual commands and result interpretation. Use the verification playbook to record qualification evidence.

Design and evidence theory

A configuration observation can suggest a privilege boundary worth investigating, but it does not prove that the boundary was crossed. The importer first compares the observation's declared prerequisites with the reported host. Linux records use kernel, distribution, namespace, and protection requirements; Windows records use build, architecture, token, and protection requirements plus an explicit bridge capability declaration. A known mismatch is inapplicable; an unknown prerequisite is unresolved. Neither selects the observation for a canary conclusion.

A selected configuration can be a configuration_candidate, ordinary_configuration, or insufficient_evidence. A canary record adds explicit before/after access assertions, ownership, disposable-host status, evidence IDs, and cleanup. A positive case requires denied-before/granted-after access; negative and fixed cases require denied-before/denied-after. The resulting labels are reported_canary_crossing and reported_canary_blocked: the importer checks the contract but does not independently verify the source's claims.

Data contracts

The Linux positive, negative, and fixed fixtures and the Windows vulnerable, protected, remediated, and unsupported fixtures are complete runnable inputs. The Linux privilege-boundary import contract and Windows privilege-boundary contract define the exact schemas.

Record or fieldPurpose and producerConsumer and validation
Input schema_versionExporter selects Linux contract 1.0 or Windows contract windows-1.0Importer rejects unknown versions or fields
source_kind, source_idExporter labels synthetic_lab or operator_export and an opaque provenance IDCopied to report source; this is not independent provenance verification
hostLinux kernel/distribution/namespace or Windows build/architecture/token contextCompared with each observation's prerequisites; unknown values remain unresolved
host.protectionsLinux SELinux/AppArmor/seccomp/no-new-privileges/user-namespace state or Windows UAC/VBS/Credential Guard/AppLocker/WDAC stateRequired host context; selected requirements must agree
bridgeWindows exporter declares platform, offline_windows_export or native_windows_bridge, supported capabilities, and whether it supplied canary assertionsImporter rejects undeclared capabilities, contradictory assertions, and native privilege-crossing canaries
coverageStatus for eight Linux or seven Windows privilege-boundary surfacesEach surface is assessed, not_assessed, unsupported, or access_denied; observations require assessed coverage
observations[]ID, surface, configuration assertion, evidence IDs, requirements, optional canaryImporter rejects duplicate IDs, unsupported fields, and contradictory claims
observations[].canaryCase, resource ID, before/after access, evidence IDs, ownership and cleanup assertionsAt least three evidence IDs; disposable host, assessment ownership, and cleanup must all be true
Report mode, source, host, coverageImporter preserves import contextAnalyst sees offline_import or native_bridge_import and explicit coverage limits
Report observations, countsImporter supplies decisions, classifications, prerequisites, and totalsAnalyst distinguishes candidates from reported crossings and unresolved observations

The importer bounds input to 1 MiB, JSON depth 64, and 256 observations. Use opaque, non-sensitive IDs. Credentials, free-form evidence, paths, duplicate JSON keys, and non-finite numbers are rejected. Unassessed or denied coverage never establishes that a host is safe.

Operations and limits

Valid input produces deterministic JSON on stdout. Invalid input exits 2 with no success report. Fix the input contract or preserve a missing-evidence outcome; do not change assertions merely to obtain a selected result. See the playback for repeatability and cleanup checks.

On Windows, scripts/collect-windows.ps1 measures build, architecture, token, UAC state, and seven bounded privilege-boundary surfaces. Service, task, and PATH enumeration have fixed maximums; failures remain access_denied or not_assessed. Local service DACL queries use only READ_CONTROL, with 64 KiB and 256-ACE bounds. Owner evidence detects broad-owner implicit write-DACL rights unless OWNER RIGHTS ACEs suppress them. Broad mutation grants are configuration candidates; missing owner evidence and unsupported ACE semantics remain unassessed. The collector creates and removes only a harmless directory and marker beneath a caller-supplied empty canary root. Before deletion it confirms the canonical root and child identities, rejects reparse points, and rehashes an assessment-owned marker. The SHA-bound receipt records those identities and is checked against the exact supplied root by scripts/validate-windows-bridge.py. An identity or ownership mismatch fails closed without deleting the path. This validates collector execution and assessment-owned cleanup; it does not validate a privilege crossing or exploitability.

Run scripts/exercise-windows-bridge.ps1 from PowerShell for the complete native exercise used by CI. It executes the collector, importer, receipt validator, the read-only versus writable ACL regression, and the final empty-root assertion. The separate scripts/exercise-windows-service-acl.ps1 fixture requires an authorized disposable Windows runner with service-creation rights. It creates a stopped service, verifies vulnerable, corrected, denied, and missing DACL states, and checks deletion after success, controlled failure, and injected status-query failures. Cleanup retains errors while still attempting deletion and absence verification. It never starts the service. See the verification guide before running this mutating fixture.

Host installation and live integration remain unverified until the native Windows workflow succeeds at the exact reviewed commit. Synthetic vulnerable, protected, remediated, and unsupported fixtures remain the acceptance evidence for result classification. The package-local verification guide defines the native acceptance procedure and the evidence it establishes.