Skip to content

Commit 172b65e

Browse files
authored
docs: fix first-network-policy sandbox lifecycle flow (NVIDIA#3140)
The tutorial told users to exit the sandbox and reconnect later, but exiting the interactive shell stops the sandbox's main process and it is not reconnectable under the default restart policy. Switch to the two-terminal flow already used by the github-sandbox tutorial so the sandbox stays running, matching what examples/sandbox-policy-quickstart/ demo.sh actually does. Related: NVIDIA#2998, NVIDIA#2798 Signed-off-by: Russell Bryant <[email protected]>
1 parent 8e73f1d commit 172b65e

1 file changed

Lines changed: 8 additions & 19 deletions

File tree

‎docs/get-started/tutorials/first-network-policy.mdx‎

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,16 @@ The request fails. By default, all outbound network traffic is denied. The sandb
6565
curl: (56) Received HTTP code 403 from proxy after CONNECT
6666
```
6767

68-
Exit the sandbox. Sandboxes are kept running by default, so you can reconnect later. Use `--no-keep` at creation time if you want the sandbox deleted after exit:
68+
Leave this sandbox shell open and switch to a second terminal on your host for the next steps. The remaining `openshell` commands (checking logs and applying the policy) run on your host, not inside the sandbox.
6969

70-
```shell
71-
exit
72-
```
70+
<Note>
71+
Keep the interactive sandbox shell open for the rest of the tutorial. Exiting it stops the sandbox's main process, and with the default restart policy the sandbox is not reconnectable afterward. Add `--no-keep` at creation time if you want the sandbox deleted automatically when you exit.
72+
73+
</Note>
7374

7475
## Check the Deny Log
7576

76-
Every denied connection produces a structured log entry. Query the sandbox logs from your host to confirm the denial and inspect the reason.
77+
Every denied connection produces a structured log entry. In your second (host) terminal, query the sandbox logs to confirm the denial and inspect the reason.
7778

7879
```shell
7980
openshell logs demo --since 5m
@@ -135,13 +136,7 @@ This tutorial uses `curl` and `read-only` access to keep things simple. When bui
135136

136137
## Verify If GET Requests Are Allowed
137138

138-
The policy is now active. Reconnect to the sandbox and retry the same request to confirm that read access works.
139-
140-
```shell
141-
openshell sandbox connect demo
142-
```
143-
144-
Retry the same request:
139+
The policy is now active. Return to your sandbox shell in the first terminal (it is still running) and retry the same request to confirm that read access works:
145140

146141
```shell
147142
curl -s https://api.github.com/zen
@@ -169,15 +164,9 @@ curl -s -X POST https://api.github.com/repos/octocat/hello-world/issues \
169164

170165
The CONNECT request succeeded because `api.github.com` is allowed, but the L7 proxy inspected the HTTP method and returned `403`. `POST` is not in the `read-only` preset. An agent with this policy can read code from GitHub but cannot create issues, push commits, or modify anything.
171166

172-
Exit the sandbox:
173-
174-
```shell
175-
exit
176-
```
177-
178167
## Check the L7 Deny Log
179168

180-
L7 denials are logged separately from connection-level denials. The log entry includes the exact HTTP method and path that the proxy rejected.
169+
L7 denials are logged separately from connection-level denials. The log entry includes the exact HTTP method and path that the proxy rejected. Run this from your second (host) terminal, leaving the sandbox shell open:
181170

182171
```shell
183172
openshell logs demo --level warn --since 5m

0 commit comments

Comments
 (0)