@holoscript/holosystem 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -3
- package/bin/holosystem.mjs +21 -0
- package/docs/vm-launch-threat-model.md +91 -23
- package/native/windows-sandbox/Canary.c +107 -0
- package/native/windows-sandbox/Program.cs +1117 -0
- package/native/windows-sandbox/README.md +30 -0
- package/native/windows-sandbox/build.ps1 +48 -0
- package/native/windows-x64/holosystem-appcontainer-canary.exe +0 -0
- package/native/windows-x64/holosystem-sandbox-launcher.exe +0 -0
- package/package.json +2 -1
- package/src/index.mjs +20 -0
- package/src/vm-launch.mjs +684 -28
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Windows low-integrity Job launcher
|
|
2
|
+
|
|
3
|
+
`Program.cs` is the auditable source for the Windows AMD64 launcher consumed by
|
|
4
|
+
`vm-launch-whpx-sandboxed`. `Canary.c` is the native zero-capability file and
|
|
5
|
+
loopback probe consumed only by `vm-launch-whpx-appcontainer`. `build.ps1`
|
|
6
|
+
compiles the launcher with the inbox .NET
|
|
7
|
+
Framework AMD64 compiler and writes the measured artifact to
|
|
8
|
+
`../windows-x64/holosystem-sandbox-launcher.exe`; it compiles the canary with
|
|
9
|
+
the installed Visual C++ AMD64 tools into
|
|
10
|
+
`../windows-x64/holosystem-appcontainer-canary.exe`.
|
|
11
|
+
|
|
12
|
+
The release contract pins the executable digest, not an unverified source-build
|
|
13
|
+
claim. The inbox compiler does not offer deterministic output, so a rebuild is
|
|
14
|
+
expected to change the binary digest even when the source is unchanged. Review
|
|
15
|
+
the source and binary delta, update the plan fixture, run the HoloSystem package
|
|
16
|
+
checks, and complete a real two-launch WHPX receipt before publishing a rebuilt
|
|
17
|
+
launcher.
|
|
18
|
+
|
|
19
|
+
The low-integrity adapter applies only the process controls it reports: maximum-privilege
|
|
20
|
+
filtering, low integrity, an explicit three-handle inheritance list, and a
|
|
21
|
+
pre-resume Job Object with kill, process-count, memory, and UI limits. It is not
|
|
22
|
+
an AppContainer and does not claim filesystem confidentiality or network
|
|
23
|
+
capability isolation.
|
|
24
|
+
|
|
25
|
+
The AppContainer adapter creates an ephemeral zero-capability identity, applies
|
|
26
|
+
fixed snapshot/temp grants, and runs the measured native canary under the same
|
|
27
|
+
restricted AppContainer token before starting QEMU. Both binaries are pinned by
|
|
28
|
+
the plan and remeasured around each launch. A successful canary is not enough:
|
|
29
|
+
the launcher requires exact file and Winsock access-denied evidence and verifies
|
|
30
|
+
the suspended QEMU token independently.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
$ErrorActionPreference = 'Stop'
|
|
2
|
+
|
|
3
|
+
$source = Join-Path $PSScriptRoot 'Program.cs'
|
|
4
|
+
$outputDirectory = Join-Path (Split-Path $PSScriptRoot -Parent) 'windows-x64'
|
|
5
|
+
$output = Join-Path $outputDirectory 'holosystem-sandbox-launcher.exe'
|
|
6
|
+
$canarySource = Join-Path $PSScriptRoot 'Canary.c'
|
|
7
|
+
$canaryOutput = Join-Path $outputDirectory 'holosystem-appcontainer-canary.exe'
|
|
8
|
+
$compiler = Join-Path $env:SystemRoot 'Microsoft.NET\Framework64\v4.0.30319\csc.exe'
|
|
9
|
+
|
|
10
|
+
if (-not (Test-Path -LiteralPath $compiler -PathType Leaf)) {
|
|
11
|
+
throw 'The Windows .NET Framework AMD64 compiler is unavailable.'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
New-Item -ItemType Directory -Path $outputDirectory -Force | Out-Null
|
|
15
|
+
& $compiler /nologo /target:exe /platform:x64 /optimize+ /debug- /out:$output $source
|
|
16
|
+
if ($LASTEXITCODE -ne 0) {
|
|
17
|
+
throw "Native sandbox launcher compilation failed with exit code $LASTEXITCODE."
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
$vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe'
|
|
21
|
+
$visualStudio = & $vswhere -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
|
22
|
+
if (-not $visualStudio) {
|
|
23
|
+
throw 'The Visual C++ AMD64 build tools are unavailable.'
|
|
24
|
+
}
|
|
25
|
+
$msvc = Get-ChildItem (Join-Path $visualStudio 'VC\Tools\MSVC') -Directory | Sort-Object Name -Descending | Select-Object -First 1
|
|
26
|
+
$kitsRoot = Join-Path ${env:ProgramFiles(x86)} 'Windows Kits\10'
|
|
27
|
+
$kit = Get-ChildItem (Join-Path $kitsRoot 'Include') -Directory | Sort-Object Name -Descending | Select-Object -First 1
|
|
28
|
+
if (-not $msvc -or -not $kit) {
|
|
29
|
+
throw 'The Visual C++ or Windows SDK directories are unavailable.'
|
|
30
|
+
}
|
|
31
|
+
$env:Path = "$(Join-Path $msvc.FullName 'bin\Hostx64\x64');$env:Path"
|
|
32
|
+
$env:Include = @(
|
|
33
|
+
(Join-Path $msvc.FullName 'include'),
|
|
34
|
+
(Join-Path $kit.FullName 'ucrt'),
|
|
35
|
+
(Join-Path $kit.FullName 'shared'),
|
|
36
|
+
(Join-Path $kit.FullName 'um')
|
|
37
|
+
) -join ';'
|
|
38
|
+
$env:Lib = @(
|
|
39
|
+
(Join-Path $msvc.FullName 'lib\x64'),
|
|
40
|
+
(Join-Path $kitsRoot "Lib\$($kit.Name)\ucrt\x64"),
|
|
41
|
+
(Join-Path $kitsRoot "Lib\$($kit.Name)\um\x64")
|
|
42
|
+
) -join ';'
|
|
43
|
+
& cl.exe /nologo /O2 /MT /W4 /WX /DUNICODE /D_UNICODE "/Fe:$canaryOutput" $canarySource /link ws2_32.lib advapi32.lib
|
|
44
|
+
if ($LASTEXITCODE -ne 0) {
|
|
45
|
+
throw "Native AppContainer canary compilation failed with exit code $LASTEXITCODE."
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
Get-FileHash -LiteralPath $output, $canaryOutput -Algorithm SHA256 | Select-Object Path, Hash
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holoscript/holosystem",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Portable bootstrap, consumption catalog, lineage, and bounded-work contract for HoloSystem consumers.",
|
|
5
5
|
"releaseLane": "v0-preview",
|
|
6
6
|
"keywords": [
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"files": [
|
|
35
35
|
"bin",
|
|
36
36
|
"docs",
|
|
37
|
+
"native",
|
|
37
38
|
"src",
|
|
38
39
|
"README.md",
|
|
39
40
|
"LICENSE"
|
package/src/index.mjs
CHANGED
|
@@ -30,11 +30,31 @@ export {
|
|
|
30
30
|
HOLOSYSTEM_VM_LAUNCH_RECEIPT_SCHEMA,
|
|
31
31
|
HOLOSYSTEM_WHPX_VM_LAUNCH_PLAN_SCHEMA,
|
|
32
32
|
HOLOSYSTEM_WHPX_VM_LAUNCH_RECEIPT_SCHEMA,
|
|
33
|
+
HOLOSYSTEM_WHPX_SANDBOXED_VM_LAUNCH_PLAN_SCHEMA,
|
|
34
|
+
HOLOSYSTEM_WHPX_SANDBOXED_VM_LAUNCH_RECEIPT_SCHEMA,
|
|
35
|
+
HOLOSYSTEM_WHPX_APPCONTAINER_VM_LAUNCH_PLAN_SCHEMA,
|
|
36
|
+
HOLOSYSTEM_WHPX_APPCONTAINER_VM_LAUNCH_RECEIPT_SCHEMA,
|
|
37
|
+
HOLOSYSTEM_APPCONTAINER_VM_LAUNCH_PLAN_SCHEMA,
|
|
38
|
+
HOLOSYSTEM_APPCONTAINER_VM_LAUNCH_RECEIPT_SCHEMA,
|
|
39
|
+
HOLOSYSTEM_WINDOWS_APPCONTAINER_PROTOCOL,
|
|
40
|
+
HOLOSYSTEM_WINDOWS_APPCONTAINER_CANARY_DIGEST,
|
|
41
|
+
HOLOSYSTEM_WINDOWS_APPCONTAINER_CANARY_SCHEMA,
|
|
42
|
+
HOLOSYSTEM_WINDOWS_SANDBOX_LAUNCHER_DIGEST,
|
|
43
|
+
HOLOSYSTEM_WINDOWS_SANDBOX_LAUNCHER_SCHEMA,
|
|
44
|
+
HOLOSYSTEM_WINDOWS_SANDBOX_PROTOCOL,
|
|
33
45
|
inspectVmExecutor,
|
|
46
|
+
inspectAppContainerVmLaunchPlan,
|
|
34
47
|
inspectVmLaunchAsset,
|
|
35
48
|
inspectVmLaunchPlan,
|
|
49
|
+
inspectWindowsVmSandboxLauncher,
|
|
50
|
+
inspectWindowsVmAppContainerCanary,
|
|
51
|
+
inspectWhpxSandboxedVmLaunchPlan,
|
|
52
|
+
inspectWhpxAppContainerVmLaunchPlan,
|
|
36
53
|
inspectWhpxVmLaunchPlan,
|
|
37
54
|
runVmLaunch,
|
|
55
|
+
runAppContainerVmLaunch,
|
|
56
|
+
runWhpxSandboxedVmLaunch,
|
|
57
|
+
runWhpxAppContainerVmLaunch,
|
|
38
58
|
runWhpxVmLaunch,
|
|
39
59
|
} from './vm-launch.mjs';
|
|
40
60
|
|