Architecture
flowchart LR
subgraph inputs [Inputs]
Json[Snapshot JSON]
Xml[Event XML]
Live[Windows collector later]
end
Snap[Assessment snapshot]
Engine[Check engine]
Report[HTML and JSON report]
Plan[Baseline plan]
Art[PowerShell, INF fragment, registry.pol]
Json --> Snap
Xml --> Snap
Live -.-> Snap
Snap --> Engine --> Report
Engine --> Plan --> Art
The solid arrows exist. The live probe’s Windows I/O is compiled only on Windows. On any other host, collect stops before a connection. Tests drive the same collector with a fake probe.
Technology choice
The scaffold is a .NET 10 solution:
src/PqcPrzm.Core— snapshot, catalog, checks, scores, baseline plan, artifact generators, HTML reportsrc/PqcPrzm.Cli—assess,baseline,catalogtests/PqcPrzm.Core.Tests— fixtures and unit tests
No NuGet dependencies in the library or the CLI. Tests use xUnit.
Why .NET, and why 10:
- The future collector wants Event Log, LDAP, certificate stores, the registry, and CIM. Those APIs are native to .NET on Windows.
- The engine must run in CI without a domain. Keeping collectors behind a snapshot means the tests are ordinary unit tests on Linux.
- A self-contained single-file
win-x64publish is the deployment an MSP can copy to a management server and Authenticode-sign. Publishing is documented and not wired up as a release yet. - .NET 8 left support on 10 November 2026. .NET 10 is the LTS that covers the life of v1. Nothing here requires a .NET 10-only API; retargeting would be a one-line change and the wrong support choice.
- Go is a good single-binary story and a worse fit for Schannel, certificate stores, and GPO later.
- PowerShell remains the right output for an administrator who wants to read a change before running it. It is a poor place to keep the check catalog and the score.
The process has no listener. A later Windows build still only makes outbound WinRM and LDAP calls. Customer data is files in the output directory.
Snapshot
AssessmentSnapshot is the only thing the engine reads.
coveragesays which channels were collected and, where it matters, whether the audit policy that fills them was on. An empty log is not a pass without that flag.hostscarry configuration. A null bool means “not collected”. It does not mean false.eventsare normalized: event id, computer, time, and a string dictionary of event data. The engine does not keep a raw message in the report.certificatesare public fields only: subject, algorithms, size, parameter set, whether it is a CA. No private keys.
SnapshotLoader reads JSON and, optionally, every *.xml file under an events directory. The XML parser uses XmlReader with DTDs prohibited and a size cap. More than 200,000 events is rejected. Binary .evtx is out of scope until a parser is chosen and reviewed.
WindowsLiveCollector is the seam for the real collector. It does not read the local machine.
Checks
CheckCatalog is the list. CheckEvaluator runs the implemented ids. The report includes the others as NotImplemented, so a gap stays visible.
Each result has:
- Status — pass, fail, warning, inconclusive, not implemented
- Enforceability —
AlreadyMet,SafeToEnforce,Blocked,Unknown - Blockers — aggregated, capped at 50 rows plus a remainder line
- Fix suggestions — the catalog sentence, which the report prints
Scoring lives in ScoreCalculator and is repeated in plain language in the HTML report. The baseline denominator is the implemented hygiene ids (SMB-001, SMB-002, NTLM-001, NTLM-002, LDAP-001, LDAP-002, KRB-001, TLS-001, CERT-001). TLS-003, PQC-001, and PQC-002 feed the narrative and the PQC components, not that percentage.
PQC components:
- Platform. Share of recognised hosts whose OS family can host CNG ML-KEM and ML-DSA. Server 2025 and Windows 11 24H2 or later count. Server 2022 and older, and Windows 10, do not. Schannel hybrid readiness is a build check (26100 with update 33158 or later, or a later build) and is stated in the host detail. It does not by itself remove CNG capability.
- Certificates. Empty inventory is not scored. Any weak certificate is 25. Classical-only and not weak is 55. Hybrid without a pure PQC CA is 80. An ML-DSA or SLH-DSA CA and nothing weak is 100. Unclassified-only is 40.
- TLS. No protocol flags, not scored. Any TLS 1.0 or 1.1 server is 40. Legacy off but no hybrid group on every capable host is 70. Legacy off and every capable host listing a hybrid or pure ML-KEM group is 100.
The overall PQC score is the average of the components that exist, rounded half away from zero. Missing components are named in the note.
Baseline plan
BaselineBuilder.Suggest builds one profile per role present in the snapshot.
| Snapshot role | Profile |
|---|---|
| Domain controller | domain-controllers, including LDAP and Kerberos settings |
| Member server or certificate authority | member-servers. CAs are not a separate profile yet |
| Workstation | workstations |
Computer names are sorted. The first is ring Pilot, the rest Broad. That is a placeholder, not a pilot-selection algorithm. OU and group targets can be written into the plan JSON by hand. Intune profiles are not created.
A setting becomes Enforce when the linked check is AlreadyMet or SafeToEnforce. Otherwise it is Defer. Evidence notes carry the summary and up to eight blockers. BaselineBuilder.Tune sets Overridden so a later script can say a human overruled the evidence.
The plan schema is version 1. The loader rejects anything else.
Artifacts
SmbArtifactGenerator is the only generator.
SMB, NTLM, LDAP, and TLS generators emit a script only for hosts that can take the setting, and only for the safe value (SMB1 off, signing on, LM compatibility 5, LDAP signing and channel binding 2, TLS 1.0 and 1.1 server disabled). Any other value throws. A computer name that is not letters, digits, dots, hyphens, or underscores throws, so a snapshot cannot break out of the script. Two different FQDNs that share a short name throw, because the script compares $env:COMPUTERNAME.
The script:
- does nothing unless
-ConfirmEnforce ENFORCE - still honors
-WhatIfon that path - writes previous SMB values to
smb-baseline-state.jsonbefore the first real change, and will not overwrite that file - rolls back only from that file, and refuses if it is missing or was not written by this generator
- skips a setting that is already at the desired value
- does not open WinRM and does not link a GPO
GptTmpl.smb.inf repeats the signing security options as text. It is not a backup Import-GPO can import. registry.smb.pol is a real Registry.pol body (ASCII PReg, version 1, UTF-16 entries) for the same values, including the SMB1 DWORDs the INF format does not carry. The manifest tells the administrator not to apply more than one copy by accident.
Settings that are Enforce but have no generator (NTLM level 5, for example) stay in the manifest with artifact none.
CLI
pqcprzm assess --snapshot file.json [--events dir] --out dir
pqcprzm baseline --snapshot file.json [--events dir] [--plan plan.json] --out dir
pqcprzm catalog
Exit 0 means the command ran. It does not mean the estate passed. Exit 2 is usage. Exit 3 is a bad snapshot, a bad plan, or a rejected artifact.
baseline --plan keeps the edited dispositions and regenerates artifacts. If --snapshot is also passed, the report is refreshed from the snapshot and the plan file is still the one that drives the script.
Deployment shape, when there is a Windows build
One signed executable on a management server. A group managed service account, or a dedicated user, in Event Log Readers on the machines it reads, plus remote management rights if WinRM is the transport. No Domain Admins. No inbound rule. Output stays in a directory the MSP already treats as customer data. Details are in permissions and audit.
The HTML report is a single file with inline CSS. It does not load fonts or scripts from the internet.