Repositorydocument · docs/threat-model.md · Engels · Alle documentatie

Dit bestand wordt letterlijk uit de repository gerenderd en loopt op punten achter op de code. Scripts bestaan voor SMB, NTLM (niveau 5, uitgaand weigeren, domeinweigering met uitzonderingen), LDAP-ondertekening, LDAP channel binding en TLS 1.0/1.1. Binaire .evtx wordt gelezen. plan, preflight en collect bestaan. collect is niet tegen een echt domein gedraaid. De roadmap hoort bij de code.

Threat model

PQC PRZM is a high-privilege reader of Active Directory and, later, a producer of scripts that change it. This document is about the tool and the artifacts it writes. It is not a threat model of the customer’s domain.

The scaffold has no network collector and no installer. The threats below include that future shape, and say what is already true of the code that exists.

Assets

Trust boundaries

Boundary What crosses it
Customer domain to the tool Read-only configuration and events. Not secrets.
Snapshot file to the engine Untrusted input. A snapshot can be hostile even when the operator is not.
Tool to the administrator HTML, JSON, PowerShell, INF, registry.pol. The administrator is expected to read them.
Administrator to a server The PowerShell script, run by a person, elevated, on a named computer.
Future: tool to SYSVOL or Intune Not implemented. Treated as a later, explicit, confirmed action.

What we are worried about

A compromised tool is a path to the domain. The collector account can read security logs and directory configuration. If that account is also Domain Admin, compromise of the tool is compromise of every customer on the server. Mitigation: a dedicated account, Event Log Readers and remote-read rights, no write rights in v1. The scaffold cannot collect, so it cannot abuse a domain. The interface documents the same limit.

The tool opens a port and is scanned. There is no listener. Do not add one for “a small API” without revisiting this model. Reports are files.

Customer data leaves the premises. v1 writes files locally and does not phone home. A future build must not add telemetry, crash upload, or license checks that send snapshot contents. An administrator copying out/ to a laptop is their own export.

Secrets land in the report. Event 4624 does not contain a password, but a sloppy collector could attach one, and a sloppy report could print every event field. The report prints only the blocker fields the checks select. A test plants Password=SuperSecretValue on an event and asserts the HTML does not contain it. LAPS password attributes (msLAPS-Password, ms-Mcs-AdmPwd) are out of scope for collection even when LAPS-001 is built. Certificate private keys are out of scope. The engine never asks for them.

A hostile snapshot becomes code. The script generator rejects computer names outside a hostname character set, rejects two FQDNs that collapse to the same short name, and strips newlines, backticks, and # from comment text so a customer name cannot break out of the header. SMB values other than “disable SMB1” and “require signing” are rejected, including a plan that tries to turn SMB1 back on. XML event input rejects DTDs, so an external entity cannot be used to read local files during import. JSON uses the serializer defaults, not a type discriminator.

The script does more than it says. The generated script does not call Invoke-Expression, Invoke-WebRequest, DownloadString, Invoke-Command, or Add-ADGroupMember. Tests lock that. It does not take a URL. It changes the local SMB server and client configuration and, when SMB1 server disable is in scope, the FS-SMB1 feature and the mrxsmb10 start value. -Force is used so Set-SmbServerConfiguration does not prompt; -WhatIf and the confirm string still gate the call.

Someone runs the script by accident. With no arguments it prints the desired settings and returns. Enforce requires the literal argument -ConfirmEnforce ENFORCE plus an elevated session plus a computer name on the intended list (or -ForceLocal after review). -WhatIf is still honored after the confirm string. Rollback without the confirm string prints and returns. Rollback with the confirm string and no state file throws rather than guessing previous values.

Rollback restores the wrong thing, or restores a secret. The state file is schema-tagged (pqcprzm-smb-1). A file from something else is refused. The file is created on the first enforce and not overwritten, so a second run does not destroy the original values. It contains SMB booleans and a service start value. It should be treated as admin-only because it describes a security setting, not because it holds a credential. Roll back with the same script that applied the change. A later, narrower script does not know how to undo a setting it does not touch.

The report is edited and still looks official. v1 HTML is not signed. The mitigation is weak and is called out here: keep the snapshot next to the report, and do not treat the HTML as an integrity-protected record. A later version should hash the snapshot into a signed manifest. The tool version is printed on the report.

A huge snapshot exhausts the management server. The loader stops at 200,000 events. That is a scaffold limit, not a streaming design. A real collector has to bound queries per channel and per day.

Audit policies are turned on carelessly. Enabling SMB and NTLM audit is a prerequisite for a trustworthy empty log. Enabling deny during the observation window is how the project breaks the copier early. The tool does not flip either switch. The permissions doc separates them.

v2 deployment becomes a persistence mechanism. Creating and linking GPOs is a domain-wide write. It stays behind a separate confirmation, takes a backup of the GPO before linking, applies to the pilot OU first, and has a tested unlink. None of that code exists. Do not “just shell out to New-GPO” from the current script.

What we added for trust

The permission contract, the preview plan, and the activity log are specified in trust and permissions. In short:

Out of scope for this model

Attacks against Windows itself, against the customer’s line-of-business applications, and social engineering of the MSP’s operators beyond what the script’s confirm string can blunt. The baseline checks describe those customer risks. They are not mitigations inside the tool.