feat(sandbox): block container namespace joins by default

This commit is contained in:
Peter Steinberger
2026-02-24 23:19:48 +00:00
parent ccbeb332e0
commit 14b6eea6e3
17 changed files with 253 additions and 18 deletions

View File

@@ -53,6 +53,37 @@ describe("sandbox docker config", () => {
expect(res.ok).toBe(false);
});
it("rejects container namespace join by default", () => {
const res = validateConfigObject({
agents: {
defaults: {
sandbox: {
docker: {
network: "container:peer",
},
},
},
},
});
expect(res.ok).toBe(false);
});
it("allows container namespace join with explicit dangerous override", () => {
const res = validateConfigObject({
agents: {
defaults: {
sandbox: {
docker: {
network: "container:peer",
dangerouslyAllowContainerNamespaceJoin: true,
},
},
},
},
});
expect(res.ok).toBe(true);
});
it("rejects seccomp unconfined via Zod schema validation", () => {
const res = validateConfigObject({
agents: {
@@ -219,4 +250,37 @@ describe("sandbox browser binds config", () => {
});
expect(res.ok).toBe(false);
});
it("rejects container namespace join in sandbox.browser config by default", () => {
const res = validateConfigObject({
agents: {
defaults: {
sandbox: {
browser: {
network: "container:peer",
},
},
},
},
});
expect(res.ok).toBe(false);
});
it("allows container namespace join in sandbox.browser config with explicit dangerous override", () => {
const res = validateConfigObject({
agents: {
defaults: {
sandbox: {
docker: {
dangerouslyAllowContainerNamespaceJoin: true,
},
browser: {
network: "container:peer",
},
},
},
},
});
expect(res.ok).toBe(true);
});
});