Skip to content

Commit c38fa28

Browse files
committed
fix(policy): grant managed CA bundle read access
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
1 parent c2a7292 commit c38fa28

7 files changed

Lines changed: 41 additions & 0 deletions

File tree

agents/hermes/policy-additions.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ filesystem_policy:
2121
- /proc
2222
- /dev/urandom
2323
- /app
24+
- /run/nemoclaw/managed-startup-ca-bundle.pem
2425
- /etc
2526
- /var/log
2627
- /var/lib/dpkg # Allow package-version inspection without package mutation.

agents/hermes/policy-permissive.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ filesystem_policy:
2222
- /proc
2323
- /dev/urandom
2424
- /app
25+
- /run/nemoclaw/managed-startup-ca-bundle.pem
2526
- /etc
2627
- /var/log
2728
- /var/lib/dpkg # Allow package-version inspection without package mutation.

agents/langchain-deepagents-code/policy-additions.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ filesystem_policy:
1818
- /proc
1919
- /dev/urandom
2020
- /app
21+
- /run/nemoclaw/managed-startup-ca-bundle.pem
2122
- /etc
2223
- /var/log
2324
- /var/lib/dpkg # Allow package-version inspection without package mutation.

agents/openclaw/policy-permissive.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ filesystem_policy:
1818
- /proc
1919
- /dev/urandom
2020
- /app
21+
- /run/nemoclaw/managed-startup-ca-bundle.pem
2122
- /etc
2223
- /var/log
2324
- /var/lib/dpkg # Allow package-version inspection without package mutation.

nemoclaw-blueprint/policies/openclaw-sandbox-permissive.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ filesystem_policy:
2323
- /proc
2424
- /dev/urandom
2525
- /app
26+
- /run/nemoclaw/managed-startup-ca-bundle.pem
2627
- /etc
2728
- /var/log
2829
- /var/lib/dpkg # Allow package-version inspection without package mutation.

nemoclaw-blueprint/policies/openclaw-sandbox.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ filesystem_policy:
2626
- /proc
2727
- /dev/urandom
2828
- /app
29+
- /run/nemoclaw/managed-startup-ca-bundle.pem
2930
- /etc
3031
- /var/log
3132
- /var/lib/dpkg # Allow package-version inspection without package mutation.

src/lib/onboard/initial-policy-real-policy.test.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import path from "node:path";
77
import { afterEach, describe, expect, it } from "vitest";
88
import YAML from "yaml";
99

10+
import { SHIPPED_MANAGED_IMAGE_AGENTS } from "./managed-image/contract";
11+
import { MANAGED_STARTUP_MERGED_CA_FILE } from "./managed-startup/image-runtime";
1012
import { prepareInitialSandboxCreatePolicy } from "./initial-policy";
1113

1214
type PolicyRule = {
@@ -70,6 +72,39 @@ describe("initial sandbox policy real preset merge", () => {
7072
{ path: ["agents", "hermes", "policy-permissive.yaml"], agent: "hermes" },
7173
] as const;
7274

75+
const managedStartupCaPolicyCases = [
76+
...shippingPolicyCases,
77+
{
78+
path: ["agents", "langchain-deepagents-code", "policy-additions.yaml"],
79+
agent: "langchain-deepagents-code",
80+
},
81+
] as const;
82+
83+
it("covers every shipped managed-image agent in the managed startup CA policy cases", () => {
84+
expect(new Set(managedStartupCaPolicyCases.map(({ agent }) => agent))).toEqual(
85+
new Set(SHIPPED_MANAGED_IMAGE_AGENTS),
86+
);
87+
});
88+
89+
it.each(managedStartupCaPolicyCases)(
90+
"grants $agent policy $path exact read-only access to the managed startup CA bundle (#9360)",
91+
(policyCase) => {
92+
const prepared = prepareInitialSandboxCreatePolicy(repoPath(...policyCase.path), [], {
93+
agentName: policyCase.agent,
94+
});
95+
const policy = readPreparedPolicy(prepared);
96+
const readOnly = policy.filesystem_policy?.read_only ?? [];
97+
const readWrite = policy.filesystem_policy?.read_write ?? [];
98+
99+
expect(readOnly, policyCase.path.join("/")).toContain(MANAGED_STARTUP_MERGED_CA_FILE);
100+
expect(readWrite, policyCase.path.join("/")).not.toContain(MANAGED_STARTUP_MERGED_CA_FILE);
101+
expect(readOnly, policyCase.path.join("/")).not.toContain("/run");
102+
expect(readWrite, policyCase.path.join("/")).not.toContain("/run");
103+
expect(readOnly, policyCase.path.join("/")).not.toContain("/run/nemoclaw");
104+
expect(readWrite, policyCase.path.join("/")).not.toContain("/run/nemoclaw");
105+
},
106+
);
107+
73108
it.each([
74109
{
75110
path: ["nemoclaw-blueprint", "policies", "openclaw-sandbox.yaml"],

0 commit comments

Comments
 (0)