Skip to content

fix(security): add iptables to Dockerfile for network policy enforcement - #843

Merged
cv merged 3 commits into
mainfrom
fix/add-iptables-to-dockerfile-v2
Mar 25, 2026
Merged

fix(security): add iptables to Dockerfile for network policy enforcement#843
cv merged 3 commits into
mainfrom
fix/add-iptables-to-dockerfile-v2

Conversation

@ericksoa

@ericksoa ericksoa commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add pinned iptables=1.8.9-2 to the Dockerfile apt-get install block
  • Add regression test (test 10) to e2e-gateway-isolation.sh verifying iptables is present

Without iptables, OpenShell logs iptables not found; bypass detection rules will not be installed and all sandbox network policies report Active: 0. Every outbound connection succeeds regardless of the configured policy, rendering openclaw-sandbox.yaml and all presets ineffective.

PR #721 addressed gateway process isolation but did not add the missing iptables package. This PR closes that gap.

Test plan

  • docker build succeeds with the new package
  • docker run --rm --entrypoint "" <image> iptables --version prints iptables v1.8.9
  • bash test/e2e-gateway-isolation.sh — all 11 tests pass (new test 10 verifies iptables)
  • Deploy sandbox and verify openshell policy status shows Active: >0 rules

Summary by CodeRabbit

  • Chores

    • Updated the container runtime to include a pinned iptables package to support network policy enforcement and improve isolation.
  • Tests

    • Gateway isolation tests now verify iptables is installed (root check) and retain a separate sandbox-user permission test that confirms unauthorized process termination is prevented.

…enforcement

Without iptables installed in the sandbox image, OpenShell logs
"iptables not found; bypass detection rules will not be installed"
and reports Active: 0 for all network policies. This means every
outbound connection from the sandbox succeeds regardless of the
configured network policy, rendering the entire policy framework
(openclaw-sandbox.yaml, presets) ineffective.

Add pinned iptables=1.8.9-2 to the apt-get install block alongside
the existing iproute2 package. Add regression test to the gateway
isolation E2E suite verifying iptables is present in the built image.

Fixes NVBug 6014904.
@coderabbitai

coderabbitai Bot commented Mar 25, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Dockerfile now pins and installs iptables=1.8.9-2 in the runtime image. The end-to-end gateway isolation test script changes Test 10 to verify iptables --version as root and adds Test 11 to perform the sandbox user's gateway-kill permission check previously in Test 10.

Changes

Cohort / File(s) Summary
Runtime image and gateway isolation tests
Dockerfile, test/e2e-gateway-isolation.sh
Dockerfile: add pinned iptables=1.8.9-2 to runtime apt installs. Tests: Test 10 now checks iptables --version as root; new Test 11 restores the sandbox user's gateway-kill permission check (previously Test 10).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped into Docker with a keen little pat,
Pinned iptables snug in the image's hat,
Tests now ask "who runs the rules today?"
A sleepy gateway sleeps while sandboxes say nay,
Hooray for packets that safely stay on track! 🎩🐇

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding iptables to the Dockerfile for network policy enforcement, which is the primary purpose of this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/add-iptables-to-dockerfile-v2

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

@cv
cv merged commit 5748a32 into main Mar 25, 2026
7 checks passed
@cv
cv deleted the fix/add-iptables-to-dockerfile-v2 branch March 25, 2026 15:24
temrjan pushed a commit to temrjan/NemoClaw that referenced this pull request Mar 25, 2026
…enforcement (NVIDIA#843)

Without iptables installed in the sandbox image, OpenShell logs
"iptables not found; bypass detection rules will not be installed"
and reports Active: 0 for all network policies. This means every
outbound connection from the sandbox succeeds regardless of the
configured network policy, rendering the entire policy framework
(openclaw-sandbox.yaml, presets) ineffective.

Add pinned iptables=1.8.9-2 to the apt-get install block alongside
the existing iproute2 package. Add regression test to the gateway
isolation E2E suite verifying iptables is present in the built image.

Fixes NVBug 6014904.
vidulpanickan pushed a commit to vidulpanickan/MediClaw that referenced this pull request Mar 25, 2026
…enforcement (NVIDIA#843)

Without iptables installed in the sandbox image, OpenShell logs
"iptables not found; bypass detection rules will not be installed"
and reports Active: 0 for all network policies. This means every
outbound connection from the sandbox succeeds regardless of the
configured network policy, rendering the entire policy framework
(openclaw-sandbox.yaml, presets) ineffective.

Add pinned iptables=1.8.9-2 to the apt-get install block alongside
the existing iproute2 package. Add regression test to the gateway
isolation E2E suite verifying iptables is present in the built image.

Fixes NVBug 6014904.

(cherry picked from commit 5748a32)
Signed-off-by: Vidul Ayakulangara Panickan <apvidul@gmail.com>
lakamsani pushed a commit to lakamsani/NemoClaw that referenced this pull request Apr 4, 2026
…enforcement (NVIDIA#843)

Without iptables installed in the sandbox image, OpenShell logs
"iptables not found; bypass detection rules will not be installed"
and reports Active: 0 for all network policies. This means every
outbound connection from the sandbox succeeds regardless of the
configured network policy, rendering the entire policy framework
(openclaw-sandbox.yaml, presets) ineffective.

Add pinned iptables=1.8.9-2 to the apt-get install block alongside
the existing iproute2 package. Add regression test to the gateway
isolation E2E suite verifying iptables is present in the built image.

Fixes NVBug 6014904.
@wscurran wscurran added the bug-fix PR fixes a bug or regression label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants