Skip to content

Commit 214be06

Browse files
committed
test(e2e): reflect graceful gateway tmpfs remount
Signed-off-by: Aaron Erickson <[email protected]>
1 parent e7e8b67 commit 214be06

4 files changed

Lines changed: 40 additions & 14 deletions

File tree

‎docs/security/openshell-0.0.85-migration-review.md‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ Commits: `80293213`, `392ad639`, `b4be33e5`, `21aaa895`, `3dee5570`.
654654
| `OS85-10` | Medium-high | Supervisor TLS identity variables are no longer child environment. Stale tests/comments can normalize a credential leak. | Assert absence from entrypoint, exec, and connect children and update the source-of-truth rationale. | Hermes and Deep Agents now reject all three variables; the stable entrypoint, exec, and connect probes require their absence, with exact-head execution pending. |
655655
| `OS85-11` | Medium-high | Live `/proc/<pid>/exe` identity changes replacement-time policy behavior. | Prove old process survives replacement and a new altered process at the same path is denied. | The stable release proof runs both processes against the real proxy and requires old=200 before/after replacement, distinct live/path hashes, and new=403; exact-head runtime result pending. |
656656
| `OS85-12` | Medium | OpenShell declares Docker 28.0+ while #6379 is on Docker 27 and NemoClaw marks DGX Spark tested. | Either validate and document a precise downstream exception from physical proof or raise the supported floor and preflight it. | Open product/platform decision. |
657-
| `OS85-13` | Low | Mount parsing/SELinux changes could affect the test-only tmpfs path. | Rerun the EXDEV tmpfs fixture and retain production no-mount evidence. | The stable release proof injects only the reviewed tmpfs config, requires Docker's structured tmpfs representation plus `noexec`/01777 at runtime, retains it across gateway restart, and requires a fresh remount after rebuild. The wrapper is disabled outside the explicit proof lane and production still supplies no driver mounts. Exact-head, Podman, and enforcing-SELinux results remain open. |
657+
| `OS85-13` | Low | Mount parsing/SELinux changes could affect the test-only tmpfs path. | Rerun the EXDEV tmpfs fixture and retain production no-mount evidence. | The stable release proof injects only the reviewed tmpfs config, requires Docker's structured tmpfs representation plus `noexec`/01777 at runtime, requires an empty remount after graceful gateway restart with the same container/config/auth and retained durable state, and requires another fresh remount after rebuild. The wrapper is disabled outside the explicit proof lane and production still supplies no driver mounts. Exact-head, Podman, and enforcing-SELinux results remain open. |
658658
| `OS85-14` | Low | Sanitized MCP tool names are newly present in logs. | Record the additive observability/privacy behavior; ensure no downstream parser assumes the old shape. | The stable release check requires the real `fake_echo` tool name and rejects argument/result canaries or an `arguments` field in JSON-RPC policy logs; exact-head runtime result pending. |
659659
| `OS85-15` | High | The installer-hash workflow executes its checker and parser from the PR base SHA. One PR cannot safely teach that trusted base about a new release and consume the release; using the head checker would let reviewed code define its own trust rules. | First land archive safety, normalized full-script template validation, and multi-release trust while selectors remain `0.0.72`; prove the old base rejects a new release and the new base permits only structured release-data changes; then land the exact `0.0.85` manifest identities before refreshing this selector PR. | Base trust landed in #7069. #6778 and #6779 established base-owned structured manifest and sandbox-map validation; #7069 added only the three exact `0.0.85` release identities while retaining `0.0.72` and `0.0.82`. This selector PR must be based on that trusted state and pass the checker without relying on its head copy. |
660660
| `OS85-16` | High | Capability clearing now depends on `capctl 0.2.4` and `bitflags 1.3.2`, but upstream notices are unchanged and the consumed binaries have no published SBOM or attestation covering this dependency graph. | Bind crate checksums and source identities to the stable lock and binaries; review the unsafe syscall boundary and advisories; update notices/licenses; retain a generated SBOM and provenance for every consumed binary. | The stable lock, crate checksums, source identities, licenses, unsafe boundary, current RustSec absence, and SLSA-bound archives are recorded. Upstream still publishes no binary SBOM and its unchanged notices omit the new graph; that limitation remains explicit rather than being presented as complete attribution. |
@@ -740,15 +740,17 @@ The proof does not treat successful onboarding as evidence by itself. It:
740740
`Type=tmpfs` mount and must not appear in `HostConfig.Binds`, which is the
741741
representation changed for SELinux-labelled bind mounts. Inside the sandbox,
742742
`/proc/mounts` must report `tmpfs,noexec`, mode 01777, and a writable marker.
743-
5. Stops and recovers the actual host OpenShell gateway through NemoClaw. The
744-
gateway PID must change, the rendered-config digest and sandbox container ID
745-
must not, the release binary/listeners/auth path must still match, and both
746-
the tmpfs marker and a Deep Agents durable-state marker must remain.
743+
5. Stops and recovers the actual host OpenShell gateway through NemoClaw. A
744+
graceful gateway shutdown stops the managed Docker sandbox, and startup
745+
resumes that same container. The gateway PID must change, the rendered-config
746+
digest and sandbox container ID must not, and the release
747+
binary/listeners/auth path must still match. The tmpfs is remounted empty,
748+
while the Deep Agents marker under durable `/sandbox` state must remain.
747749
6. Runs the existing managed MCP rebuild with the same test-only wrapper. A new
748-
Docker container is required, the tmpfs must be mounted again with the same
749-
representation/options but without its old volatile marker, and the backed-up
750-
Deep Agents state marker must be restored. This distinguishes a fresh tmpfs
751-
mount from an accidentally retained container.
750+
Docker container is required, the tmpfs must again have the same
751+
representation/options and no volatile marker, and the backed-up Deep Agents
752+
state marker must be restored. The new container identity plus the fresh tmpfs
753+
mount prove that the driver config was reapplied during rebuild.
752754

753755
The proof is intentionally Linux amd64 Docker-bridge evidence. It does not
754756
isolate Docker Desktop/Colima, WSL, DGX Spark's Docker 27 host-gateway route,

‎test/e2e/live/openshell-exact-main-driver-config.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import type { CleanupRegistry } from "../fixtures/cleanup.ts";
1616
import { resultText } from "../fixtures/clients/command.ts";
1717
import type { HostCliClient } from "../fixtures/clients/host.ts";
1818
import {
19-
sandboxAccessEnv,
2019
type SandboxClient,
20+
sandboxAccessEnv,
2121
trustedSandboxShellScript,
2222
} from "../fixtures/clients/sandbox.ts";
2323
import { expect } from "../fixtures/e2e-test.ts";
@@ -662,12 +662,15 @@ export async function restartAndAssertExactMainDriverConfig(options: {
662662
expect(snapshot.config.configSha256, "rendered selected-driver config must be stable").toBe(
663663
baseline.config.configSha256,
664664
);
665+
// OpenShell's graceful gateway shutdown stops managed Docker sandboxes and
666+
// startup resumes them. Docker therefore remounts the same container's
667+
// volatile tmpfs empty while the durable /sandbox state survives.
665668
await assertSandboxMountAndAuth({
666669
phase: "after-gateway-restart",
667670
sandbox: options.sandbox,
668671
sandboxName: options.sandboxName,
669672
durableMarkerValue: options.proof.durableMarkerValue!,
670-
tmpfsMarker: "present",
673+
tmpfsMarker: "absent",
671674
});
672675
await options.host.expectListed(options.sandboxName, {
673676
artifactName: "exact-main-driver-nemoclaw-list-after-gateway-restart",
@@ -685,7 +688,7 @@ export async function restartAndAssertExactMainDriverConfig(options: {
685688
"after-gateway-restart",
686689
options.proof,
687690
snapshot,
688-
"same-container-tmpfs-and-durable-state-retained",
691+
"same-container-tmpfs-remounted-and-durable-state-retained",
689692
);
690693
}
691694

‎test/e2e/support/openshell-exact-main-driver-config.test.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,22 @@ describe("exact-main selected-driver config proof boundary", () => {
9696
fs.rmSync(fixture, { recursive: true, force: true });
9797
}
9898
});
99+
100+
it("expects graceful gateway recovery to remount tmpfs while retaining durable state", () => {
101+
const source = fs.readFileSync(
102+
path.join("test", "e2e", "live", "openshell-exact-main-driver-config.ts"),
103+
"utf8",
104+
);
105+
const restart = source.match(
106+
/export async function restartAndAssertExactMainDriverConfig[\s\S]*?(?=\nexport async function assertExactMainDriverConfigAfterRebuild)/u,
107+
)?.[0];
108+
109+
expect(restart).toBeDefined();
110+
expect(restart).toContain('tmpfsMarker: "absent"');
111+
expect(restart).not.toContain('tmpfsMarker: "present"');
112+
expect(restart).toContain("baseline.containerId");
113+
expect(restart).toContain("baseline.config.configSha256");
114+
expect(restart).toContain("durableMarkerValue: options.proof.durableMarkerValue!");
115+
expect(restart).toContain('"same-container-tmpfs-remounted-and-durable-state-retained"');
116+
});
99117
});

‎test/openshell-0.0.85-migration-review.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,11 @@ describe("OpenShell 0.0.85 migration review", () => {
228228
expect(helper).toContain("fs.realpathSync(`/proc/${gatewayPid}/exe`)");
229229
expect(helper).toContain('["-H", "-ltnp"]');
230230
expect(helper).toContain('"{{json .HostConfig.Binds}}"');
231-
expect(helper).toContain('tmpfsMarker: "present"');
232-
expect(helper).toContain('tmpfsMarker: "absent"');
231+
expect(helper).not.toContain('tmpfsMarker: "present"');
232+
expect(helper.match(/tmpfsMarker: "absent",/gu)).toHaveLength(2);
233+
expect(helper).toContain('"same-container-tmpfs-remounted-and-durable-state-retained"');
234+
expect(review).toContain("graceful gateway shutdown stops the managed Docker sandbox");
235+
expect(review).toContain("tmpfs is remounted empty");
233236

234237
const mcpProof = fs.readFileSync(
235238
path.join(repoRoot, "test/e2e/live/openshell-exact-main-mcp-proof.ts"),

0 commit comments

Comments
 (0)