Repository navigation
Conversation
|
Final validation at Both native interfaces remain viable in the tested environments. Outstanding deployment concern: both inspected x64 binaries import Generated by Coder Agents on behalf of @EhabY. |
|
Superseded by draft #1110, implementing the selected typed Windows static-CRT helper and universal production packaging. Comparison evidence remains in this PR and its retained branch; no experimental history was merged. Closing as requested after opening the successor. Generated by Coder Agents on behalf of @EhabY. |
Summary
Compare a Rust helper and Node-API addon for #1108 across manual ACL, low-level SDDL, and Microsoft typed-binding cores. Both alternatives retain one universal VSIX with Windows x64/ARM64. Neither is connected to production SSH generation; prototypes remain excluded from the production VSIX.
Static CRT follow-up — completed
At
1134c39, experiment run34846540409passed all five jobs: native x64, native ARM64, Linux/macOS bypass, and universal packaging. Seven configurations / fourteen universal packages were tested. Standard CI34846540275passed after retrying a macOS runner setup failure before repository checkout; no source fix was needed.Exact package bytes: helper 164748 → 261537; addon 237311 → 328950. Both packages include x64 and ARM64. Static helper native bytes: x64 259584; ARM64 254976.
report.jsonin run34846540409artifactacl-universal-prototypes.The user approved larger packages to reduce deployment dependencies. The measured tradeoff supports the typed static-CRT helper as the next deployment-validation candidate, not an approved production integration. No clean Windows environment without preinstalled runtimes was exercised. Direct imports do not prove absence of transitive/dynamically loaded dependencies. Signing, application control, DLL integrity/search, and production file handling remain unvalidated.
Earlier six-cell results (29de7d9)
At
29de7d9, prototype run34840561914and standard CI34840562010passed. All six configurations passed both native architectures under Node 22 and Electron 37/42; Linux/macOS bypass and all twelve real universal package inspections passed.Draft comparison only. Recommendation for discussion: narrow to the typed-binding helper and test static CRT plus semantic-test parity. No production choice is approved. Timing distributions, clean-machine deployment, signing/application control, and typed-binding + static CRT remain unvalidated.
Investigation, experiment plan, measurements, and limitations
Issue #1108 follows #1061 moving generated hosts into included files under
%APPDATA%\coder.coder-remote\ssh. POSIX modes do not repair Windows DACLs, and included files can inherit writable ACEs rejected by Windows OpenSSH.The shared core follows VS Code's Rust ACL precedent: protected DACL, full control for the process user's SID, SYSTEM, and Administrators, with inheritance only on directories. It validates ownership and rejects final reparse points through an opened handle. Neither interface needs PowerShell or icacls; icacls only arranges the deliberately bad test fixture.
Precedents investigated: VS Code
cli/src/tunnels/agent_host_registry_acl_windows.rs, Chromiumbase/win/security_descriptor.cc, Tailscaleatomicfile/atomicfile_windows.go, and Windows OpenSSHcontrib/win32/win32compat/w32-sshfileperm.c. Preserving the destination ACL during replacement does not repair an existing unsafe ACL.Approved experiment sequence:
windowstyped bindings.Universal package size
Each experimental package contains x64 and ARM64 assets for one interface.
These are compressed prototype sizes, not production extension sizes.
windows+ SDDL, opt sAll cells use LTO, one codegen unit, stripping, and unwind panic strategy. The
original source at
22a751efc2fc859641e387921e115d01829db1acwas rebuilt on thesame runners. At equal opt s, typed bindings add only 380 helper package bytes
and 693 addon package bytes. Size reductions versus original include compiler
optimization changes; they are not solely a dependency benefit. No latency
distributions were measured.
Handwritten Rust and dependency maintenance
Counts include production-core comments/blanks and exclude the line containing
its first
#[cfg(test)]and everything after it. Unsafe-token counts are roughindicators, not safety scores.
unsafetokenswindows+ SDDLThe typed implementation has 75 fewer lines than original (~18%), but more
unsafe sites. Some reduction comes from implementation choices such as
IsWellKnownSid, not the dependency alone. SDDL withwindows-sysdid notreduce total code or package size at equal opt 3; it replaces manual ACL layout
arithmetic with parser/conversion lifetime handling.
windows = 0.62.2supplies typed API signatures and some error plumbing, not acomplete safe ACL abstraction. We still own descriptor allocation lifetimes,
aligned token/SID storage, handle sequencing, and owner/reparse policy. It adds
11 registry packages to this experimental lockfile, not separately shipped DLLs.
A selected implementation would retain only one core.
The published-source dependency investigation found no complete maintained safe
wrapper matching this boundary.
winsafe 0.0.29lacks the central security-infoand SDDL APIs;
windows-aclandwindows-permissionsuse olderwinapibindingsand do not cover the whole policy;
qiongli-windows-securityhas a specializedowner-only policy rather than the required existing-handle protected-DACL write.
SID-only helpers and descriptor parsers cannot replace the central operation.
The Microsoft typed binding was therefore implemented and measured rather than
rejected on dependency count alone.
Runtime linkage
All dynamic cells import
VCRUNTIME140.dlland UCRT API-set DLLs on botharchitectures. Static CRT removes these explicit imports for both interfaces,
with approximately 94 KiB helper / 89 KiB addon universal-package growth versus
low-level opt s. Windows OS DLL dependencies remain.
The typed-binding plus static-CRT combination was not tested. Neither hosted
runner success nor import inspection proves clean-machine portability. Signing,
application control, DLL search/integrity, and addon CRT ownership boundaries
remain deployment review work. No production linkage choice has been made.
The consolidated measurements are in
report.jsonof theacl-universal-prototypesartifact from run34840561914. The workflow rebuildsall cells and records source revisions, compiler versions, PE imports, native
bytes, runtime outcomes, and package bytes.
The helper has separate process memory/crash containment, not a sandbox. The addon executes native code inside the extension host. Both retain the user's authority. Prior keyring binary issues affected macOS; bypass tests do not prove risk-free distribution.
Remaining gaps: typed-core independent exact-ACE/directory-inheritance test parity; latency distributions; clean Windows without preinstalled runtime; signing/application control; DLL search/integrity and addon CRT ownership review. Secure creation, parent-chain/hard-link hardening, migration, and production atomic writing are excluded. Prototype activation is inert.
CI harness corrections included semantic rather than textual SDDL assertions, mandatory real architecture payload checks, and an explicit empty-path fixture independent of the runner's Electron environment.
The initial harness commit
b698931was unexpectedly pushed by a delegated agent before authorization and was disclosed. It remains intact; the user subsequently authorized this draft PR and Windows runner tests. No history was rewritten.Generated by Coder Agents on behalf of @EhabY.