Skip to content

docs: add a guide to run OpenShell sandboxes with Kata runtime - #9

Open
rh-dnagornuks wants to merge 1 commit into
opendatahub-io:mainfrom
rh-dnagornuks:openshell-osc-doc
Open

docs: add a guide to run OpenShell sandboxes with Kata runtime#9
rh-dnagornuks wants to merge 1 commit into
opendatahub-io:mainfrom
rh-dnagornuks:openshell-osc-doc

Conversation

@rh-dnagornuks

@rh-dnagornuks rh-dnagornuks commented Jul 31, 2026

Copy link
Copy Markdown

Description

This PR adds a guide for running OpenShell sandboxes with Kata runtime. It builds on top of parts from guides/getting-started-openshell-openshift.md and links prerequisite material for installing OpenShift Sandboxed Containers operator (which provides Kata, a runtime that runs sandboxes as virtual machines rather than as containers). The guide also covers the egress policy enforcement and OpenShell topology modes.

This PR also adds DaemonSet manifests to patch bare-metal cluster nodes to include kernel modules needed for either topology mode (combined/sidecar), with reference to the manifest for sidecar enablement within the guide markdown.

Relevant Jira issue: RHAIENG-6386

Testing

  • The user follows the instructions (including team-specific ones here) and has the intended results

Merge criteria

  • The guide successfully passes manual e2e testing
  • The documentation has been reviewed by a technical writer and their feedback has been addressed

Summary by CodeRabbit

  • Documentation

    • Added an experimental guide for running OpenShell sandboxes with the Kata runtime on OpenShift.
    • Documented runtime selection, sidecar networking, VM isolation verification, network policy testing, security boundaries, troubleshooting, and cleanup.
    • Added the guide to the documentation index.
  • New Features

    • Added optional tools to enable required networking support in Kata sandbox environments.
    • Included validation, backups, and safeguards for missing or already-updated systems.

@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign rhuss for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added an OpenShift guide for running OpenShell sandboxes with the Kata runtime. The guide covers gateway configuration, runtime selection, VM isolation verification, binary-aware network policy checks, security boundaries, limitations, troubleshooting, and cleanup. The README links to the guide. Two privileged DaemonSets patch Kata initramfs images with nf_tables and veth kernel modules. They validate modules, preserve backups, regenerate dependencies, and repack the images.

Estimated code review effort: 4 (Complex) | ~45 minutes

🚥 Pre-merge checks | ✅ 9 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
No Privileged Containers ⚠️ Warning Both production-applied DaemonSets set hostPID:true and run regular containers with privileged:true and runAsUser:0. This is excessive privilege (CWE-250). Remove hostPID and the long-lived privileged containers. If host patching is required, use a documented short-lived init container with a tightly scoped SCC, then revoke the SCC.
✅ Passed checks (9 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Contribution Quality And Spam Detection ✅ Passed The PR is a repository-specific 579-line guide and two operational manifests, with Jira context, upstream links, security limitations, and no generic CVE/CWE or scanner markers; two qualifying cate...
No Hardcoded Secrets ✅ Passed No API keys, passwords, tokens, private keys, credential URLs, or secret assignments were found; the only long encoded-looking YAML value is an image SHA-256 digest, not a secret (CWE-798).
No Weak Cryptography ✅ Passed No banned primitives, custom cryptography, or secret comparisons appear in the added files; SHA-256 is used only as a container image digest. CWE-327 is not triggered.
No Injection Vectors ✅ Passed No CWE-78/89/94/502/79 sink is present; bash scripts use hardcoded module paths and host uname metadata, while guide-derived NODE_NAME is quoted.
No Sensitive Data In Logs ✅ Passed No sensitive-data logging found: runtime echoes expose only fixed status text, kernel/module names, and host file paths; scans found no credentials, PII, bearer tokens, or raw bodies.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: adding documentation for running OpenShell sandboxes with the Kata runtime.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@guides/openshell-with-osc.md`:
- Line 17: Update both ADDITIONAL RESOURCES headings in the documentation to use
level-three Markdown headings with the exact text “Additional resources,”
replacing the current level-five bold headings.
- Line 136: Update the prose in the step description to use the official product
name “GitHub,” while preserving the lowercase `github.com` hostname in the
command or URL.
- Around line 122-124: Update the network probes in the guide: add both connect
and total-operation timeouts to the curl checks, and pass a timeout argument to
the python3 probe’s urllib.request.urlopen call. Apply these changes to the
probes at the referenced locations while preserving their existing
connectivity-check behavior.
- Around line 211-217: Update the cleanup instructions near the Helm uninstall
commands to remove only the Kubernetes manifest cleanup identified as cwe-686,
replacing “oc delete ns openshell” with explicit deletion of the demo resources
created by this guide. Add a warning that namespace deletion is appropriate only
on a disposable cluster, and retain cleanup of the gateway configuration and SCC
access.
- Around line 41-46: Update both documented Helm upgrade commands around the
visible supervisor.topology and server.defaultRuntimeClassName settings to pin
the tested OpenShell chart using an explicit version or immutable OCI digest
instead of the unversioned chart reference, and record the corresponding tested
OpenShell version in the procedure.
- Around line 41-46: Update both Helm upgrade commands in the guide to
explicitly target the openshell namespace by adding the --namespace openshell
option, including the commands near the supervisor topology configuration and
the later upgrade command. Leave the remaining upgrade options unchanged.
- Around line 120-132: Update the external-endpoint verification section after
the curl command to require checking openshell logs for a DENIED audit event
matching github.com:443 and the calling binary, using the kata-demo sandbox log
command, before claiming OpenShell enforced the policy; otherwise describe the
403 only as an observed failure without attributing its cause.
- Around line 162-172: Update the “Security model” section and table to document
that enabling supervisor.sidecar.processBinaryAwareNetworkPolicy runs the
network sidecar as UID 0 with SYS_PTRACE and DAC_READ_SEARCH for cross-UID
inspection. Also state the security trade-off that disabling
processBinaryAwareNetworkPolicy removes these privileged requirements but
disables binary-aware matching, alongside the existing restricted
agent-container description.
- Around line 99-112: Update the kernel inspection guidance to state that
differing host and sandbox uname -r values indicate a guest kernel, but matching
releases are inconclusive and must not prove a VM boundary. Preserve the runtime
class check and direct readers to provider-supported Kata isolation verification
before asserting VM-based isolation.
- Around line 52-58: Update the gateway readiness instructions around the `oc
get pods -n openshell` step to have users wait for the pod’s `Ready` condition,
not merely phase `Running`, before executing `openshell sandbox create`. Include
an appropriate readiness check and retain the sequencing requirement that
sandboxes are created only after the gateway is ready.
- Around line 13-20: Update the prerequisites in the OpenShell with OSC guide to
distinguish the nested `kata` and `kata-remote` paths: retain the existing
`RuntimeClass` requirement for nested Kata, and require operator-verified
provider Secret, `peer-pods-cm`, `KataConfig`, and completed peer-pod VM image
readiness before sandbox creation when using peer pods.
- Around line 32-34: Update the KATA_RUNTIMECLASS guidance to state that
bare-metal deployments use kata, without attributing this to nested
virtualization. Keep kata-remote for peer pod deployments, including ROSA.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: ddf9f120-952b-4987-8638-867423ac8eea

📥 Commits

Reviewing files that changed from the base of the PR and between b375431 and 1472fb8.

📒 Files selected for processing (2)
  • README.md
  • guides/openshell-with-osc.md

Comment thread guides/openshell-with-osc.md Outdated
Comment thread guides/openshell-with-osc.md
Comment thread guides/openshell-with-osc.md
Comment thread guides/openshell-with-osc.md
Comment thread guides/openshell-with-osc.md Outdated
Comment thread guides/openshell-with-osc.md Outdated
Comment thread guides/openshell-with-osc.md
Comment thread guides/openshell-with-osc.md Outdated
Comment thread guides/openshell-with-osc.md
Comment thread guides/openshell-with-osc.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
guides/openshell-with-osc.md (1)

43-43: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Extract the pinned chart version into a single reusable value.

--version 0.0.85 is repeated in two helm upgrade invocations (Line 43 and Line 208). If the tested chart version changes, both occurrences must be updated in lockstep or the guide silently regresses to an untested Helm chart version in one of the two flows.

Also applies to: 208-208

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@guides/openshell-with-osc.md` at line 43, Define the pinned Helm chart
version once in a reusable value and reference it from both helm upgrade
invocations at the documented locations, removing the duplicated literal while
preserving the current version and command behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@guides/openshell-with-osc.md`:
- Line 43: Define the pinned Helm chart version once in a reusable value and
reference it from both helm upgrade invocations at the documented locations,
removing the duplicated literal while preserving the current version and command
behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 82171571-748d-4366-a93d-71085240c097

📥 Commits

Reviewing files that changed from the base of the PR and between 1472fb8 and 10fcc0d.

📒 Files selected for processing (2)
  • README.md
  • guides/openshell-with-osc.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/kata-nftables-patch-job.yaml`:
- Line 146: Preserve the first pre-patch initramfs backup across both patch
jobs: in scripts/kata-nftables-patch-job.yaml lines 146-146, create
${INITRD}.bak only when it does not already exist; in
scripts/kata-veth-patch-job.yaml lines 103-103, likewise avoid overwriting an
existing backup. Keep the existing patch flow unchanged after the backup step.
- Around line 31-39: Add a dedicated ServiceAccount and grant it privileged SCC
access before applying both DaemonSets:
scripts/kata-nftables-patch-job.yaml:31-39 and
scripts/kata-veth-patch-job.yaml:31-39. Set each DaemonSet’s
spec.serviceAccountName to that account, or use a narrowly scoped custom SCC and
document the policy update; preserve the existing privileged container, hostPID,
and hostPath requirements.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: cd058e62-7364-4c0e-b64f-e49b9724550d

📥 Commits

Reviewing files that changed from the base of the PR and between 57108cb and 0b3083a.

📒 Files selected for processing (4)
  • README.md
  • guides/openshell-with-osc.md
  • scripts/kata-nftables-patch-job.yaml
  • scripts/kata-veth-patch-job.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md

Comment thread scripts/kata-nftables-patch-job.yaml
Comment thread scripts/kata-nftables-patch-job.yaml Outdated
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/kata-nftables-patch-job.yaml`:
- Line 42: Replace the mutable :latest tag with the reviewed immutable UBI image
digest at scripts/kata-nftables-patch-job.yaml:42-42 and
scripts/kata-veth-patch-job.yaml:42-42, using the identical digest in both
privileged patcher job definitions.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: cbb95bd7-ae87-4d51-a571-bc6faefd29f1

📥 Commits

Reviewing files that changed from the base of the PR and between 57108cb and 7b5baa1.

📒 Files selected for processing (4)
  • README.md
  • guides/openshell-with-osc.md
  • scripts/kata-nftables-patch-job.yaml
  • scripts/kata-veth-patch-job.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md

Comment thread scripts/kata-nftables-patch-job.yaml Outdated
@rh-dnagornuks
rh-dnagornuks force-pushed the openshell-osc-doc branch 2 times, most recently from f7da96c to 4d3232e Compare August 6, 2026 09:58
@gracesmith6504

Copy link
Copy Markdown

Tested this on the shared cluster (agent-ops, 4.19.40). Everything works. Nice work. Kata-remote sandbox spins up, egress blocked by default, binary-aware policy works as expected (curl gets through, python doesn't).

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/kata-nftables-patch-job.yaml`:
- Around line 68-72: Update the “Check if already patched” logic in the
initramfs patch job to run after the MODULES list is defined, and skip only when
every module in MODULES is present in INITRD. Remove the single nf_tables-only
check while preserving the existing skip message and successful exit behavior.
- Around line 107-152: The initramfs read-modify-write operations are not
serialized, allowing concurrent patch jobs to overwrite each other. In
scripts/kata-nftables-patch-job.yaml lines 107-152, acquire the shared
host-level lock before the no-op check and hold it through the final mv; apply
the same lock scope to scripts/kata-veth-patch-job.yaml lines 81-108, using the
identical shared lock, so both patch flows protect the complete operation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 9519962a-124d-4c60-84e7-c5d1a2a22387

📥 Commits

Reviewing files that changed from the base of the PR and between 7b5baa1 and 32ec401.

📒 Files selected for processing (3)
  • guides/openshell-with-osc.md
  • scripts/kata-nftables-patch-job.yaml
  • scripts/kata-veth-patch-job.yaml

Comment thread scripts/kata-nftables-patch-job.yaml
Comment thread scripts/kata-nftables-patch-job.yaml
@rh-dnagornuks
rh-dnagornuks force-pushed the openshell-osc-doc branch 2 times, most recently from a2c0bc4 to b7d67b0 Compare August 11, 2026 16:20
Comment thread guides/openshell-with-osc.md Outdated
Perform the following steps:

1. Update the gateway to use Kata.
2. Optional: Patch the Kata initramfs.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The initramfs patch doesn't appear to be optional for users who select kata. The section says that sandbox creation fails without nf_tables and that only kata-remote users can skip the patch. Could we change the step summary to something like “Patch the Kata initramfs if you use the kata runtime class”? That would make the conditional requirement clear before users start the procedure.

Comment thread guides/openshell-with-osc.md Outdated
oc debug node/"${NODE_NAME}" -- chroot /host cat /sys/class/dmi/id/sys_vendor /sys/class/dmi/id/product_name
```

On bare-metal clusters, the host reports the physical hardware vendor (for example, `Equinix` or `Dell Inc.`), while the sandbox reports `QEMU`. On peer pod deployments, both the host and the sandbox may report cloud provider values, but the sandbox product name reflects the peer pod instance type from the `peer-pods-cm` ConfigMap.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bare-metal DMI examples seem inconsistent. The example output shows Red Hat / KVM, but the explanatory text later says that the sandbox reports QEMU. Could we reconcile these examples, or avoid prescribing an exact DMI value? Since these checks are supplementary diagnostics, it might be safer to say that the values should reflect the guest/hypervisor environment and differ from the physical host where applicable.

Comment thread guides/openshell-with-osc.md Outdated
>
> Treat the OpenShift installation path as experimental. Do not use it in production.

This guide builds on [Getting Started with OpenShell on OpenShift](getting-started-openshell-openshift.md). It configures new sandboxes to use a Kata-backed `RuntimeClass`, sets OpenShell to use `sidecar` topology, and shows how to verify the virtual machine (VM) boundary and OpenShell policy enforcement. By the end of this guide, you can run a Kata-backed sandbox and verify how this topology applies runtime and network controls.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"sets" could be changed to "configures"

Comment thread guides/openshell-with-osc.md Outdated
>
> Treat the OpenShift installation path as experimental. Do not use it in production.

This guide builds on [Getting Started with OpenShell on OpenShift](getting-started-openshell-openshift.md). It configures new sandboxes to use a Kata-backed `RuntimeClass`, sets OpenShell to use `sidecar` topology, and shows how to verify the virtual machine (VM) boundary and OpenShell policy enforcement. By the end of this guide, you can run a Kata-backed sandbox and verify how this topology applies runtime and network controls.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd change to:

Configure the gateway to use the sidecar topology and binary-aware network policy.

Comment thread guides/openshell-with-osc.md Outdated
KATA_RUNTIMECLASS=<runtime-class-name>
```

2. Update OpenShell Helm chart to set the runtime class, sidecar topology, and binary-aware network policy:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the OpenShell Helm chart...

Comment thread guides/openshell-with-osc.md Outdated
## Prerequisites

- You have completed [Getting Started with OpenShell on OpenShift](getting-started-openshell-openshift.md) through **Status Check**.
- You have installed the OpenShift Sandboxed Containers operator on the cluster.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Red Hat uses OpenShift sandboxed containers Operator:

lowercase sandboxed containers, uppercase Operator.

Comment thread guides/openshell-with-osc.md Outdated

### Procedure

1. Grant the `kata-install` service account privileged access. The patch DaemonSet runs privileged containers with host filesystem access. On bare-metal clusters, the operator does not create the required SCC automatically:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kubernetes Operators have an uppercase "O" when referred to in prose.

Comment thread guides/openshell-with-osc.md Outdated
- **The sandbox pod does not use Kata.** Confirm that the runtime class name in `server.defaultRuntimeClassName` or `runtime_class_name` exactly matches one of the values returned by `oc get runtimeclass`, and then recreate the sandbox.
- **`python3` is allowed after the `curl` policy update.** Verify that `supervisor.sidecar.processBinaryAwareNetworkPolicy=true`. Setting it to `false` downgrades `sidecar` network policy to endpoint and L7 matching only.
- **The gateway pod does not recover after the Helm upgrade.** Check `oc get pods -n openshell` and confirm that the Helm values still include the Route hostname, `sidecar` topology, and the expected runtime class setting.
- **No Kata runtime class is available.** Wait for the OpenShift Sandboxed Containers rollout to finish, or verify that the operator and `KataConfig` are installed correctly.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here. Uppercase "O" in Operator.

Comment thread guides/openshell-with-osc.md Outdated
4. Optional: Verify the VM isolation boundary.
5. Verify policy enforcement in the Kata-backed sandbox.

Unless noted otherwise, run commands on your local machine.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence could be made less awkward:

Run all commands on your local machine unless otherwise specified.

Comment thread guides/openshell-with-osc.md Outdated

## Prerequisites

- You have completed [Getting Started with OpenShell on OpenShift](getting-started-openshell-openshift.md) through **Status Check**.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d use:

You have completed the steps through and including the Status Check section in Getting Started with OpenShell on OpenShift.

If Status Check is the final required section, an even cleaner option is:

You have completed the Getting Started with OpenShell on OpenShift guide through the Status Check section.

Comment thread guides/openshell-with-osc.md Outdated

> **Important**
>
> This patch does not survive node reboots. The `kata-osbuilder-generate` service regenerates the initramfs from the unpatched dracut configuration on boot. Go through the procedure again after any worker node reboot or `KataConfig` change that triggers a node rollout.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the consequence and required action more direct

Important

The patch is removed when a worker node reboots because the kata-osbuilder-generate service regenerates the initramfs from the unpatched dracut configuration. Reapply the patch after a worker node reboot or after a KataConfig change that causes the worker nodes to roll out.

Comment thread guides/openshell-with-osc.md Outdated

## 3. Create a Kata-backed sandbox

Create a sandbox after the gateway upgrade.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current text is too thin because it does not connect the task back to the runtime-class choice made earlier. Enhance:

  1. Create a Kata-backed sandbox

Create a sandbox that uses the Kata runtime class that you configured earlier. You can use the gateway-wide default runtime class or specify the runtime class when you create the sandbox.

Comment thread guides/openshell-with-osc.md Outdated

### Procedure

Run the command sequence that matches your setup:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"your setup" is unclear. This could be made more consise:

Run the command that matches how you configured the runtime class.

Comment thread guides/openshell-with-osc.md Outdated

Run the command sequence that matches your setup:

If you configured a gateway-wide default runtime class, run:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use full and complete sentences when introducing commands:

If you configured a gateway-wide default runtime class, create the sandbox by running the following command:

Comment thread guides/openshell-with-osc.md Outdated
openshell sandbox create --name kata-demo -- sleep 1
```

If you want to override the runtime class for this sandbox only, run:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here. Use full and complete sentences when introducing commands:

If you want to override the gateway default and specify the runtime class for this sandbox only, run the following command:

The per-sandbox `runtime_class_name` value overrides the gateway default for this sandbox.

### Verification

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Verification section only seems to have one step. If so, the step number can be removed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rh-dnagornuks that's a fair point.

They could probably remove that step there too.

Comment thread guides/openshell-with-osc.md Outdated

### Verification

1. Verify that Kubernetes assigned the Kata runtime class:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the expected result more explicit and tie it directly to the verification goal:

Verify that the sandbox pod is configured to use the expected Kata runtime class by running the following command:

The command returns the runtime class assigned to the sandbox pod. Verify that the output is kata for deployments that use nested virtualization or kata-remote for deployments that use peer pods.

Comment thread guides/openshell-with-osc.md Outdated

## 4. Verify the VM isolation boundary

The RuntimeClass check in section 3 is the authoritative verification. When a pod runs with `runtimeClassName: kata` or `kata-remote`, the CRI-O Kata handler (`runtime_type = "vm"`) guarantees that the workload runs inside a dedicated virtual machine.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's soften this slightly and also make the relationship between the two checks clearer:

Verify the VM isolation boundary

The runtime class verification in section 3 confirms that the sandbox pod is configured to use the kata or kata-remote runtime. OpenShift Sandboxed Containers uses the Kata runtime to run the workload in a dedicated virtual machine (VM).

You can perform the following DMI checks to gather additional information about the VM environment and confirm that it uses the expected hypervisor. These checks provide supplementary diagnostic information and are not required to verify that the sandbox is configured to use Kata.

Comment thread guides/openshell-with-osc.md Outdated

The DMI checks below are supplementary diagnostic evidence. They can help confirm that the VM is backed by the expected hypervisor, but they do not independently prove or disprove Kata isolation.

1. Check the system vendor and product name inside the sandbox:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this more concise emphasizing the purpose of the step:

Verify that the sandbox is running in the expected virtual machine environment by checking the system vendor and product name:

Comment thread guides/openshell-with-osc.md Outdated
KVM
```

2. Compare with the host node:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enhance this step to make both the action and what the reader should compare more explicit:

Compare the sandbox VM information with the host node by running the following commands:

Compare the host output with the values returned from the sandbox in the previous step. On bare-metal clusters, the host typically reports the physical hardware vendor, such as Dell Inc., while the sandbox reports values associated with the virtualized guest environment.

On peer pod deployments, both environments might report cloud-provider information, but the sandbox product name should reflect the peer pod instance type configured in the peer-pods-cm ConfigMap.

Comment thread guides/openshell-with-osc.md Outdated

### Confirm that network egress is blocked by default

1. Connect to the sandbox:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

State the sandbox name that you are referring to.

Connect to the kata-demo sandbox by running the following command:

Comment thread guides/openshell-with-osc.md Outdated
openshell sandbox connect kata-demo
```

2. Attempt to reach an external endpoint from the sandbox shell:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some context here:

From the sandbox shell, verify that outbound network access is blocked by attempting to connect to GitHub:

Comment thread guides/openshell-with-osc.md Outdated

This result shows that sandbox egress still flows through the OpenShell network policy path. Running the pod behind Kata does not bypass policy enforcement.

### Allow one binary and keep the rest blocked

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the overall goal clearer here:

Allow network access for one binary

Comment thread guides/openshell-with-osc.md Outdated

### Allow one binary and keep the rest blocked

1. From your local machine, allow only `/usr/bin/curl` to reach GitHub:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the purpose of the step clearer:

From your local machine, update the sandbox policy to allow only /usr/bin/curl to connect to GitHub:

Comment thread guides/openshell-with-osc.md Outdated
--wait
```

2. From inside the sandbox shell, test again:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use complete sentences for commands. Be clear about the purpose of the step:

From the sandbox shell, verify that the policy allows curl but continues to block other binaries by running the following commands:

Comment thread guides/openshell-with-osc.md Outdated

`curl` should succeed, while `python3` should still fail with a tunnel connection failure. This result confirms that the sidecar still matches on binary identity, not only on destination.

3. To watch the corresponding audit events, open the OpenShell terminal from your local machine:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make more concise:

From your local machine, open the OpenShell terminal to view the corresponding network audit events:

Comment thread guides/openshell-with-osc.md Outdated
openshell term
```

4. Select `kata-demo` and switch to the live log view with the `l` key. You should see `DENIED` and `ALLOWED` network events for the same destination, depending on which binary made the request.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using the word "should" when possible:

Select kata-demo, and then press l to open the live log view. Verify that the log shows ALLOWED events for requests from /usr/bin/curl and DENIED events for requests from python3 to the same destination.

## Security model

OpenShell `sidecar` topology and a Kata `RuntimeClass` apply controls at different layers. OpenShell focuses on workload egress policy. Kata runs the pod inside a guest virtual machine.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenShell enforces network policy for sandbox workloads, while Kata provides an additional isolation boundary by running the pod inside a guest virtual machine (VM).

Comment thread guides/openshell-with-osc.md Outdated

OpenShell `sidecar` topology and a Kata `RuntimeClass` apply controls at different layers. OpenShell focuses on workload egress policy. Kata runs the pod inside a guest virtual machine.

`combined` topology also enforces OpenShell network policy, but `sidecar` moves that enforcement into a dedicated sidecar so the long-running agent container can run without added Linux capabilities.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The combined topology ...

Comment thread guides/openshell-with-osc.md Outdated

- In `sidecar` topology, OpenShell does not run the full enforcement path. The process supervisor runs in `network-only` mode. OpenShell still enforces network policy through the sidecar, and Landlock filesystem policy plus child seccomp filters still apply where supported. However, root-to-sandbox privilege dropping and supervisor identity mount isolation do not run in the agent container.
- `gVisor` is not supported with `sidecar` topology because sidecar mode requires pod-local `nftables` setup in the init container.
- Kata adds a guest virtual machine boundary, but it does not restore the controls that `sidecar` mode relaxes compared with `combined` topology.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using the word "relaxes":

Kata adds a guest virtual machine boundary, but it does not replace the additional controls provided by combined topology.

Comment thread guides/openshell-with-osc.md Outdated

## Cleanup

Delete the demo sandboxes when you finish:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the cleanup section, numbered steps have not been used. Previously, numbered steps were used. Make consistent.

- **The gateway pod does not recover after the Helm upgrade.** Check `oc get pods -n openshell` and confirm that the Helm values still include the Route hostname, `sidecar` topology, and the expected runtime class setting.
- **No Kata runtime class is available.** Wait for the OpenShift Sandboxed Containers rollout to finish, or verify that the operator and `KataConfig` are installed correctly.

## Cleanup

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the cleanup paths explicit, because there are really two different goals here: remove only the test sandbox, or completely remove OpenShell.

Comment thread guides/openshell-with-osc.md Outdated

## Cleanup

Delete the demo sandboxes when you finish:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For completeness, state what demo sandboxes you are referring to:

To remove the kata-demo sandbox, run the following command:

Comment thread guides/openshell-with-osc.md Outdated
openshell sandbox delete kata-demo
```

Revert the gateway to the earlier getting-started configuration:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to keep OpenShell installed but return the gateway to the configuration used in the getting-started guide, run the following command:

Comment thread guides/openshell-with-osc.md Outdated
--set server.defaultRuntimeClassName=""
```

To remove the gateway and all other OpenShell resources, run:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you no longer need the OpenShell installation, remove the gateway and associated resources by running the following commands:

@chtyler chtyler left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments added on prose, style and document structure.

Add a markdown file with instructions on running OpenShell sandboxes with Kata and a section explaining the security model

Add manifests to enable Kata usage for OpenShell on bare-metal/nested virtualization

Signed-off-by: Daniels Nagornuks <dnagornu@redhat.com>
@rh-dnagornuks

Copy link
Copy Markdown
Author

@chtyler Thank you for the review. I updated the guide with your feedback. I also responded to the comment on initramfs in the overview of steps. Let me know if I something needs changing or if it's good to merge.

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