@landstrip/landstrip 0.17.34 → 0.17.36

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.
Files changed (2) hide show
  1. package/README.md +96 -26
  2. package/package.json +9 -9
package/README.md CHANGED
@@ -4,8 +4,8 @@
4
4
  # landstrip
5
5
 
6
6
  `landstrip` runs commands in an OS-level sandbox using Landlock LSM on Linux,
7
- Seatbelt on macOS, and LPAC AppContainer on Windows. It accepts the Anthropic
8
- Sandbox Runtime policy subset in JSON or YAML.
7
+ Seatbelt on macOS, and AppContainer or restricted local users on Windows. It
8
+ accepts the Anthropic Sandbox Runtime policy subset in JSON or YAML.
9
9
 
10
10
  ## Installation
11
11
 
@@ -41,12 +41,12 @@ details.
41
41
 
42
42
  ## Platforms
43
43
 
44
- | Area | macOS | Linux | Windows |
45
- | ------------ | ----------------------- | --------------------------- | ------------------------- |
46
- | Policy | path-based rules | file-based rules | per-run AppContainer ACLs |
47
- | Timing | dynamic path subset | static file-based ruleset | per-run ACL grants |
48
- | TCP | proxy or loopback | proxy or loopback | allow all or deny all |
49
- | Unix sockets | allowlist | seccomp-brokered allowlist | allow all or deny all |
44
+ | Area | macOS | Linux | Windows |
45
+ | ------------ | ---------------------- | -------------------------- | ---------------------------------- |
46
+ | Policy | path-based rules | file-based rules | per-run ACL grants |
47
+ | Timing | dynamic path subset | static file-based ruleset | per-run grants with cleanup |
48
+ | TCP | proxy or loopback | proxy or loopback | capabilities or account-scoped WFP |
49
+ | Unix sockets | allowlist | seccomp-brokered allowlist | allow all or deny all |
50
50
 
51
51
  ### Linux
52
52
 
@@ -65,22 +65,74 @@ and reports broker decisions.
65
65
 
66
66
  ### Windows
67
67
 
68
- Windows provides AppContainer for application-level sandboxing. Landstrip
69
- creates a per-run LPAC AppContainer profile, grants its SID access to the lowered
70
- read and write roots, and removes those grants after the sandboxed process tree
71
- exits. Windows policies must use explicit read allowlists.
68
+ Landstrip has two Windows backends. AppContainer is the default and needs no
69
+ installation. The restricted-user backend is an explicit, preinstalled alternative
70
+ for programs such as Git Bash/MSYS that cannot initialize inside AppContainer.
71
+ Select the backend with the trusted command-line option `--windows-backend`; a
72
+ project policy cannot select it.
72
73
 
73
- Landstrip assigns the sandboxed process to a Job Object with
74
- `KILL_ON_JOB_CLOSE`, so child processes are kept in the sandbox process tree and
75
- are terminated when the launcher exits.
74
+ Both backends use explicit read allowlists. Ancestors receive traversal-only,
75
+ non-inheriting access; unrelated siblings are not exposed.
76
76
 
77
- `allowNetwork` grants the internet and private-network AppContainer
78
- capabilities, while the default container holds none and denies all network
79
- access.
77
+ #### AppContainer
80
78
 
81
- AppContainer capabilities are coarse. Fine-grained TCP policies by host or port
82
- require elevated Windows Filtering Platform rules keyed by the AppContainer SID,
83
- which is unsuitable for an unprivileged agent sandbox runtime.
79
+ Landstrip creates a per-run profile, grants its SID access to the lowered read and
80
+ write roots, and removes those grants after the sandboxed process tree exits.
81
+
82
+ `windows.appContainerMode` selects `"lpac"` (the default) or `"standard"`. LPAC
83
+ provides the stricter boundary. Standard AppContainer can also access resources
84
+ already granted to `ALL APPLICATION PACKAGES`, so selecting it is an explicit
85
+ security downgrade. Landstrip never retries an LPAC launch in standard mode.
86
+
87
+ Landstrip assigns the sandboxed process to a Job Object with `KILL_ON_JOB_CLOSE`, so
88
+ child processes are kept in the sandbox process tree and terminated when the
89
+ launcher exits. When a restrictive host Job Object prevents safe breakaway,
90
+ Landstrip fails with `HOST_JOB_INCOMPATIBLE`; it never launches without its own job.
91
+
92
+ `allowNetwork` grants the internet and private-network AppContainer capabilities,
93
+ while the default container holds none. `windows.allowLoopback` is a separate,
94
+ explicit opt-in that temporarily exempts only the per-run AppContainer SID. The
95
+ exemption permits every local loopback service, not a single proxy port. Existing
96
+ system exemptions are preserved and the per-run exemption is removed at exit.
97
+
98
+ AppContainer capabilities are coarse. Fine-grained direct TCP policies by host or
99
+ port require elevated Windows Filtering Platform rules keyed by the AppContainer
100
+ SID, which is unsuitable for an unprivileged agent sandbox runtime.
101
+
102
+ #### Restricted user
103
+
104
+ Install the restricted-user backend once from the intended host account. Setup
105
+ requests elevation through UAC, provisions dedicated local accounts, installs
106
+ account-scoped persistent WFP rules, and copies a protected broker executable:
107
+
108
+ ```powershell
109
+ landstrip windows setup
110
+ landstrip windows status
111
+ landstrip --windows-backend restricted-user -p policy.json cargo test
112
+ landstrip windows uninstall
113
+ ```
114
+
115
+ The default pool has eight restricted-network accounts and two unrestricted-network
116
+ accounts. Use `landstrip windows setup --help` to configure pool sizes and the
117
+ loopback proxy port range. Setup replaces an existing installation; uninstall
118
+ revokes recorded ACL grants, removes WFP policy and accounts, and deletes the
119
+ installed runner.
120
+
121
+ Each run exclusively leases an account, journals its filesystem grants before
122
+ applying them, launches the command through a restricted token and Job Object, then
123
+ revokes the grants. A later lease or uninstall recovers stale journaled grants after
124
+ a crash. Account credentials are random, stored with Windows DPAPI, and never placed
125
+ in policy files.
126
+
127
+ Restricted-network accounts are blocked by WFP except for loopback connections to
128
+ the proxy port range chosen during setup. Proxy ports in a policy must fall in that
129
+ range. `network.allowLocalBinding` and `windows.allowLoopback` are unsupported by
130
+ this backend. `network.allowNetwork: true` instead leases an unrestricted-network
131
+ account and therefore requires at least one such account in the installed pool.
132
+
133
+ The restricted token enforces the per-run account-SID grants while retaining the
134
+ standard `ALL APPLICATION PACKAGES` read/execute baseline for Windows and Program
135
+ Files. As with standard AppContainer, resources exposed to that SID remain visible.
84
136
 
85
137
  ## Policy format
86
138
 
@@ -151,8 +203,25 @@ For a filesystem-only sandbox with unrestricted direct network access, set:
151
203
  ```
152
204
 
153
205
  `allowNetwork` disables Landstrip network enforcement while leaving filesystem
154
- policy enforcement in place. On Windows this grants the AppContainer its network
155
- capabilities; without it the container denies all network access.
206
+ policy enforcement in place. On Windows, AppContainer receives its network
207
+ capabilities while the restricted-user backend leases an unrestricted-network
208
+ account. With `allowNetwork: false`, AppContainer denies network unless
209
+ `windows.allowLoopback` enables the all-loopback exemption described above; the
210
+ restricted-user backend permits only the installed loopback proxy port range.
211
+
212
+ A Windows runtime that requires standard AppContainer and loopback can opt in with
213
+ the following policy:
214
+
215
+ ```json
216
+ {
217
+ "windows": {
218
+ "appContainerMode": "standard",
219
+ "allowLoopback": true
220
+ }
221
+ }
222
+ ```
223
+
224
+ Core Landstrip defaults to LPAC with loopback disabled.
156
225
 
157
226
  ## Traps
158
227
 
@@ -196,9 +265,10 @@ the same `LAUNCH_FAILED` or `SANDBOX_SETUP_FAILED` is raised by every backend
196
265
  that has that stage. The platform detail rides along in the record instead.
197
266
 
198
267
  `mechanism` records the kernel layer an event is attributed to: `landlock`,
199
- `seccomp`, `seatbelt`, or `appcontainer`. Per-denial traps are always `seccomp`,
200
- the only layer with a per-denial callback; Landlock enforces in-kernel without
201
- one. `SANDBOX_SETUP_FAILED` carries the mechanism that could not be installed.
268
+ `seccomp`, `seatbelt`, `appcontainer`, or `windowsuser`. Per-denial traps are always
269
+ `seccomp`, the only layer with a per-denial callback; Landlock enforces in-kernel
270
+ without one. `SANDBOX_SETUP_FAILED` carries the mechanism that could not be
271
+ installed.
202
272
 
203
273
  `reason` is a platform-independent classification of a filesystem decision,
204
274
  derived from the policy and the requested path:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@landstrip/landstrip",
3
- "version": "0.17.34",
3
+ "version": "0.17.36",
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.17.34",
34
- "@landstrip/landstrip-darwin-x64": "0.17.34",
35
- "@landstrip/landstrip-linux-x64": "0.17.34",
36
- "@landstrip/landstrip-linux-arm64": "0.17.34",
37
- "@landstrip/landstrip-win32-x64": "0.17.34",
38
- "@landstrip/landstrip-win32-arm64": "0.17.34"
33
+ "@landstrip/landstrip-darwin-arm64": "0.17.36",
34
+ "@landstrip/landstrip-darwin-x64": "0.17.36",
35
+ "@landstrip/landstrip-linux-x64": "0.17.36",
36
+ "@landstrip/landstrip-linux-arm64": "0.17.36",
37
+ "@landstrip/landstrip-win32-x64": "0.17.36",
38
+ "@landstrip/landstrip-win32-arm64": "0.17.36"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
@@ -47,7 +47,7 @@
47
47
  "packages/*"
48
48
  ],
49
49
  "scripts": {
50
- "ci:extensions": "scripts/test-extensions.sh",
51
- "ci:extensions:local": "scripts/test-extensions.sh --local-root"
50
+ "ci:extensions": "bash scripts/test-extensions.sh",
51
+ "ci:extensions:local": "bash scripts/test-extensions.sh --local-root"
52
52
  }
53
53
  }