Threat model¶
Status: current for 0.1.0. This model covers the file readers, the report writers, the PowerShell exporter, and remote collection. Review it whenever an input format, output format, collection method, or dependency changes. The exporter and
mishpat collecthave not been run against a real domain, a real domain controller, or a real WinRM endpoint, so the controls that concern them are tested against stand-ins only. See Limitations.
What the tool protects¶
The operator’s data. Group Policy exports hold account and group SIDs, security filtering, WMI queries, script commands, registry values, and the structure of the directory. Bundles also hold every file of each GPO backup. Reports hold the same details.
Credentials. Remote collection needs an account that can open a remoting session and read GPOs. Its password must not leak.
The domain controllers and the directory. Collection must never change them, and the account it uses must not be more powerful than needed.
The integrity of results. Reviewers and change boards rely on a report as a record of what changed. A report that hides a gap is worse than one that is short.
The operator’s machine. The tool processes files and network replies that may come from systems or people the operator does not fully trust.
The supply chain. Users install release artifacts built by this project’s pipeline, and run a script from them against a domain.
Trust boundaries¶
Input files enter the tool. They are untrusted:
Get-GPOReportfiles,Backup-GPOfolders, and export bundles. This includes a bundle that the exporter wrote, because the computer it ran on may be compromised, and a backup folder that someone else made.The exporter’s environment is where the script runs: an administration workstation or a domain controller. The script reads the directory and SYSVOL there, and it writes GPO backups to a temporary folder under
$env:TEMPfor a short time.The remote collection channel carries the exporter script to a domain controller and lines of the bundle back to the operator’s machine. Replies are untrusted.
Secret providers return a password to
mishpat collect.Output files leave the tool and are opened in browsers, spreadsheets, and review systems.
Release artifacts leave the build pipeline and are installed by users.
Threats and controls (STRIDE)¶
The Status column says whether each control is in place today. Branch rules depend on repository settings, which are applied outside the code.
Category |
Threat |
Control |
Status |
|---|---|---|---|
Spoofing |
A tampered release artifact is installed in place of the real one. |
Releases are built only by the release workflow from a commit on |
In place (attestations when public) |
Spoofing |
A fake server answers |
HTTPS on port 5986 is the default and always verifies the certificate chain against the system’s roots or the authorities in |
In place; tested against a simulated client only |
Spoofing |
A report is presented as describing inputs it was not built from. |
Reports and the manifest record the size and SHA-256 of both inputs. |
In place |
Tampering |
A crafted report or backup file changes results or crashes the tool. |
XML is parsed with the standard library’s |
In place |
Tampering |
A hostile backup folder or bundle tries to read or write outside its own tree, or to make mishpat exhaust memory or time. |
A backup folder is read only through the names the operating system lists, links are not followed, folders are searched four levels deep, and a file larger than 64 MiB is not read. A bundle is never written to disk: its files are held in memory. Each path in a bundle must be relative, with no |
In place, with residual risk below |
Tampering |
An export is changed after collection. |
The trailer holds the file count and a SHA-256 of every byte before it. A cut-short, damaged, or edited file is reported as a problem. The hash detects accidental damage and careless edits. It does not stop a deliberate forger, who can edit the file and compute the hash again. Keep exports in your evidence system, and compare the hash with the one you recorded at collection. |
In place (detects accidents, not a forger) |
Tampering |
A malicious or compromised domain controller returns crafted data through |
The reply is treated as untrusted input, like any file. Each line must be one line of ASCII text. The first line must be a valid export header, and every later line must be a file line, the structure line, or the end line, with at most one structure line and nothing after the end line. After collection, the end line’s file count and hash must match what arrived. The published file is then read by the same strict reader as any other bundle. A controller can still lie about what its own directory and SYSVOL hold. The comparison cannot detect that. |
In place, with residual risk below |
Tampering |
Collection changes a domain controller or the directory. |
The exporter only reads. A test checks that the script calls no command other than a fixed list of read-only ones, and none of the commands that change Group Policy or the directory. |
In place; tested with PowerShell 7 and stand-ins only |
Tampering |
A failed or interrupted run leaves a partial file or overwrites good evidence. |
Report files go to private temporary files first, and the manifest is written last. Without |
In place |
Tampering |
A malicious change enters the code base. |
Pull requests only, a required passing check, resolved conversations, no force pushes to |
In place (branch rules need settings) |
Repudiation |
A user cannot show which inputs and rules produced a report. |
Reports record the tool version, the generation time, the name, kind, size, and SHA-256 of both inputs, and the options used. The manifest does the same for every output file. |
In place |
Repudiation |
A crash is mistaken for a normal result in a pipeline. |
Unexpected errors exit with code 4, distinct from a result that needs a look (1), a usage error (2), and an input or collection error (3). |
In place |
Information disclosure |
The collection password leaks through the command line, logs, output files, or errors. |
|
In place, with residual risk below |
Information disclosure |
The credentials cross the network in a form that can be stolen. |
HTTPS is the default and verifies the server. Over plain HTTP, mishpat requires message encryption. Only Kerberos, Negotiate, and NTLM are offered. None sends the password to the server. Basic, which sends the password itself, and CredSSP, which delegates the account’s reusable credentials to the server, are not offered. |
In place; tested against a simulated client only |
Information disclosure |
Reports and bundles expose sensitive content to the wrong people. |
Files are created readable only by the current user on Linux and macOS, and are never silently overwritten. Fixtures are synthetic, and secret scanning runs on every change and across the full history. Reports never show a Group Policy Preferences stored password ( |
Stored passwords hidden; other values not masked |
Information disclosure |
GPO backups left in a temporary folder on the exporter’s computer. |
The exporter writes each backup to a new folder under |
In place, with residual risk below |
Information disclosure |
The tool sends data over the network. |
|
In place |
Denial of service |
An oversized or hostile input exhausts memory or time. |
The limits in the row on hostile backup folders and bundles. A bundle is read line by line. Problems and differences are not capped, so a hostile input can make a large report. |
Partly in place: see residual risks |
Denial of service |
A hostile server sends unbounded data or never answers. |
Each line is limited to 89,482,584 bytes. The connection times out after 30 seconds. If the server sends no line for |
Partly in place: no limit on total size |
Elevation of privilege |
Input content runs as code: an XML external entity, formula injection in CSV, or script injection in HTML or Markdown. |
The XML reader refuses a |
In place |
Elevation of privilege |
The collection account is more powerful than needed. |
The account needs the right to open a remoting session and to read the chosen GPOs and the directory, which by default means Administrators, or Remote Management Users plus read access to the GPOs. mishpat cannot ask for less. Use a dedicated account, grant it nothing else, protect it, and prefer a short-lived Kerberos ticket or a secret manager over a stored password. mishpat uses the account only to read. |
Guidance; the rights are a Windows requirement |
Elevation of privilege |
The exporter script runs hostile code on a workstation or domain controller. |
One readable PowerShell file with no modules of its own, shipped inside the package. Read it before you run it, and run it only from a verified release. |
In place |
Elevation of privilege |
A compromised dependency or build step runs with broad permissions. |
Reading files needs one runtime dependency, |
In place |
Hostile input¶
The two inputs that deserve the most care are a backup folder you did not make and a bundle you did not write. Both can be built by someone who wants to mislead the reviewer or to attack the machine that reads them.
To attack the machine. The preceding controls apply: no entity expansion, no path outside the tree, nothing written to disk from a bundle, strict size and shape limits, and no use of input as code.
To mislead the reviewer. A forged bundle can hold any GPO content, with a valid hash, because the hash is not a signature. The report is only as honest as the input. Take bundles from a source you trust, keep them in an evidence system, and record their SHA-256 at collection.
To hide a change. A hostile input can omit a part. mishpat reports what it could not read, such as a missing trailer, a failed hash, or a gap the exporter recorded. It cannot report what the input never said. A bundle that is complete and consistent but false looks complete.
Residual risks¶
A compromised controller can lie. The trailer hash and the certificate show that the file came whole from the server you named. They do not show that the controller is healthy or that its directory and SYSVOL are true. Someone who controls a controller can change what the exporter returns. Compare exports with a second source, such as another controller.
A tampered file can be made to match its hash. The bundle hash, the report hashes, and the manifest show consistency, not authorship. Authenticity is the job of the system that stores the files.
Memory. mishpat builds the whole element tree of a report in memory, and holds a bundle’s files in memory. The limits bound the size of an input, but memory use is a multiple of it. For a
Registry.polentry the multiple is large: a 41-byte entry takes about 5 KB of memory (about 120 times) and, when its value changed, about 760 bytes of JSON report. mishpat therefore reads at most 1,000,000 entries from oneRegistry.polfile (--max-pol-entrieschanges this) and records a problem for the rest, so the run is incomplete and exits 1. A report file is read with a limit on the elements held at once, because a small file of empty elements can build a tree of gigabytes, and a<GPOS>capture is read one GPO at a time. Do not read untrusted inputs on a machine that cannot spare the memory.Folders are hashed whole. To fingerprint a folder input, mishpat reads every file under it, including files it never parses. Give it the backup folder or the backup root, not a parent folder that holds unrelated data.
Only stored passwords are masked. A Preferences
cpasswordnever appears in a report, but a secret that someone typed into another setting, such as a script parameter, does. Check a report before you share it. A bundle always holds the original files, stored passwords included.A temporary folder can survive a hard stop. If the exporter process is killed, or the computer loses power, the folder with the GPO backups under
$env:TEMPstays. Remove folders namedmishpat-followed by a GUID. The folder is created with the default access rules of that location.The exporter and collection are untested against real systems. Treat the first runs in your environment as a pilot.
NTLM is weaker than Kerberos. mishpat offers it because some environments need it. Prefer Kerberos.
A secret file is not checked.
file:PATHreads the first line of the file and does not check who can read it. Keep it readable only by you.File permissions apply on Linux and macOS. mishpat sets no access rules on Windows. Check the access rules of the folder you write to.
Checksums and attestations protect users only if they verify them. Releasing shows how.