@landstrip/landstrip 0.18.3 → 0.18.5
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 +81 -344
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -3,29 +3,22 @@
|
|
|
3
3
|
|
|
4
4
|
# landstrip
|
|
5
5
|
|
|
6
|
-
`landstrip` runs commands in an OS-level sandbox using Landlock
|
|
7
|
-
Seatbelt on macOS, and AppContainer or restricted
|
|
8
|
-
|
|
6
|
+
`landstrip` runs commands in an OS-level sandbox using Landlock on Linux,
|
|
7
|
+
Seatbelt on macOS, and AppContainer or restricted users on Windows. Policies use
|
|
8
|
+
the supported subset of the Anthropic Sandbox Runtime format.
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
12
|
-
### npm
|
|
13
|
-
|
|
14
12
|
```sh
|
|
15
13
|
npm install --save-dev @landstrip/landstrip
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
```sh
|
|
19
14
|
npx landstrip run -p policy.json -- cargo test
|
|
20
15
|
```
|
|
21
16
|
|
|
22
|
-
The npm package installs a
|
|
23
|
-
|
|
17
|
+
The npm package installs a Node.js wrapper and a native binary for the current
|
|
18
|
+
platform.
|
|
24
19
|
|
|
25
20
|
## Command line
|
|
26
21
|
|
|
27
|
-
Landstrip uses explicit commands:
|
|
28
|
-
|
|
29
22
|
```text
|
|
30
23
|
landstrip run [OPTIONS] -- <PROGRAM> [ARGS...]
|
|
31
24
|
landstrip policy validate [OPTIONS]
|
|
@@ -36,26 +29,25 @@ landstrip windows status
|
|
|
36
29
|
landstrip windows uninstall
|
|
37
30
|
```
|
|
38
31
|
|
|
39
|
-
The `windows`
|
|
32
|
+
The `windows` commands exist only in Windows builds.
|
|
33
|
+
|
|
34
|
+
Pass policies with `-p, --policy <FILE>`. The option may be repeated; objects
|
|
35
|
+
merge recursively, later scalar values replace earlier ones, and arrays combine.
|
|
36
|
+
JSON is the default. Use `--policy-format yaml` for YAML and always specify the
|
|
37
|
+
format with `-p -`.
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
resolve` prints the normalized merged policy. Add `--tool <PROGRAM>` to either
|
|
46
|
-
policy command to include executable-attached policy.
|
|
39
|
+
`run` also merges policy attached to the program executable. `policy validate`
|
|
40
|
+
checks parsing, resolution, and platform support. `policy resolve` prints the
|
|
41
|
+
normalized policy; add `--tool <PROGRAM>` to include executable policy.
|
|
42
|
+
`doctor` checks that the platform sandbox is usable.
|
|
47
43
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
an unhealthy `windows status` exits with status 1. Operational failures emit a
|
|
51
|
-
coded trap on standard error. `run` returns the sandboxed program's exit status.
|
|
44
|
+
Inspection and management commands print one JSON document. `run` returns the
|
|
45
|
+
program's exit status. Usage errors return 2; other Landstrip failures return 1.
|
|
52
46
|
|
|
53
47
|
### Agent extensions
|
|
54
48
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
processes. Subagents normally run inside a Landstrip sandbox. Disabling sandboxing
|
|
58
|
-
shows a warning and uses process isolation only:
|
|
49
|
+
Companion extensions integrate Landstrip with Pi and OpenCode. The Pi extension
|
|
50
|
+
also provides primary agents and process-backed subagents.
|
|
59
51
|
|
|
60
52
|
```sh
|
|
61
53
|
pi install npm:pi-landstrip
|
|
@@ -63,346 +55,91 @@ opencode plugin install opencode-landstrip
|
|
|
63
55
|
```
|
|
64
56
|
|
|
65
57
|
See [pi-landstrip](packages/pi-landstrip/README.md) and
|
|
66
|
-
[opencode-landstrip](packages/opencode-landstrip/README.md)
|
|
67
|
-
details.
|
|
68
|
-
|
|
69
|
-
## Platforms
|
|
70
|
-
|
|
71
|
-
| Area | macOS | Linux | Windows |
|
|
72
|
-
| ------------ | ---------------------- | -------------------------- | ---------------------------------- |
|
|
73
|
-
| Policy | path-based rules | file-based rules | per-run ACL grants |
|
|
74
|
-
| Timing | dynamic path subset | static file-based ruleset | per-run grants with cleanup |
|
|
75
|
-
| TCP | proxy or loopback | proxy or loopback | capabilities or account-scoped WFP |
|
|
76
|
-
| Unix sockets | allowlist | seccomp-brokered allowlist | allow all or deny all |
|
|
77
|
-
|
|
78
|
-
### Linux
|
|
79
|
-
|
|
80
|
-
Landlock carves the denied subtrees out of the allowed roots, and then grants
|
|
81
|
-
`PATH_BENEATH` rules only for the surviving fragments. The denied path is never
|
|
82
|
-
added to the ruleset, and the kernel enforces the path directly.
|
|
83
|
-
|
|
84
|
-
Seccomp is applied when a policy needs more than Landlock can express
|
|
85
|
-
statically, such as filesystem mutator filtering or denial reporting. The broker
|
|
86
|
-
intercepts `openat` and `openat2` through seccomp user notifications, resolves
|
|
87
|
-
the real path, and validates it.
|
|
88
|
-
|
|
89
|
-
Landlock and seccomp cover mostly disjoint filesystem operations: Landlock
|
|
90
|
-
handles kernel-enforced path access, while seccomp mediates unsupported mutators
|
|
91
|
-
and reports broker decisions.
|
|
92
|
-
|
|
93
|
-
### Windows
|
|
94
|
-
|
|
95
|
-
Landstrip has two internal Windows implementations. AppContainer needs no
|
|
96
|
-
installation and is used by default. `landstrip windows install` provisions
|
|
97
|
-
and activates restricted-user execution for programs such as Git Bash/MSYS
|
|
98
|
-
that cannot initialize inside AppContainer. `landstrip windows uninstall`
|
|
99
|
-
returns to AppContainer. There is no implementation selector in the command
|
|
100
|
-
line or policy. An unhealthy restricted-user installation causes failure
|
|
101
|
-
rather than silent fallback, and `landstrip windows status` reports the active
|
|
102
|
-
implementation and health. Policies containing the removed `windows.backend`
|
|
103
|
-
field are rejected; use the Windows commands to select the implementation.
|
|
104
|
-
|
|
105
|
-
Both implementations use explicit read allowlists. Ancestors receive
|
|
106
|
-
traversal-only, non-inheriting access; unrelated siblings are not exposed.
|
|
107
|
-
|
|
108
|
-
#### AppContainer
|
|
109
|
-
|
|
110
|
-
Landstrip creates a per-run profile, grants its SID access to the lowered read
|
|
111
|
-
and write roots, and removes those grants after the sandboxed process tree
|
|
112
|
-
exits.
|
|
113
|
-
|
|
114
|
-
`windows.appContainerMode` selects `"lpac"` (the default) or `"standard"`.
|
|
115
|
-
LPAC provides the stricter boundary. Standard AppContainer can also access
|
|
116
|
-
resources already granted to `ALL APPLICATION PACKAGES`, so selecting it is an
|
|
117
|
-
explicit security downgrade. Landstrip never retries an LPAC launch in
|
|
118
|
-
standard mode.
|
|
119
|
-
|
|
120
|
-
Landstrip assigns the sandboxed process to a Job Object with
|
|
121
|
-
`KILL_ON_JOB_CLOSE`, so child processes are kept in the sandbox process tree
|
|
122
|
-
and terminated when the launcher exits. When a restrictive host Job Object
|
|
123
|
-
prevents safe breakaway, Landstrip fails with `HOST_JOB_INCOMPATIBLE`; it never
|
|
124
|
-
launches without its own job.
|
|
125
|
-
|
|
126
|
-
`allowNetwork` grants the internet and private-network AppContainer
|
|
127
|
-
capabilities, while the default container holds none. `windows.allowLoopback`
|
|
128
|
-
is a separate, explicit opt-in that temporarily exempts only the per-run
|
|
129
|
-
AppContainer SID. The exemption permits every local loopback service, not a
|
|
130
|
-
single proxy port. Existing system exemptions are preserved and the per-run
|
|
131
|
-
exemption is removed at exit.
|
|
132
|
-
|
|
133
|
-
AppContainer capabilities are coarse. Fine-grained direct TCP policies by host
|
|
134
|
-
or port require elevated Windows Filtering Platform rules keyed by the
|
|
135
|
-
AppContainer SID, which is unsuitable for an unprivileged agent sandbox
|
|
136
|
-
runtime.
|
|
137
|
-
|
|
138
|
-
#### Restricted user
|
|
139
|
-
|
|
140
|
-
Install restricted-user execution once from the intended host account. Install
|
|
141
|
-
requests elevation through UAC, provisions dedicated local accounts, installs
|
|
142
|
-
account-scoped persistent WFP rules, and copies a protected runner executable:
|
|
143
|
-
|
|
144
|
-
```powershell
|
|
145
|
-
landstrip windows install
|
|
146
|
-
landstrip windows status
|
|
147
|
-
landstrip run -p policy.json -- cargo test
|
|
148
|
-
landstrip windows uninstall
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
The default pool has eight restricted-network accounts and two
|
|
152
|
-
unrestricted-network accounts. Use `landstrip windows install --help` to
|
|
153
|
-
configure pool sizes and the loopback proxy port range. Install replaces an
|
|
154
|
-
existing installation; uninstall revokes recorded ACL grants, removes WFP
|
|
155
|
-
policy and accounts, and deletes the installed runner.
|
|
156
|
-
|
|
157
|
-
Each run exclusively leases an account, journals its filesystem grants before
|
|
158
|
-
applying them, launches the command through a restricted token and Job Object,
|
|
159
|
-
then revokes the grants. A later lease or uninstall recovers stale journaled
|
|
160
|
-
grants after a crash. Account credentials are random, stored with Windows
|
|
161
|
-
DPAPI, and never placed in policy files.
|
|
162
|
-
|
|
163
|
-
Restricted-network accounts are blocked by WFP except for loopback connections
|
|
164
|
-
to the proxy port range chosen during installation. Proxy ports in a policy
|
|
165
|
-
must fall in that range. `network.allowLocalBinding` and
|
|
166
|
-
`windows.allowLoopback` are unsupported by this implementation.
|
|
167
|
-
`network.allowNetwork: true` instead leases an account and therefore requires
|
|
168
|
-
at least one such account in the installed pool.
|
|
169
|
-
|
|
170
|
-
The restricted token enforces the per-run account-SID grants while retaining
|
|
171
|
-
the standard `ALL APPLICATION PACKAGES` read/execute baseline for Windows and
|
|
172
|
-
Program Files. As with standard AppContainer, resources exposed to that SID
|
|
173
|
-
remain visible.
|
|
174
|
-
|
|
175
|
-
## Policy format
|
|
176
|
-
|
|
177
|
-
JSON is the default policy format for files. Use `--policy-format yaml` for YAML
|
|
178
|
-
or specify the format explicitly whenever policy is read from standard input.
|
|
179
|
-
|
|
180
|
-
```sh
|
|
181
|
-
landstrip run --policy-format yaml -p policy.yaml -- cargo test
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
YAML path fields can use normal lists or one statement per line:
|
|
185
|
-
|
|
186
|
-
```yaml
|
|
187
|
-
filesystem:
|
|
188
|
-
allowWrite: |
|
|
189
|
-
.
|
|
190
|
-
~/.cargo
|
|
191
|
-
denyRead: |
|
|
192
|
-
~/.ssh
|
|
193
|
-
allowRead: |
|
|
194
|
-
~/.ssh/config
|
|
195
|
-
network:
|
|
196
|
-
allowNetwork: true
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
### Executable policy
|
|
200
|
-
|
|
201
|
-
Supplementary policy can be attached directly to a tool's executable inode:
|
|
202
|
-
- **Unix**: `user.landstrip.policy` extended attribute (`xattr`).
|
|
203
|
-
- **Windows**: `landstrip.policy` NTFS alternate data stream (`ADS`).
|
|
204
|
-
|
|
205
|
-
When present, the attribute contents are parsed and merged to the policy. The
|
|
206
|
-
executable is resolved via `PATH` lookup and canonicalized so policy attributes
|
|
207
|
-
are always read from the real binary inode. If an attribute exists but is
|
|
208
|
-
unreadable or malformed, tool execution is aborted.
|
|
209
|
-
|
|
210
|
-
## Filesystem policy
|
|
211
|
-
|
|
212
|
-
Write access is denied by default. `allowWrite` paths grant write access and
|
|
213
|
-
`denyWrite` paths subtract from them, with the most specific rule winning when
|
|
214
|
-
allow and deny rules overlap. Read access is unrestricted by default; setting
|
|
215
|
-
`denyRead` lowers it to an allowlist, and `allowRead` adds paths back.
|
|
216
|
-
|
|
217
|
-
### Write-denial semantics
|
|
58
|
+
[opencode-landstrip](packages/opencode-landstrip/README.md).
|
|
218
59
|
|
|
219
|
-
|
|
220
|
-
eagerly on all platforms.
|
|
221
|
-
|
|
222
|
-
Glob `denyWrite` patterns (`**/.env`, `**/*.pem`, and so on) behave differently
|
|
223
|
-
by platform:
|
|
224
|
-
|
|
225
|
-
- **Linux**: Globs are evaluated dynamically by the seccomp broker at each write
|
|
226
|
-
attempt. Files created after sandbox startup that match a `denyWrite` glob are
|
|
227
|
-
blocked. Globs are not walked at startup, avoiding latency on large trees.
|
|
228
|
-
- **macOS**: Globs are snapshot-expanded when the Seatbelt profile is compiled.
|
|
229
|
-
Files created after `sandbox_init` are not protected by glob denies; use
|
|
230
|
-
concrete paths for them. A warning is logged when glob deny patterns are used.
|
|
231
|
-
- **Windows**: Glob `denyWrite` entries are not enforced by AppContainer.
|
|
232
|
-
|
|
233
|
-
## Network policy
|
|
234
|
-
|
|
235
|
-
Sandbox mode denies direct network access by default. Proxy ports, loopback TCP
|
|
236
|
-
binding and connections, and Unix sockets can be allowed with the Anthropic
|
|
237
|
-
Sandbox Runtime network fields. `allowLocalBinding` permits both binding to and
|
|
238
|
-
connecting to loopback TCP addresses, including listeners started outside the
|
|
239
|
-
sandbox. Linux denies non-loopback connections. On macOS, Seatbelt's required
|
|
240
|
-
`localhost` matcher can also include addresses assigned to other local
|
|
241
|
-
interfaces, but public remote addresses remain denied.
|
|
242
|
-
|
|
243
|
-
For a filesystem-only sandbox with unrestricted direct network access, set:
|
|
60
|
+
## Policy
|
|
244
61
|
|
|
245
62
|
```json
|
|
246
63
|
{
|
|
64
|
+
"filesystem": {
|
|
65
|
+
"allowWrite": ["."],
|
|
66
|
+
"denyWrite": ["**/.env", "**/*.pem"],
|
|
67
|
+
"denyRead": ["~/.ssh"],
|
|
68
|
+
"allowRead": ["~/.ssh/config"]
|
|
69
|
+
},
|
|
247
70
|
"network": {
|
|
248
|
-
"allowNetwork":
|
|
71
|
+
"allowNetwork": false,
|
|
72
|
+
"httpProxyPort": 8080,
|
|
73
|
+
"allowLocalBinding": false,
|
|
74
|
+
"allowUnixSockets": []
|
|
249
75
|
}
|
|
250
76
|
}
|
|
251
77
|
```
|
|
252
78
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
capabilities while restricted-user isolation leases an unrestricted-network
|
|
256
|
-
account. With `allowNetwork: false`, AppContainer denies network unless
|
|
257
|
-
`windows.allowLoopback` enables the all-loopback exemption described above;
|
|
258
|
-
restricted-user isolation permits only the installed loopback proxy port range.
|
|
79
|
+
Paths may be absolute, relative to the starting directory, or prefixed with
|
|
80
|
+
`~`. Path lists also accept `*`, `**`, `?`, and character-class globs.
|
|
259
81
|
|
|
260
|
-
|
|
261
|
-
|
|
82
|
+
Writes are denied by default. `allowWrite` grants writable roots; `denyWrite`
|
|
83
|
+
always takes precedence. Reads are unrestricted until `denyRead` is non-empty;
|
|
84
|
+
`allowRead` then adds exceptions, with the most specific read rule winning.
|
|
262
85
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
"appContainerMode": "standard",
|
|
267
|
-
"allowLoopback": true
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
```
|
|
86
|
+
Concrete `denyWrite` paths work on every platform. Glob denies are evaluated at
|
|
87
|
+
access time on Linux and macOS, including for newly created files. Windows does
|
|
88
|
+
not enforce glob `denyWrite` entries.
|
|
271
89
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
90
|
+
Direct TCP and new Unix sockets are denied by default. Proxy ports allow
|
|
91
|
+
loopback connections only to those ports; Landstrip does not start a proxy or
|
|
92
|
+
filter domains. `allowLocalBinding` permits local TCP binding and loopback
|
|
93
|
+
connections. `allowUnixSockets` grants pathname sockets, and
|
|
94
|
+
`allowAllUnixSockets` allows all Unix sockets. Set `allowNetwork` to `true` to
|
|
95
|
+
disable network enforcement while keeping filesystem restrictions.
|
|
275
96
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
default. The `--trap-fd FD` option is available only in Unix builds and names an
|
|
281
|
-
already-open descriptor. On Linux, pending query traps go only to that descriptor.
|
|
282
|
-
|
|
283
|
-
```sh
|
|
284
|
-
landstrip run --trap-fd 3 -p policy.json -- cargo test 3>landstrip-traps.txt
|
|
285
|
-
```
|
|
97
|
+
On Unix, supplementary executable policy is read from the
|
|
98
|
+
`user.landstrip.policy` extended attribute. On Windows it is read from the
|
|
99
|
+
`landstrip.policy` NTFS alternate data stream. Executable policy is merged
|
|
100
|
+
after `--policy` files.
|
|
286
101
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
- `filesystem` (`code` `FILESYSTEM_DENIED`): `operation` is `read` or `write`,
|
|
290
|
-
`path` is the resolved path, `requested_path` is the tool's original path when
|
|
291
|
-
available, and `syscall`, `errno`, `flags`, `reason`, `suggested_grant`, and
|
|
292
|
-
`process` carry routing context.
|
|
293
|
-
- `network` (`code` `NETWORK_DENIED`): `operation` is `connect` or `bind` and
|
|
294
|
-
`target` is `address:port`, with `syscall`, `errno`, and `process` context.
|
|
295
|
-
- `launch` (`code` `LAUNCH_FAILED`): the sandbox was installed but the tool did
|
|
296
|
-
not start. `program` is the tool, `errno` its symbolic errno where the platform
|
|
297
|
-
has one, and `message` the system's text.
|
|
298
|
-
- `usage` (`code` `USAGE_ERROR`): the command line was rejected. Exits with
|
|
299
|
-
status 2, and reaches standard error only — the trap descriptor is part of the
|
|
300
|
-
arguments that failed to parse.
|
|
301
|
-
- `internal`: everything that fails before the tool runs. `code` names the stage:
|
|
302
|
-
`POLICY_PARSE_FAILED`, `POLICY_IO_FAILED`, `SANDBOX_SETUP_FAILED`,
|
|
303
|
-
`SUPERVISE_FAILED`, `PLATFORM_UNSUPPORTED`, `INTEGER_TOO_LARGE`, a
|
|
304
|
-
`POLICY_*` validation rejection (`POLICY_UNRESTRICTED_READ`,
|
|
305
|
-
`POLICY_TCP_BIND_UNSUPPORTED`, `POLICY_UNIX_SOCKET_UNSUPPORTED`,
|
|
306
|
-
`POLICY_UNIX_SOCKET_PATH`, `POLICY_DENY_WRITE_SYMLINK_ANCESTOR`,
|
|
307
|
-
`POLICY_INVALID_PORT`, `POLICY_EMPTY_PATH`, `POLICY_HOME_UNAVAILABLE`,
|
|
308
|
-
`POLICY_TRAVERSAL_DEPTH`), or `INTERNAL_ERROR` for a failure the code space
|
|
309
|
-
does not name.
|
|
310
|
-
|
|
311
|
-
A code names the stage that failed, not the operating system that reported it:
|
|
312
|
-
the same `LAUNCH_FAILED` or `SANDBOX_SETUP_FAILED` is raised by every
|
|
313
|
-
implementation that has that stage. The platform detail rides along in the
|
|
314
|
-
record instead.
|
|
315
|
-
|
|
316
|
-
`mechanism` records the kernel layer an event is attributed to: `landlock`,
|
|
317
|
-
`seccomp`, `seatbelt`, `appcontainer`, or `windowsuser`. Per-denial traps are
|
|
318
|
-
always `seccomp`, the only layer with a per-denial callback; Landlock enforces
|
|
319
|
-
in-kernel without one. `SANDBOX_SETUP_FAILED` carries the mechanism that could
|
|
320
|
-
not be installed.
|
|
321
|
-
|
|
322
|
-
`reason` is a platform-independent classification of a filesystem decision,
|
|
323
|
-
derived from the policy and the requested path:
|
|
324
|
-
|
|
325
|
-
- `allow_miss`: the path matched no allow root and was denied by default.
|
|
326
|
-
- `deny_match`: the path matched an explicit deny root that overrides an allow.
|
|
327
|
-
|
|
328
|
-
```json
|
|
329
|
-
{
|
|
330
|
-
"kind": "filesystem",
|
|
331
|
-
"code": "FILESYSTEM_DENIED",
|
|
332
|
-
"state": "info",
|
|
333
|
-
"query_id": "0",
|
|
334
|
-
"operation": "write",
|
|
335
|
-
"path": "/repo/out",
|
|
336
|
-
"requested_path": "out",
|
|
337
|
-
"syscall": "openat",
|
|
338
|
-
"errno": "EACCES",
|
|
339
|
-
"flags": ["O_WRONLY", "O_CREAT", "O_TRUNC"],
|
|
340
|
-
"reason": "allow_miss",
|
|
341
|
-
"suggested_grant": { "allowWrite": "/repo/out" },
|
|
342
|
-
"mechanism": "seccomp",
|
|
343
|
-
"process": { "pid": 1234, "exe": "/usr/bin/sh", "cwd": "/repo" }
|
|
344
|
-
}
|
|
345
|
-
{
|
|
346
|
-
"kind": "network",
|
|
347
|
-
"code": "NETWORK_DENIED",
|
|
348
|
-
"state": "info",
|
|
349
|
-
"query_id": "0",
|
|
350
|
-
"operation": "connect",
|
|
351
|
-
"target": "127.0.0.1:9999",
|
|
352
|
-
"syscall": "connect",
|
|
353
|
-
"errno": "EACCES",
|
|
354
|
-
"mechanism": "seccomp",
|
|
355
|
-
"process": { "pid": 1234, "exe": "/usr/bin/nc", "cwd": "/repo" }
|
|
356
|
-
}
|
|
357
|
-
{
|
|
358
|
-
"kind": "launch",
|
|
359
|
-
"code": "LAUNCH_FAILED",
|
|
360
|
-
"program": "/usr/bin/cargo",
|
|
361
|
-
"errno": "ENOENT",
|
|
362
|
-
"message": "No such file or directory (os error 2)"
|
|
363
|
-
}
|
|
364
|
-
{
|
|
365
|
-
"kind": "internal",
|
|
366
|
-
"code": "SANDBOX_SETUP_FAILED",
|
|
367
|
-
"mechanism": "landlock",
|
|
368
|
-
"message": "not enforced by the kernel (Linux 5.13+ with CONFIG_SECURITY_LANDLOCK required, and not disabled via the lsm= boot parameter)"
|
|
369
|
-
}
|
|
370
|
-
```
|
|
102
|
+
## Platforms
|
|
371
103
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
104
|
+
| Platform | Filesystem | Network |
|
|
105
|
+
| --- | --- | --- |
|
|
106
|
+
| Linux | Landlock and seccomp | TCP and Unix socket rules |
|
|
107
|
+
| macOS | Seatbelt | TCP and Unix socket rules |
|
|
108
|
+
| Windows | AppContainer or restricted user | AppContainer capabilities or account-scoped WFP |
|
|
377
109
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
110
|
+
Windows requires an explicit read allowlist. AppContainer is used without
|
|
111
|
+
installation; core Landstrip defaults to LPAC. `windows.appContainerMode` may
|
|
112
|
+
select `standard`, which is weaker because it can see resources granted to
|
|
113
|
+
`ALL APPLICATION PACKAGES`. In AppContainer, `windows.allowLoopback` exposes
|
|
114
|
+
every local loopback service; without it, proxy ports are blocked.
|
|
382
115
|
|
|
383
|
-
|
|
116
|
+
Use `landstrip windows install` when software such as Git Bash cannot start in
|
|
117
|
+
AppContainer. It provisions restricted local users and activates that mode.
|
|
118
|
+
`windows uninstall` removes it and returns to AppContainer. An unhealthy
|
|
119
|
+
installation fails closed; inspect it with `windows status`.
|
|
384
120
|
|
|
385
|
-
|
|
121
|
+
Windows does not support `allowLocalBinding` or Unix socket policy.
|
|
122
|
+
Restricted-user mode permits proxy ports only from the range chosen at install
|
|
123
|
+
time and does not support `windows.allowLoopback`.
|
|
386
124
|
|
|
387
|
-
|
|
388
|
-
- Add a body for non-trivial changes.
|
|
389
|
-
- Follow kernel-style commit message conventions.
|
|
390
|
-
- Include a `Signed-off-by:` trailer.
|
|
125
|
+
## Traps
|
|
391
126
|
|
|
392
|
-
|
|
127
|
+
Landstrip failures and broker-reported denials are JSON objects with a stable
|
|
128
|
+
`kind` and `code`. Failures and completed denials go to standard error. The
|
|
129
|
+
sandboxed program may also write to standard error.
|
|
393
130
|
|
|
394
|
-
|
|
395
|
-
|
|
131
|
+
On Unix, `--trap-fd FD` sends structured events to an already-open descriptor
|
|
132
|
+
numbered 3 or higher. On Linux, a socket trap descriptor can carry a
|
|
133
|
+
`state: "query"` filesystem or network event that pauses an operation for the
|
|
134
|
+
integrating host to answer. Query events go only to that socket. Kernel-only
|
|
135
|
+
and static-profile denials do not always produce a per-access event.
|
|
396
136
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
/// Returns [`Variant`] when ...
|
|
401
|
-
```
|
|
137
|
+
Trap kinds are `filesystem`, `network`, `launch`, `usage`, and `internal`.
|
|
138
|
+
Filesystem and network records describe denied operations; the other kinds
|
|
139
|
+
report failures in Landstrip itself.
|
|
402
140
|
|
|
403
141
|
## Licensing
|
|
404
142
|
|
|
405
143
|
The JavaScript npm wrapper is licensed under `Apache-2.0`. The Rust source and
|
|
406
|
-
native binaries are licensed under `LGPL-2.1-or-later`.
|
|
407
|
-
|
|
408
|
-
GitHub repository tag that matches the package version.
|
|
144
|
+
native binaries are licensed under `LGPL-2.1-or-later`. Corresponding source for
|
|
145
|
+
each native package is available from the matching repository tag.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@landstrip/landstrip",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.5",
|
|
4
4
|
"description": "Sandbox runner using Landlock, Seatbelt, and AppContainer",
|
|
5
5
|
"license": "Apache-2.0 AND LGPL-2.1-or-later",
|
|
6
6
|
"homepage": "https://github.com/landstrip/landstrip#readme",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"LICENSE-LGPL-2.1"
|
|
31
31
|
],
|
|
32
32
|
"optionalDependencies": {
|
|
33
|
-
"@landstrip/landstrip-darwin-arm64": "0.18.
|
|
34
|
-
"@landstrip/landstrip-darwin-x64": "0.18.
|
|
35
|
-
"@landstrip/landstrip-linux-x64": "0.18.
|
|
36
|
-
"@landstrip/landstrip-linux-arm64": "0.18.
|
|
37
|
-
"@landstrip/landstrip-win32-x64": "0.18.
|
|
38
|
-
"@landstrip/landstrip-win32-arm64": "0.18.
|
|
33
|
+
"@landstrip/landstrip-darwin-arm64": "0.18.5",
|
|
34
|
+
"@landstrip/landstrip-darwin-x64": "0.18.5",
|
|
35
|
+
"@landstrip/landstrip-linux-x64": "0.18.5",
|
|
36
|
+
"@landstrip/landstrip-linux-arm64": "0.18.5",
|
|
37
|
+
"@landstrip/landstrip-win32-x64": "0.18.5",
|
|
38
|
+
"@landstrip/landstrip-win32-arm64": "0.18.5"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|