@anthropic-ai/sandbox-runtime 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -10
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/sandbox/generate-seccomp-filter.d.ts +21 -29
- package/dist/sandbox/generate-seccomp-filter.d.ts.map +1 -1
- package/dist/sandbox/generate-seccomp-filter.js +36 -325
- package/dist/sandbox/generate-seccomp-filter.js.map +1 -1
- package/dist/sandbox/linux-sandbox-utils.d.ts +22 -21
- package/dist/sandbox/linux-sandbox-utils.d.ts.map +1 -1
- package/dist/sandbox/linux-sandbox-utils.js +102 -82
- package/dist/sandbox/linux-sandbox-utils.js.map +1 -1
- package/dist/sandbox/macos-sandbox-utils.d.ts +1 -0
- package/dist/sandbox/macos-sandbox-utils.d.ts.map +1 -1
- package/dist/sandbox/macos-sandbox-utils.js +80 -3
- package/dist/sandbox/macos-sandbox-utils.js.map +1 -1
- package/dist/sandbox/sandbox-manager.d.ts +1 -1
- package/dist/sandbox/sandbox-manager.d.ts.map +1 -1
- package/dist/sandbox/sandbox-manager.js +3 -1
- package/dist/sandbox/sandbox-manager.js.map +1 -1
- package/dist/sandbox/sandbox-utils.d.ts.map +1 -1
- package/dist/sandbox/sandbox-utils.js +20 -1
- package/dist/sandbox/sandbox-utils.js.map +1 -1
- package/dist/vendor/seccomp/arm64/apply-seccomp +0 -0
- package/dist/vendor/seccomp/x64/apply-seccomp +0 -0
- package/dist/vendor/seccomp-src/apply-seccomp.c +98 -0
- package/package.json +1 -1
- package/vendor/seccomp/arm64/apply-seccomp +0 -0
- package/vendor/seccomp/x64/apply-seccomp +0 -0
- package/vendor/seccomp-src/apply-seccomp.c +98 -0
- package/dist/vendor/seccomp-src/apply-seccomp-and-exec.py +0 -111
- package/vendor/seccomp-src/apply-seccomp-and-exec.py +0 -111
package/README.md
CHANGED
|
@@ -387,11 +387,6 @@ Watchman accesses files outside the sandbox boundaries, which will trigger permi
|
|
|
387
387
|
- Ubuntu/Debian: `apt-get install socat`
|
|
388
388
|
- Fedora: `dnf install socat`
|
|
389
389
|
- Arch: `pacman -S socat`
|
|
390
|
-
- **`python3` - REQUIRED for applying seccomp filters** (typically pre-installed on Linux)
|
|
391
|
-
- Ubuntu/Debian: `apt-get install python3`
|
|
392
|
-
- Fedora: `dnf install python3`
|
|
393
|
-
- Arch: `pacman -S python`
|
|
394
|
-
- **Note:** Python 3 is mandatory for Unix socket blocking security. To disable this security feature, set `allowAllUnixSockets: true` in your configuration.
|
|
395
390
|
- `ripgrep` - Fast search tool for deny path detection
|
|
396
391
|
- Ubuntu/Debian: `apt-get install ripgrep`
|
|
397
392
|
- Fedora: `dnf install ripgrep`
|
|
@@ -499,18 +494,18 @@ On Linux, the sandbox uses **seccomp BPF (Berkeley Packet Filter)** to block Uni
|
|
|
499
494
|
|
|
500
495
|
3. **Syscall filtering**: The BPF filter intercepts the `socket()` syscall and blocks creation of `AF_UNIX` sockets by returning `EPERM`. This prevents sandboxed code from creating new Unix domain sockets.
|
|
501
496
|
|
|
502
|
-
4. **Two-stage application using
|
|
497
|
+
4. **Two-stage application using apply-seccomp binary**:
|
|
503
498
|
- Outer bwrap creates the sandbox with filesystem, network, and PID namespace restrictions
|
|
504
499
|
- Network bridging processes (socat) start inside the sandbox (need Unix sockets)
|
|
505
|
-
-
|
|
506
|
-
-
|
|
500
|
+
- apply-seccomp binary applies the seccomp filter via `prctl()`
|
|
501
|
+
- apply-seccomp execs the user command with seccomp active
|
|
507
502
|
- User command runs with all sandbox restrictions plus Unix socket creation blocking
|
|
508
503
|
|
|
509
504
|
**Security limitations**: The filter only blocks `socket(AF_UNIX, ...)` syscalls. It does not prevent operations on Unix socket file descriptors inherited from parent processes or passed via `SCM_RIGHTS`. For most sandboxing scenarios, blocking socket creation is sufficient to prevent unauthorized IPC.
|
|
510
505
|
|
|
511
|
-
**
|
|
506
|
+
**Zero runtime dependencies**: Pre-built static apply-seccomp binaries and pre-generated BPF filters are included for x64 and arm64 architectures. No compilation tools or external dependencies required at runtime.
|
|
512
507
|
|
|
513
|
-
**
|
|
508
|
+
**Architecture support**: x64 and arm64 are fully supported with pre-built binaries. Other architectures are not currently supported. To use sandboxing without Unix socket blocking on unsupported architectures, set `allowAllUnixSockets: true` in your configuration.
|
|
514
509
|
|
|
515
510
|
### Violation Detection and Monitoring
|
|
516
511
|
|
package/dist/cli.js
CHANGED
|
@@ -71,7 +71,7 @@ async function main() {
|
|
|
71
71
|
program
|
|
72
72
|
.name('srt')
|
|
73
73
|
.description('Run commands in a sandbox with network and filesystem restrictions')
|
|
74
|
-
.version('1.0.0');
|
|
74
|
+
.version(process.env.npm_package_version || '1.0.0');
|
|
75
75
|
// Default command - run command in sandbox
|
|
76
76
|
program
|
|
77
77
|
.argument('<command...>', 'command to run in the sandbox')
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,0BAA0B,EAA6B,MAAM,6BAA6B,CAAA;AACnG,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AAExB;;GAEG;AACH,SAAS,UAAU,CAAC,QAAgB;IAClC,IAAI,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAA;QACb,CAAC;QACD,MAAM,OAAO,GAAG,EAAE,CAAC,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,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACnE,CAAA;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACjB,CAAC;IACH,CAAC,CACF,CAAA;IAEH,OAAO,CAAC,KAAK,EAAE,CAAA;AACjB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAA;IACpC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if Python 3 is available (synchronous)
|
|
3
|
-
* Python 3 is required for applying seccomp filters via the helper script
|
|
4
|
-
* Memoized to avoid repeated system calls
|
|
5
|
-
*/
|
|
6
|
-
export declare const hasPython3Sync: (() => boolean) & import("lodash").MemoizedFunction;
|
|
7
|
-
/**
|
|
8
|
-
* Check if seccomp dependencies are available (synchronous)
|
|
9
|
-
* Returns true if (gcc OR clang) AND libseccomp-dev are installed
|
|
10
|
-
* Memoized to avoid repeated system calls
|
|
11
|
-
*/
|
|
12
|
-
export declare const hasSeccompDependenciesSync: (() => boolean) & import("lodash").MemoizedFunction;
|
|
13
1
|
/**
|
|
14
2
|
* Get the path to a pre-generated BPF filter file from the vendor directory
|
|
15
3
|
* Returns the path if it exists, null otherwise
|
|
@@ -23,8 +11,20 @@ export declare const hasSeccompDependenciesSync: (() => boolean) & import("lodas
|
|
|
23
11
|
*/
|
|
24
12
|
export declare function getPreGeneratedBpfPath(): string | null;
|
|
25
13
|
/**
|
|
26
|
-
*
|
|
27
|
-
* Returns the path
|
|
14
|
+
* Get the path to the apply-seccomp binary from the vendor directory
|
|
15
|
+
* Returns the path if it exists, null otherwise
|
|
16
|
+
*
|
|
17
|
+
* Pre-built apply-seccomp binaries are organized by architecture:
|
|
18
|
+
* - vendor/seccomp/{x64,arm64}/apply-seccomp
|
|
19
|
+
*
|
|
20
|
+
* Tries multiple paths for resilience:
|
|
21
|
+
* 1. ../../vendor/seccomp/{arch}/apply-seccomp (package root - standard npm installs)
|
|
22
|
+
* 2. ../vendor/seccomp/{arch}/apply-seccomp (dist/vendor - for bundlers)
|
|
23
|
+
*/
|
|
24
|
+
export declare function getApplySeccompBinaryPath(): string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Get the path to a pre-generated seccomp BPF filter that blocks Unix domain socket creation
|
|
27
|
+
* Returns the path to the BPF filter file, or null if not available
|
|
28
28
|
*
|
|
29
29
|
* The filter blocks socket(AF_UNIX, ...) syscalls while allowing all other syscalls.
|
|
30
30
|
* This prevents creation of new Unix domain socket file descriptors.
|
|
@@ -40,25 +40,17 @@ export declare function getPreGeneratedBpfPath(): string | null;
|
|
|
40
40
|
* read user-space memory to inspect socket paths).
|
|
41
41
|
*
|
|
42
42
|
* Requirements:
|
|
43
|
-
* - Pre-generated BPF filters included for x64 and ARM64
|
|
44
|
-
* -
|
|
43
|
+
* - Pre-generated BPF filters included for x64 and ARM64 only
|
|
44
|
+
* - Other architectures are not supported
|
|
45
45
|
*
|
|
46
|
-
* @returns Path to the BPF filter file, or null
|
|
46
|
+
* @returns Path to the pre-generated BPF filter file, or null if not available
|
|
47
47
|
*/
|
|
48
48
|
export declare function generateSeccompFilter(): string | null;
|
|
49
49
|
/**
|
|
50
50
|
* Clean up a seccomp filter file
|
|
51
|
-
*
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Get the path to the apply-seccomp-and-exec Python script
|
|
56
|
-
* This script applies a seccomp filter and execs a command, replacing the need
|
|
57
|
-
* for nested bwrap with --seccomp flag.
|
|
58
|
-
*
|
|
59
|
-
* The script is cached in the temp directory to avoid repeated writes.
|
|
60
|
-
*
|
|
61
|
-
* @returns Path to the Python script, or null on failure
|
|
51
|
+
* Since we only use pre-generated BPF files from vendor/, this is a no-op.
|
|
52
|
+
* Pre-generated files are never deleted.
|
|
53
|
+
* Kept for backward compatibility with existing code that calls it.
|
|
62
54
|
*/
|
|
63
|
-
export declare function
|
|
55
|
+
export declare function cleanupSeccompFilter(_filterPath: string): void;
|
|
64
56
|
//# sourceMappingURL=generate-seccomp-filter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-seccomp-filter.d.ts","sourceRoot":"","sources":["../../src/sandbox/generate-seccomp-filter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-seccomp-filter.d.ts","sourceRoot":"","sources":["../../src/sandbox/generate-seccomp-filter.ts"],"names":[],"mappings":"AAiDA;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,GAAG,IAAI,CAqCtD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,GAAG,IAAI,CAoCzD;AAGD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,GAAG,IAAI,CAarD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAE9D"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import { createHash } from 'node:crypto';
|
|
2
|
-
import { tmpdir } from 'node:os';
|
|
3
1
|
import { join, dirname } from 'node:path';
|
|
4
2
|
import { fileURLToPath } from 'node:url';
|
|
5
3
|
import * as fs from 'node:fs';
|
|
6
4
|
import { logForDebugging } from '../utils/debug.js';
|
|
7
|
-
import { spawnSync } from 'node:child_process';
|
|
8
|
-
import { memoize } from 'lodash-es';
|
|
9
5
|
/**
|
|
10
6
|
* Map Node.js process.arch to our vendor directory architecture names
|
|
11
7
|
* Returns null for unsupported architectures
|
|
@@ -43,84 +39,6 @@ function getVendorArchitecture() {
|
|
|
43
39
|
return null;
|
|
44
40
|
}
|
|
45
41
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Check if Python 3 is available (synchronous)
|
|
48
|
-
* Python 3 is required for applying seccomp filters via the helper script
|
|
49
|
-
* Memoized to avoid repeated system calls
|
|
50
|
-
*/
|
|
51
|
-
export const hasPython3Sync = memoize(() => {
|
|
52
|
-
try {
|
|
53
|
-
const result = spawnSync('python3', ['--version'], {
|
|
54
|
-
stdio: 'ignore',
|
|
55
|
-
timeout: 1000,
|
|
56
|
-
});
|
|
57
|
-
return result.status === 0;
|
|
58
|
-
}
|
|
59
|
-
catch {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
/**
|
|
64
|
-
* Check if seccomp dependencies are available (synchronous)
|
|
65
|
-
* Returns true if (gcc OR clang) AND libseccomp-dev are installed
|
|
66
|
-
* Memoized to avoid repeated system calls
|
|
67
|
-
*/
|
|
68
|
-
export const hasSeccompDependenciesSync = memoize(() => {
|
|
69
|
-
try {
|
|
70
|
-
// Check for gcc or clang
|
|
71
|
-
const gccResult = spawnSync('which', ['gcc'], {
|
|
72
|
-
stdio: 'ignore',
|
|
73
|
-
timeout: 1000,
|
|
74
|
-
});
|
|
75
|
-
const clangResult = spawnSync('which', ['clang'], {
|
|
76
|
-
stdio: 'ignore',
|
|
77
|
-
timeout: 1000,
|
|
78
|
-
});
|
|
79
|
-
const hasCompiler = gccResult.status === 0 || clangResult.status === 0;
|
|
80
|
-
if (!hasCompiler) {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
// Check for libseccomp by trying to compile the actual seccomp-unix-block.c file
|
|
84
|
-
// This is more reliable than checking for specific files since package
|
|
85
|
-
// installation paths vary across distributions
|
|
86
|
-
const sourceHash = getFilterGeneratorSourceHash();
|
|
87
|
-
// Write source to temp file
|
|
88
|
-
const sourcePath = writeSourceToTempFile('seccomp-unix-block', sourceHash);
|
|
89
|
-
if (!sourcePath) {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
const testBinary = join(tmpdir(), `seccomp-test-${process.pid}-${createHash('sha256').update(Math.random().toString()).digest('hex').substring(0, 8)}`);
|
|
93
|
-
try {
|
|
94
|
-
// Try to compile the real program
|
|
95
|
-
const compiler = gccResult.status === 0 ? 'gcc' : 'clang';
|
|
96
|
-
const compileResult = spawnSync(compiler, ['-o', testBinary, sourcePath, '-lseccomp'], {
|
|
97
|
-
stdio: 'ignore',
|
|
98
|
-
timeout: 5000,
|
|
99
|
-
});
|
|
100
|
-
// Clean up test binary
|
|
101
|
-
try {
|
|
102
|
-
fs.rmSync(testBinary, { force: true });
|
|
103
|
-
}
|
|
104
|
-
catch {
|
|
105
|
-
// Ignore cleanup errors
|
|
106
|
-
}
|
|
107
|
-
return compileResult.status === 0;
|
|
108
|
-
}
|
|
109
|
-
catch {
|
|
110
|
-
// Clean up on error
|
|
111
|
-
try {
|
|
112
|
-
fs.rmSync(testBinary, { force: true });
|
|
113
|
-
}
|
|
114
|
-
catch {
|
|
115
|
-
// Ignore cleanup errors
|
|
116
|
-
}
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
catch {
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
42
|
/**
|
|
125
43
|
* Get the path to a pre-generated BPF filter file from the vendor directory
|
|
126
44
|
* Returns the path if it exists, null otherwise
|
|
@@ -158,144 +76,46 @@ export function getPreGeneratedBpfPath() {
|
|
|
158
76
|
logForDebugging(`[SeccompFilter] Pre-generated BPF filter not found in any expected location (${arch})`);
|
|
159
77
|
return null;
|
|
160
78
|
}
|
|
161
|
-
// Cache directory for compiled binaries
|
|
162
|
-
const CACHE_DIR = join(tmpdir(), 'claude', 'seccomp-cache');
|
|
163
79
|
/**
|
|
164
|
-
* Get the path to
|
|
165
|
-
*
|
|
80
|
+
* Get the path to the apply-seccomp binary from the vendor directory
|
|
81
|
+
* Returns the path if it exists, null otherwise
|
|
166
82
|
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
* 2. ../vendor/seccomp-src/{filename} (dist/vendor - for bundlers)
|
|
83
|
+
* Pre-built apply-seccomp binaries are organized by architecture:
|
|
84
|
+
* - vendor/seccomp/{x64,arm64}/apply-seccomp
|
|
170
85
|
*
|
|
171
|
-
*
|
|
86
|
+
* Tries multiple paths for resilience:
|
|
87
|
+
* 1. ../../vendor/seccomp/{arch}/apply-seccomp (package root - standard npm installs)
|
|
88
|
+
* 2. ../vendor/seccomp/{arch}/apply-seccomp (dist/vendor - for bundlers)
|
|
172
89
|
*/
|
|
173
|
-
function
|
|
90
|
+
export function getApplySeccompBinaryPath() {
|
|
91
|
+
// Determine architecture
|
|
92
|
+
const arch = getVendorArchitecture();
|
|
93
|
+
if (!arch) {
|
|
94
|
+
logForDebugging(`[SeccompFilter] Cannot find apply-seccomp binary: unsupported architecture ${process.arch}`);
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
logForDebugging(`[SeccompFilter] Looking for apply-seccomp binary for architecture: ${arch}`);
|
|
98
|
+
// Try to locate the binary with fallback paths
|
|
174
99
|
// Path is relative to the compiled code location (dist/sandbox/)
|
|
175
100
|
const baseDir = dirname(fileURLToPath(import.meta.url));
|
|
176
|
-
const relativePath = join('vendor', 'seccomp
|
|
101
|
+
const relativePath = join('vendor', 'seccomp', arch, 'apply-seccomp');
|
|
177
102
|
// Try paths in order of preference
|
|
178
103
|
const pathsToTry = [
|
|
179
|
-
join(baseDir, '..', '..', relativePath), // package root: vendor/seccomp
|
|
180
|
-
join(baseDir, '..', relativePath), // dist: dist/vendor/seccomp
|
|
104
|
+
join(baseDir, '..', '..', relativePath), // package root: vendor/seccomp/...
|
|
105
|
+
join(baseDir, '..', relativePath), // dist: dist/vendor/seccomp/...
|
|
181
106
|
];
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return path;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
// If none exist, return first path for backward compatibility with error messages
|
|
189
|
-
return pathsToTry[0];
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Read a source file from vendor/seccomp-src directory
|
|
193
|
-
* Returns null if the file doesn't exist
|
|
194
|
-
*/
|
|
195
|
-
function readVendorSource(filename) {
|
|
196
|
-
const sourcePath = getVendorSourcePath(filename);
|
|
197
|
-
try {
|
|
198
|
-
if (!fs.existsSync(sourcePath)) {
|
|
199
|
-
logForDebugging(`[SeccompFilter] Source file not found: ${sourcePath}`, { level: 'warn' });
|
|
200
|
-
return null;
|
|
201
|
-
}
|
|
202
|
-
return fs.readFileSync(sourcePath, 'utf8');
|
|
203
|
-
}
|
|
204
|
-
catch (err) {
|
|
205
|
-
logForDebugging(`[SeccompFilter] Failed to read source file ${sourcePath}: ${err}`, { level: 'error' });
|
|
206
|
-
return null;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Get the hash of the filter generator C source
|
|
211
|
-
*/
|
|
212
|
-
function getFilterGeneratorSourceHash() {
|
|
213
|
-
const source = readVendorSource('seccomp-unix-block.c');
|
|
214
|
-
if (!source) {
|
|
215
|
-
// Fallback hash if source file is missing
|
|
216
|
-
return 'missing';
|
|
217
|
-
}
|
|
218
|
-
return createHash('sha256')
|
|
219
|
-
.update(source)
|
|
220
|
-
.digest('hex')
|
|
221
|
-
.substring(0, 16);
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Write C source code to a temporary file
|
|
225
|
-
* Returns the path to the temporary source file, or null on failure
|
|
226
|
-
*/
|
|
227
|
-
function writeSourceToTempFile(name, hash) {
|
|
228
|
-
const sourcePath = join(CACHE_DIR, `${name}-${hash}.c`);
|
|
229
|
-
// Check if source file already exists (cached)
|
|
230
|
-
if (fs.existsSync(sourcePath)) {
|
|
231
|
-
return sourcePath;
|
|
232
|
-
}
|
|
233
|
-
// Read source from vendor directory
|
|
234
|
-
const source = readVendorSource(`${name}.c`);
|
|
235
|
-
if (!source) {
|
|
236
|
-
logForDebugging(`[SeccompFilter] Cannot write source file: source not found in vendor directory`, { level: 'error' });
|
|
237
|
-
return null;
|
|
238
|
-
}
|
|
239
|
-
try {
|
|
240
|
-
// Create cache directory if it doesn't exist (recursive to create parent dirs)
|
|
241
|
-
fs.mkdirSync(CACHE_DIR, { recursive: true });
|
|
242
|
-
// Write the C source to the temp file
|
|
243
|
-
fs.writeFileSync(sourcePath, source, { encoding: 'utf8' });
|
|
244
|
-
logForDebugging(`[SeccompFilter] Wrote C source to ${sourcePath}`);
|
|
245
|
-
return sourcePath;
|
|
246
|
-
}
|
|
247
|
-
catch (err) {
|
|
248
|
-
logForDebugging(`[SeccompFilter] Failed to write source file: ${err}`, {
|
|
249
|
-
level: 'error',
|
|
250
|
-
});
|
|
251
|
-
return null;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Compile the seccomp filter generator program
|
|
256
|
-
* Returns the path to the compiled binary or null on failure
|
|
257
|
-
*/
|
|
258
|
-
function compileSeccompGenerator() {
|
|
259
|
-
const sourceHash = getFilterGeneratorSourceHash();
|
|
260
|
-
const binaryPath = join(CACHE_DIR, `seccomp-unix-block-${sourceHash}`);
|
|
261
|
-
// Check if cached binary exists
|
|
262
|
-
if (fs.existsSync(binaryPath)) {
|
|
263
|
-
logForDebugging('[SeccompFilter] Using cached filter generator binary');
|
|
264
|
-
return binaryPath;
|
|
265
|
-
}
|
|
266
|
-
logForDebugging('[SeccompFilter] Compiling seccomp filter generator...');
|
|
267
|
-
// Write source to temp file
|
|
268
|
-
const sourcePath = writeSourceToTempFile('seccomp-unix-block', sourceHash);
|
|
269
|
-
if (!sourcePath) {
|
|
270
|
-
return null;
|
|
271
|
-
}
|
|
272
|
-
// Try gcc first, then clang
|
|
273
|
-
const compilers = ['gcc', 'clang'];
|
|
274
|
-
for (const compiler of compilers) {
|
|
275
|
-
const result = spawnSync(compiler, ['-o', binaryPath, sourcePath, '-lseccomp'], {
|
|
276
|
-
stdio: 'pipe',
|
|
277
|
-
timeout: 30000, // 30 second timeout
|
|
278
|
-
});
|
|
279
|
-
if (result.status === 0) {
|
|
280
|
-
logForDebugging(`[SeccompFilter] Successfully compiled filter generator with ${compiler}`);
|
|
107
|
+
for (const binaryPath of pathsToTry) {
|
|
108
|
+
if (fs.existsSync(binaryPath)) {
|
|
109
|
+
logForDebugging(`[SeccompFilter] Found apply-seccomp binary: ${binaryPath} (${arch})`);
|
|
281
110
|
return binaryPath;
|
|
282
111
|
}
|
|
283
|
-
logForDebugging(`[SeccompFilter] Filter generator compilation with ${compiler} failed: ${result.stderr?.toString() || 'unknown error'}`, { level: 'error' });
|
|
284
112
|
}
|
|
285
|
-
logForDebugging(
|
|
286
|
-
'Ensure gcc or clang and libseccomp-dev are installed.', { level: 'error' });
|
|
113
|
+
logForDebugging(`[SeccompFilter] apply-seccomp binary not found in any expected location (${arch})`);
|
|
287
114
|
return null;
|
|
288
115
|
}
|
|
289
116
|
/**
|
|
290
|
-
* Get the path to
|
|
291
|
-
*
|
|
292
|
-
*/
|
|
293
|
-
function getSeccompGeneratorPath() {
|
|
294
|
-
return compileSeccompGenerator();
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Generate a seccomp BPF filter that blocks Unix domain socket creation
|
|
298
|
-
* Returns the path to the BPF filter file, or null if generation failed
|
|
117
|
+
* Get the path to a pre-generated seccomp BPF filter that blocks Unix domain socket creation
|
|
118
|
+
* Returns the path to the BPF filter file, or null if not available
|
|
299
119
|
*
|
|
300
120
|
* The filter blocks socket(AF_UNIX, ...) syscalls while allowing all other syscalls.
|
|
301
121
|
* This prevents creation of new Unix domain socket file descriptors.
|
|
@@ -311,137 +131,28 @@ function getSeccompGeneratorPath() {
|
|
|
311
131
|
* read user-space memory to inspect socket paths).
|
|
312
132
|
*
|
|
313
133
|
* Requirements:
|
|
314
|
-
* - Pre-generated BPF filters included for x64 and ARM64
|
|
315
|
-
* -
|
|
134
|
+
* - Pre-generated BPF filters included for x64 and ARM64 only
|
|
135
|
+
* - Other architectures are not supported
|
|
316
136
|
*
|
|
317
|
-
* @returns Path to the BPF filter file, or null
|
|
137
|
+
* @returns Path to the pre-generated BPF filter file, or null if not available
|
|
318
138
|
*/
|
|
319
139
|
export function generateSeccompFilter() {
|
|
320
|
-
// Check for Python 3 first - required for applying seccomp filters
|
|
321
|
-
if (!hasPython3Sync()) {
|
|
322
|
-
logForDebugging('[SeccompFilter] Python 3 is not available. ' +
|
|
323
|
-
'Python 3 is required for applying seccomp filters via the helper script. ' +
|
|
324
|
-
'Install Python 3 (e.g., "apt-get install python3") or set allowAllUnixSockets: true to disable Unix socket blocking.', { level: 'error' });
|
|
325
|
-
return null;
|
|
326
|
-
}
|
|
327
|
-
// Try pre-generated BPF filter first (fast path - no compilation needed)
|
|
328
140
|
const preGeneratedBpf = getPreGeneratedBpfPath();
|
|
329
141
|
if (preGeneratedBpf) {
|
|
330
142
|
logForDebugging('[SeccompFilter] Using pre-generated BPF filter');
|
|
331
143
|
return preGeneratedBpf;
|
|
332
144
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
const binaryPath = getSeccompGeneratorPath();
|
|
337
|
-
if (!binaryPath) {
|
|
338
|
-
logForDebugging('[SeccompFilter] Cannot generate BPF filter: no pre-generated file and compilation failed. ' +
|
|
339
|
-
'Ensure gcc/clang and libseccomp-dev are installed for runtime compilation.', { level: 'error' });
|
|
340
|
-
return null;
|
|
341
|
-
}
|
|
342
|
-
// Generate a unique filename for this filter
|
|
343
|
-
const filterPath = join(tmpdir(), `claude-seccomp-${process.pid}-${createHash('sha256').update(Math.random().toString()).digest('hex').substring(0, 8)}.bpf`);
|
|
344
|
-
logForDebugging(`[SeccompFilter] Generating BPF filter to ${filterPath}`);
|
|
345
|
-
// Run the compiled binary to generate the filter
|
|
346
|
-
const result = spawnSync(binaryPath, [filterPath], {
|
|
347
|
-
stdio: 'pipe',
|
|
348
|
-
timeout: 5000, // 5 second timeout
|
|
349
|
-
});
|
|
350
|
-
if (result.status !== 0) {
|
|
351
|
-
logForDebugging(`[SeccompFilter] Failed to generate filter: ${result.stderr?.toString() || 'unknown error'}`, { level: 'error' });
|
|
352
|
-
return null;
|
|
353
|
-
}
|
|
354
|
-
// Verify the filter file was created
|
|
355
|
-
if (!fs.existsSync(filterPath)) {
|
|
356
|
-
logForDebugging('[SeccompFilter] Filter file was not created', {
|
|
357
|
-
level: 'error',
|
|
358
|
-
});
|
|
359
|
-
return null;
|
|
360
|
-
}
|
|
361
|
-
logForDebugging('[SeccompFilter] Successfully generated BPF filter via runtime compilation');
|
|
362
|
-
return filterPath;
|
|
145
|
+
logForDebugging('[SeccompFilter] Pre-generated BPF filter not available for this architecture. ' +
|
|
146
|
+
'Only x64 and arm64 are supported.', { level: 'error' });
|
|
147
|
+
return null;
|
|
363
148
|
}
|
|
364
149
|
/**
|
|
365
150
|
* Clean up a seccomp filter file
|
|
366
|
-
*
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
// Don't delete pre-generated BPF files from vendor/
|
|
370
|
-
if (filterPath.includes('/vendor/seccomp/')) {
|
|
371
|
-
logForDebugging('[SeccompFilter] Skipping cleanup of pre-generated BPF file');
|
|
372
|
-
return;
|
|
373
|
-
}
|
|
374
|
-
// Only clean up runtime-generated files (in /tmp/)
|
|
375
|
-
try {
|
|
376
|
-
if (fs.existsSync(filterPath)) {
|
|
377
|
-
fs.rmSync(filterPath, { force: true });
|
|
378
|
-
logForDebugging(`[SeccompFilter] Cleaned up filter file: ${filterPath}`);
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
catch (err) {
|
|
382
|
-
logForDebugging(`[SeccompFilter] Failed to clean up filter file: ${err}`, {
|
|
383
|
-
level: 'error',
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
/**
|
|
388
|
-
* Get the hash of the apply-seccomp Python script source
|
|
389
|
-
*/
|
|
390
|
-
function getApplySeccompScriptHash() {
|
|
391
|
-
const source = readVendorSource('apply-seccomp-and-exec.py');
|
|
392
|
-
if (!source) {
|
|
393
|
-
// Fallback hash if source file is missing
|
|
394
|
-
return 'missing';
|
|
395
|
-
}
|
|
396
|
-
return createHash('sha256')
|
|
397
|
-
.update(source)
|
|
398
|
-
.digest('hex')
|
|
399
|
-
.substring(0, 16);
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* Write the apply-seccomp Python script to the cache directory
|
|
403
|
-
* Returns the path to the script, or null on failure
|
|
404
|
-
*/
|
|
405
|
-
function writeApplySeccompScript() {
|
|
406
|
-
const scriptHash = getApplySeccompScriptHash();
|
|
407
|
-
const scriptPath = join(CACHE_DIR, `apply-seccomp-and-exec-${scriptHash}.py`);
|
|
408
|
-
// Check if script already exists (cached)
|
|
409
|
-
if (fs.existsSync(scriptPath)) {
|
|
410
|
-
logForDebugging('[SeccompFilter] Using cached apply-seccomp Python script');
|
|
411
|
-
return scriptPath;
|
|
412
|
-
}
|
|
413
|
-
// Read source from vendor directory
|
|
414
|
-
const source = readVendorSource('apply-seccomp-and-exec.py');
|
|
415
|
-
if (!source) {
|
|
416
|
-
logForDebugging('[SeccompFilter] Cannot write Python script: source not found in vendor directory', { level: 'error' });
|
|
417
|
-
return null;
|
|
418
|
-
}
|
|
419
|
-
try {
|
|
420
|
-
// Create cache directory if it doesn't exist
|
|
421
|
-
fs.mkdirSync(CACHE_DIR, { recursive: true });
|
|
422
|
-
// Write the Python script
|
|
423
|
-
fs.writeFileSync(scriptPath, source, {
|
|
424
|
-
encoding: 'utf8',
|
|
425
|
-
mode: 0o755, // Make executable
|
|
426
|
-
});
|
|
427
|
-
logForDebugging(`[SeccompFilter] Wrote apply-seccomp Python script to ${scriptPath}`);
|
|
428
|
-
return scriptPath;
|
|
429
|
-
}
|
|
430
|
-
catch (err) {
|
|
431
|
-
logForDebugging(`[SeccompFilter] Failed to write apply-seccomp Python script: ${err}`, { level: 'error' });
|
|
432
|
-
return null;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
/**
|
|
436
|
-
* Get the path to the apply-seccomp-and-exec Python script
|
|
437
|
-
* This script applies a seccomp filter and execs a command, replacing the need
|
|
438
|
-
* for nested bwrap with --seccomp flag.
|
|
439
|
-
*
|
|
440
|
-
* The script is cached in the temp directory to avoid repeated writes.
|
|
441
|
-
*
|
|
442
|
-
* @returns Path to the Python script, or null on failure
|
|
151
|
+
* Since we only use pre-generated BPF files from vendor/, this is a no-op.
|
|
152
|
+
* Pre-generated files are never deleted.
|
|
153
|
+
* Kept for backward compatibility with existing code that calls it.
|
|
443
154
|
*/
|
|
444
|
-
export function
|
|
445
|
-
|
|
155
|
+
export function cleanupSeccompFilter(_filterPath) {
|
|
156
|
+
// No-op: pre-generated BPF files are never cleaned up
|
|
446
157
|
}
|
|
447
158
|
//# sourceMappingURL=generate-seccomp-filter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-seccomp-filter.js","sourceRoot":"","sources":["../../src/sandbox/generate-seccomp-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC;;;GAGG;AACH,SAAS,qBAAqB;IAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAc,CAAA;IACnC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,KAAK,CAAC;QACX,KAAK,QAAQ;YACX,OAAO,KAAK,CAAA;QACd,KAAK,OAAO,CAAC;QACb,KAAK,SAAS;YACZ,OAAO,OAAO,CAAA;QACh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AAe,CAAC,wDAAwD,UAAU,EAAE,CAAC,CAAA;QACrF,OAAO,UAAU,CAAA;IACnB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,eAAe,CACb,gEAAgE,GAAG,EAAE,EACrE,EAAE,KAAK,EAAE,OAAO,EAAE,CACnB,CAAA;QACD,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,uBAAuB,EAAE,CAAA;AAClC,CAAC"}
|
|
1
|
+
{"version":3,"file":"generate-seccomp-filter.js","sourceRoot":"","sources":["../../src/sandbox/generate-seccomp-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD;;;GAGG;AACH,SAAS,qBAAqB;IAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAc,CAAA;IACnC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,KAAK,CAAC;QACX,KAAK,QAAQ;YACX,OAAO,KAAK,CAAA;QACd,KAAK,OAAO,CAAC;QACb,KAAK,SAAS;YACZ,OAAO,OAAO,CAAA;QAChB,KAAK,MAAM,CAAC;QACZ,KAAK,KAAK;YACR,0CAA0C;YAC1C,wFAAwF;YACxF,mGAAmG;YACnG,4FAA4F;YAC5F,6FAA6F;YAC7F,EAAE;YACF,8CAA8C;YAC9C,8EAA8E;YAC9E,2FAA2F;YAC3F,8CAA8C;YAC9C,kDAAkD;YAClD,mFAAmF;YACnF,EAAE;YACF,sEAAsE;YACtE,eAAe,CACb,6GAA6G;gBAC7G,0HAA0H,EAC1H,EAAE,KAAK,EAAE,OAAO,EAAE,CACnB,CAAA;YACD,OAAO,IAAI,CAAA;Q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