Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/windows-protected-launch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Windows protected launch

on:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
native-aot:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Publish cooperative Native AOT peer
run: dotnet publish tests/NativeSnapshotWorker/NativeSnapshotWorker.csproj -c Release -f net10.0 -r win-x64 -p:PublishAot=true -p:TargetFrameworks=net10.0 -o native-snapshot-peer
- name: Exercise snapshot and process ownership
shell: pwsh
run: |
$env:GU_WINDOWS_SNAPSHOT_PEER = Join-Path $PWD 'native-snapshot-peer\NativeSnapshotWorker.exe'
dotnet test tests/CoreTest/CoreTest.csproj -c Release --filter "FullyQualifiedName~WindowsImageSnapshotLeaseTests" --logger "console;verbosity=detailed"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
68 changes: 68 additions & 0 deletions docs/windows-protected-launch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Windows protected native launch

`WindowsNativeLaunchLease` is an opt-in primitive, not an authenticated channel
or an updater integration. It is available on .NET 8 and later and requires
Windows 10 version 2004 or later and local fixed NTFS paths. Other platforms
fail closed. The default profile is disabled; the host must explicitly select
`TrustedWindowsSystemAndCooperativeNativeAot`.

The host must pin the absolute source executable path and SHA-256, explicitly
list every required application DLL name in a separately audited manifest and
provide exactly one pinned dependency file for each name, provide an explicit
list of names that the deployer has established are trusted Windows system
modules, and provide an absolute staging parent. The launcher checks normal and
delay import names in the staged native PE files against these lists and rejects
forwarded application exports. The system-name list is a deployer assertion,
not proof that a file in System32 is a Windows component. The host must also
audit application SxS manifests and the peer's runtime loading behavior.
An application name cannot also be classified as a system name. The host must
audit both lists for the exact peer; omitting an application name from both the
manifest and the files, or falsely classifying it as a system name, cannot be
detected from names alone. The system list must not be generated by treating
unknown imports as system imports.
Source directories and files are checked and leased while
copying. The launcher atomically creates a new private protected-DACL directory,
copies only the authorized files, checks the staged bytes, and holds the staged
objects and their namespace until the owned job is stopped. An existing writer
or delete handle to a source file makes acquisition fail. Normal deployment can
replace a source after its copy is complete; it does not change the snapshot.
Directory sharing does not freeze directory contents or security descriptors.

The selected profile **trusts the Windows loader, API-set and SxS resolution,
and system DLLs**. The deployer must ensure untrusted users have not retained
write, delete, WRITE_DAC or WRITE_OWNER capabilities to those system objects.
This historical condition is not established by this API, a System32 path,
signatures, or repeated ACL checks. It does not extend to application DLLs.
The host must authorize the exact Native AOT peer hash and its cooperative
entry-point contract: before processing sensitive input, the peer restricts
DLL searches to its snapshot and trusted Windows system directories and loads
application dependencies by their absolute staged paths. It must not depend on
an application assembly supplied through an unaudited SxS manifest. This is not a sandbox:
trusted peer code can deliberately load other paths.

The process starts suspended in a creation-time kill-on-close job, with no
inherited handles, then is resumed only after job membership is confirmed.
`DuplicateProcessHandle` returns an independently disposable query/synchronize
handle to the actual process; it does not authenticate the peer. Keep the
launch lease alive for the entire required operation and dispose duplicated
process handles when no longer needed.
`WaitForExitAsync`
returns the exit code; cancellation terminates the job and releases the lease.
`DisposeAsync` terminates the job, waits for its processes to exit, and attempts
identity-checked, non-recursive cleanup. Cleanup failures are reported.
The lease remains rooted until disposal; neglecting it retains resources.

The executable path, working directory and `AppContext.BaseDirectory` are in
staging, not the original installation. The host must provide installation
context separately; applications depending on relative paths must be adapted.
Each launch uses disk space for a full copy. Failed creation, a crash or a
failed cleanup can leave protected staging files; no crash recovery is provided.
Cleanup must never delete a replacement by path. Parent termination closes the
job, but does not guarantee immediate cleanup.

This boundary excludes malicious processes running as the same Windows user and
administrators. It does not claim kernel image-section identity, prevent all
behavior of the authorized program, authenticate either peer, or replace a
later handshake and endpoint authorization. Do not pass credentials or nonces
in arguments, environment variables, files or logs. No Client/Updater wiring,
IPC or credential transfer is provided.
Loading
Loading