Skip to main content
Glama

Enclave Gateway (egw)

English · Русский

License: MIT Python 3.10+ Zero mandatory third-party Python dependencies MCP server

Run commands, transfer files and forward TCP connections from a macOS (Apple Silicon arm64 or Intel x86_64), Linux or Windows Host through an isolated Windows VPN Appliance and an RDP Bastion (TCP 3389), even when inbound SSH to Bastion is closed. The Appliance uses QEMU HVF / KVM / WHPX with matching Host/guest architectures; Windows Direct mode uses the existing Host instead of an isolated VM. Use the organization's approved Windows VPN client: ViPNet Client, АПКШ Континент, Cisco AnyConnect / Secure Client, OpenVPN, WireGuard or a custom provider. egw connects a local CLI or MCP client to the enclave's TargetNodes.

Host → QGA → Windows Appliance → RDP redirected drive → Bastion worker → SSH → TargetNode

The diagram shows the RDP route. When policy permits SSH, use the agentless route without a Bastion worker.

Standard operator scope. Standard mode is for a trusted operator and RDP session. Enterprise adds signed native isolation and verified identities. Neither mode replaces the organization's endpoint policy, VPN entitlement or host-key approval.

The latest release is 0.3.0 — Standard operator (0.3.0). Installed-release field acceptance passed on the recorded Standard operator route under KES 21.3.10.1001. Endpoint approval remains explicit. Other execution profiles retain their separate qualification boundaries. See the installed-release record and release scope.

Key capabilities

  • QEMU Appliance & 6 VPN Provider Adapters — vipnet, kontinent, anyconnect, openvpn, wireguard, custom. Installed-binary probes inspect PE architecture (arm64 / x86_64 / x86), Authenticode and exact configured versions/publisher. Matching configuration does not qualify a driver or VPN session. Optional egw provider install|connect|disconnect|import_key plans use a hash-pinned lifecycle manifest; apply requires its reviewed approval digest. No proprietary command line or key-import procedure is inferred.

  • Transactional RDP VFS Transport — [MS-RDPEFS] / \\tsclient redirected files, without custom virtual-channel .dll installation. Parallel Striped I/O and block deltas use SHA-256, default 4 MiB blocks and optional zlib compression. Standard executes commands in warm PowerShell runspaces; transfer scripts use a RunspacePool. No C# compiler or additional worker .exe is required.

  • Operator-started OpenSSH — the Standard operator structured_only profile can use operator with Stream for egw exec and egw cp to one Linux target through an approved RDP session.

    • Use egw cp --chunked for files up to 512 MiB after the worker advertises chunked_copy_slots_v1: true. Every 1 MiB block is verified with SHA-256.

    • On the isolated Windows Server 2022 RDP lab with KES 14.1, 3 MiB and 65 MiB transferred in both directions. All 136 blocks met the 15 s limit, with a slowest block of 2.692 s and zero new KES events. Setup and qualification scope.

  • Multi-Hop SSH, SOCKS5 & Port Forwarding — egw exec, cp and sync; bidirectional TCP multiplexing and RFC 1928 SOCKS5 (egw socks5); OpenSSH ProxyCommand (egw ssh, stdio-proxy, ssh-config); supervised forwards (egw forward), terminal monitoring (egw top) and layered L1–L7 diagnostics (egw doctor, heal). SSH requires verified host keys and credentials on the executing hop; transport compatibility and latency need deployment validation.

  • Governed MCP Server (stdio & HTTP) — connect MCP clients and IDEs with egw mcp, role/tool/node/path policies and PrincipalRouter backends. DestructiveCommandGuard checks commands, SecretScrubber filters registered and recognized secret patterns, FlightRecorder provides hash-linked audit, and egw transactions retains operation identities/outcomes. These controls supplement explicit authorization and Enterprise OS isolation; command checks and scrubbing cannot recognize every possible shell effect or secret.

Related MCP server: safe-mcp-bridge-v2

Start with an existing environment

You need Python 3.10+, an existing Windows Appliance with its QGA channel exposed to the Host, a working approved VPN/RDP route, PowerShell FullLanguage and an OpenSSH client on the Bastion. New VM provisioning is a separate installation step. Proprietary VPN installers, licenses, credentials and images are not bundled.

git clone https://github.com/pom6i4/enclave-gateway.git
cd enclave-gateway
python3 -m venv .venv
.venv/bin/python -m pip install -e .
.venv/bin/egw config init
# Or: cp config/enclave.example.yaml enclave.yaml
# Edit the VM paths, Bastion and TargetNode.
.venv/bin/egw config check
.venv/bin/egw doctor --preflight
.venv/bin/egw agents stage

On Windows use .venv\Scripts\python.exe and .venv\Scripts\egw.exe; see installation.

For a global installation, use egw config init --global. The CLI can then run from any directory; the global configuration and private state are selected without a shell wrapper. See configuration discovery for precedence and environment overrides.

Connect the Appliance's approved RDP session to the Bastion with drive redirection. Run the command printed by agents stage inside that Bastion session. It copies the verified scripts locally on Bastion and starts a foreground in-process worker in Standard mode: no C# compiler, additional .exe or code-signing certificate is needed. The existing execution policy must permit the scripts; WDAC/AppLocker/ConstrainedLanguage are respected.

Provision verified SSH host keys and a login key on the hop that executes SSH (instructions), then:

.venv/bin/egw doctor --probe-targets
.venv/bin/egw exec app01 'id'
echo hello > hello.txt
.venv/bin/egw cp hello.txt app01:/tmp/hello.txt

egw heal also stages the agents in named modes, repairs Appliance settings and reconnects its managed RDP session. Until the worker is started on Bastion it can return SESSION_PENDING_WORKER; staging alone does not start a remote process.

For high-latency redirected drives, evaluate the explicit bastion.spool_protocol: stream option. The compatible file protocol remains the default; switching requires restarting the worker with the same configuration. For measured Stream performance and the cold-start acceptance boundary, see the source baseline.

Choose a trust model

Standard

Enterprise

Intended use

Trusted operator/session

Governed deployment and isolated service principals

Worker commands

In-process PowerShell runspaces

Native owned process jobs

Additional binaries

None for key-based SSH

Approved egw-runtime.exe, and askpass for passwords

Code trust

Reviewed source under endpoint policy

Authenticode, approved release/CMS verification and pinned hashes

Worker identity

Session trust; heartbeat is liveness

Fresh release/runtime/SID attestation

Multiuser MCP

No hostile-principal isolation claim

Explicit policy plus per-principal OS backends

Enterprise is configured with its template and security/deployment guide. Missing requirements fail closed; there is no automatic downgrade. Configurations without security.mode retain their existing Custom defaults. A new CLI-generated config explicitly selects Standard; migrating an existing deployment is an operator decision.

Documentation

The CLI includes exec, cp, sync, ssh, ssh-config, tunnel, socks5, forward, status, doctor, top and mcp. Run egw --help for the full list.

License: MIT.

Available Tools

18 tools
enclave_agentB

Verify fresh running-worker evidence against pinned release hash, signer, OS account and execution model.

Inputs: no named parameters.

enclave_auditB

Retrieve recent session audit log entries from the FlightRecorder and verify its SHA-256 hash chain integrity.

Inputs: limit.

enclave_capabilitiesB

Report local capabilities and explicit unverified qualification boundaries without probing a live enclave.

Inputs: no named parameters.

enclave_cleanB

Purge transient spool chunks, staging files, and open multiplexed sockets across Appliance and Bastion.

Inputs: tx_id.

enclave_doctorB

Run L1-L7 diagnostics across Host, Appliance clock skew, RDP UDP blackhole guard, VPN tunnel, Bastion VFS RTT, and optional TargetNode SSH.

Inputs: fix, probe_targets.

enclave_healB

Heal Appliance MTU (1350), disable RDP-over-UDP, optionally refresh interactive session credentials, and reconnect the Bastion RDP session.

Inputs: tx_id, update_credentials.

enclave_providerC

Plan/apply an administrator-approved, version-pinned provider lifecycle recipe. No inferred proprietary commands.

Inputs: action (required), apply, tx_id, approval_digest.

enclave_ssh_configA

Generate an OpenSSH ~/.ssh/config snippet using egw stdio-proxy %h %p for native ssh/rsync/IDE Remote-SSH.

Inputs: prefix.

enclave_statusB

Retrieve health telemetry for the Appliance VM, VPN tunnel, Bastion RDP VFS worker, and configured TargetNodes.

Inputs: no named parameters.

enclave_transactionC

Get/list operation state and retained result, request cancellation, or mark expired execution indeterminate. Identity comes from the authenticated connection.

Inputs: limit, tx_id, action.

enclave_tunnelB

Dynamically start, stop, or list background TCP port forwards or universal SOCKS5/HTTP proxies over RdpVfsTransport.

Inputs: action (required), mode, local_port, target_host, +1 more.

node_db_queryC

Execute a SQL statement on a TargetNode (either directly on the host or inside a Docker container) without CLI password exposure.

Inputs: node (required), query (required), engine (required), db_user, +4 more.

node_execB

Execute a shell/PowerShell script on '@appliance', '@bastion', or a configured TargetNode with Base64 transport and secret scrubbing.

Inputs: node (required), script (required), env, tx_id, +4 more.

node_http_requestC

Perform an HTTP/HTTPS request from inside a TargetNode to inspect internal services.

Inputs: url (required), node (required), body, method, +2 more.

node_patch_fileB

Atomically replace a target block inside a remote UTF-8 file on '@appliance', '@bastion', or a TargetNode with optional SHA-256 precondition check.

Inputs: node (required), target (required), remote_path (required), replacement (required), +3 more.

node_read_fileA

Read a UTF-8 file (or line range) from '@appliance', '@bastion', or a TargetNode with SHA-256 hash and secret scrubbing.

Inputs: node (required), remote_path (required), tx_id, as_root, +2 more.

node_syncA

Synchronize a directory between the Host and a node; scoped grants commit each file atomically and retain extra destination files.

Inputs: node (required), direction (required), local_dir (required), remote_dir (required), +3 more.

node_transferB

Push or pull a file between the Host and '@appliance', '@bastion', or a TargetNode with SHA-256 verification and optional block delta sync.

Inputs: node (required), direction (required), local_path (required), remote_path (required), +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 18 tools

    Disambiguation4/5

    Most tools map cleanly to a distinct resource+action (file read/patch, exec, transfer, sync, db_query, http_request, tunnel, audit, transaction). The main overlap is enclave_status vs enclave_doctor (both report health/diagnostics) and enclave_heal vs enclave_clean (both remediation), which could cause occasional misselection despite descriptions that differentiate them.

    Naming Consistency4/5

    Strong two-prefix scheme (enclave_* for control-plane, node_* for remote operations) applied uniformly across all 18 tools. Minor deviation: node_* tools use clear verbs (read_file, exec, sync) while enclave_* tools mix nouns (status, tunnel, audit, capabilities) with verbs (heal, clean), so the action is not always evident from the name alone.

    Tool Count4/5

    18 tools sits at the upper end of the comfortable range, but the domain is genuinely broad (appliance, VPN/bastion, target nodes, diagnostics, remediation, tunneling, SQL/HTTP probing). Each tool covers a distinct operational need rather than being redundant padding, so the count is defensible.

    Completeness4/5

    Covers the lifecycle well: status/doctor/heal/clean for health, read/patch/transfer/sync for files, exec/db_query/http_request for remote action, plus tunnel, audit, transaction, capabilities and ssh_config. Minor gaps: no explicit remote directory listing or file delete (workable via node_exec or node_sync), and no dedicated tunnel health/teardown verification beyond enclave_tunnel's list mode.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      A fail-closed policy boundary that translates local stdio MCP clients to authenticated Streamable HTTP servers, enforcing allowlists or read-only modes and redacting credentials from audit trails.
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      A custom MCP server for orchestrating Windows/Linux/macOS workstations, providing filesystem, shell, SSH, and personal productivity tools with security features like allowlisting and human-in-the-loop approval for writes.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to securely connect to a paired Windows machine through a self-hosted Cloudflare relay and use its local filesystem and command-execution tools over Streamable HTTP and WebSocket.
      54 npm
      1
      MIT