Skip to content

docs(examples): add sandbox policy quickstart walkthrough#266

Merged
zredlined merged 4 commits intomainfrom
aw/getting-started-examples
Mar 13, 2026
Merged

docs(examples): add sandbox policy quickstart walkthrough#266
zredlined merged 4 commits intomainfrom
aw/getting-started-examples

Conversation

@zredlined
Copy link
Copy Markdown
Collaborator

@zredlined zredlined commented Mar 12, 2026

Summary

  • Adds a hands-on getting-started example (examples/sandbox-policy-quickstart/) that walks users through OpenShell's network policy system: default-deny, L7 read-only access to the GitHub API, and audit logging
  • Includes an automated demo.sh that runs the full walkthrough non-interactively — great for demos and CI smoke tests
  • Links the quickstart from the main README with a "See network policy in action" section right after the install steps

Key fixes in the example

  • Policy YAML includes default static fields (filesystem_policy, landlock, process) — required because openshell policy set replaces the entire policy and the server rejects removal of static fields on a live sandbox
  • demo.sh uses printf instead of echo -e — portable across sh/bash/zsh (the old version printed literal -e on macOS)
  • demo.sh parses the SSH Host from openshell sandbox ssh-config — the generated config uses Host openshell-<name>, not <name> directly

Test plan

  • Ran ./demo.sh end-to-end on macOS against a remote spark cluster — all 7 steps pass
  • Verified openshell policy set works with the updated policy.yaml (no more filesystem policy cannot be removed error)
  • Run on Linux to confirm portability

Made with Cursor

@zredlined zredlined self-assigned this Mar 12, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 12, 2026

All contributors have signed the DCO ✍️ ✅
Posted by the DCO Assistant Lite bot.

@zredlined
Copy link
Copy Markdown
Collaborator Author

I have read the DCO document and I hereby sign the DCO.

Add an interactive getting-started example that demonstrates OpenShell's
network policy system end-to-end: default-deny, L7 read-only access,
and audit logging — all with a single YAML policy file.

- examples/sandbox-policy-quickstart/policy.yaml: policy with default
  static fields (filesystem, landlock, process) so it works out of the
  box with `openshell policy set`
- examples/sandbox-policy-quickstart/demo.sh: automated demo script
  using printf (portable) and openshell ssh-proxy for sandbox exec
- examples/sandbox-policy-quickstart/README.md: step-by-step manual
  walkthrough
- README.md: add "See network policy in action" section linking to the
  quickstart

Signed-off-by: Alexander Watson <zredlined@gmail.com>
Made-with: Cursor
Signed-off-by: Alexander Watson <zredlined@gmail.com>
Made-with: Cursor
@zredlined zredlined force-pushed the aw/getting-started-examples branch from f2b888a to fccdd84 Compare March 12, 2026 22:25
Comment thread README.md Outdated
Sandbox defaults vary by type and community configs, so
"all outbound traffic is blocked" is too absolute.

Made-with: Cursor
curl -s suppresses stderr, hiding the 403 from the CONNECT
proxy. Adding -S ensures the error message is always shown.

Made-with: Cursor
@zredlined zredlined merged commit a359f1d into main Mar 13, 2026
9 checks passed
@zredlined zredlined deleted the aw/getting-started-examples branch March 13, 2026 18:32
drew pushed a commit that referenced this pull request Mar 16, 2026
* docs(examples): add sandbox policy quickstart walkthrough

Add an interactive getting-started example that demonstrates OpenShell's
network policy system end-to-end: default-deny, L7 read-only access,
and audit logging — all with a single YAML policy file.

- examples/sandbox-policy-quickstart/policy.yaml: policy with default
  static fields (filesystem, landlock, process) so it works out of the
  box with `openshell policy set`
- examples/sandbox-policy-quickstart/demo.sh: automated demo script
  using printf (portable) and openshell ssh-proxy for sandbox exec
- examples/sandbox-policy-quickstart/README.md: step-by-step manual
  walkthrough
- README.md: add "See network policy in action" section linking to the
  quickstart

Signed-off-by: Alexander Watson <zredlined@gmail.com>
Made-with: Cursor
Signed-off-by: Alexander Watson <zredlined@gmail.com>
Made-with: Cursor

* docs: soften default-deny wording to minimal outbound access

Sandbox defaults vary by type and community configs, so
"all outbound traffic is blocked" is too absolute.

Made-with: Cursor

* docs: use curl -sS so L4 deny errors are visible

curl -s suppresses stderr, hiding the 403 from the CONNECT
proxy. Adding -S ensures the error message is always shown.

Made-with: Cursor

---------

Signed-off-by: Alexander Watson <zredlined@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants