Skip to content

test(sandbox): prove the none box's seal on a packet socket, not an inet one - #3268

Merged
bryan-minimal merged 1 commit into
mainfrom
test/1148-cap-net-raw-families
Nov 11, 2026
Merged

bryan-minimal merged 1 commit into
mainfrom
test/1148-cap-net-raw-families

Conversation

@bryan-minimal

Copy link
Copy Markdown
Member

Fixes gominimal/inbox#1148.

What

boxes_lack_cap_net_raw (crates/sandbox/tests/caps_root_integration.rs) expected a none box's socket(AF_INET, SOCK_RAW) to fail with EAFNOSUPPORT, the seal's refusal. That was the none seal of T8 (#1692), unix only. T64 (#1780) admitted the inet families to it so a none box can use its own loopback, and since then the kernel's CAP_NET_RAW check answers first: EPERM, exactly as in an open box. The test never ran where it would have said so (the hosted runner restricts unprivileged user namespaces, and the test self-skips there) and fails on every host where it does run.

The probe now also opens socket(AF_PACKET, SOCK_RAW, 0):

box inet raw packet why
open (confined-families seal) EPERM EPERM both families admitted; the missing capability refuses
none (full seal) EPERM EAFNOSUPPORT inet admitted for loopback; the packet family refused by the seal before the capability check

The none box's packet answer is the fact the test exists for: seal and credentials hold together in the one launch closure that applies both. The doc comment on the test says the same.

What this does not do

The tests lane still only exercises this on a runner that allows unprivileged user namespaces, so on GitHub it self-skips as before. Running the sandbox crate's root-integration binary in the minimald-root-integration job (where the sysctl is relaxed) is a separate change to the workflow; the issue's suggestion stands.

Tests

  • The test now passes for real on a host that allows unprivileged user namespaces (kernel 7.3, AppArmor absent), where it failed on main.
  • The workspace suite and the baseline scenario pass.

🤖 Generated with Claude Code

…net one

boxes_lack_cap_net_raw expected a none box's inet raw socket to fail
with EAFNOSUPPORT, the seal's refusal. That was the none seal of T8,
unix only. T64 admitted inet to it so a none box can use its own
loopback, and since then the kernel's capability check answers first:
EPERM, as in an open box. The test never ran where it would have said
so (the hosted runner restricts unprivileged user namespaces and it
self-skips), and fails on every host where it runs
(gominimal/inbox#1148).

The probe now also opens a packet socket. An open box's seal admits the
packet family, so the missing CAP_NET_RAW refuses it with EPERM; a none
box's seal refuses the family itself with EAFNOSUPPORT before the
capability check, which is the seal-and-credentials-in-one-launch fact
the test exists for. The inet raw socket reads EPERM in both.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 1 billable file and costs up to $0.25.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 49 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 4287e822-286e-406a-bd16-3538d57ceca8
Commits

Reviewing files that changed from the base of the PR and between 9bc9cb5 and dfd9008.

Files selected for processing: 1

  • crates/sandbox/tests/caps_root_integration.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@bryan-minimal
bryan-minimal marked this pull request as ready for review November 11, 2026 05:43
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 11, 2026 05:43
@minimal-foundry

minimal-foundry Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Approved: no findings at dfd90089856e.

Nothing to do.

Clobber: none.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

minimal-review — approved

Verdict APPROVE — No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 11, 2026
@bryan-minimal
bryan-minimal added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit e6d6fbd Nov 11, 2026
38 checks passed
@bryan-minimal
bryan-minimal deleted the test/1148-cap-net-raw-families branch November 11, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants