1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
# sbe built-in default profiles — Linux.
# Embedded into the binary at compile time via include_str!.
#
# Path conventions:
# ~ expands to home dir, $PWD to working directory
# Trailing / means directory → Landlock path-beneath (recursive match)
# No trailing / means file → Landlock path-beneath on the file FD only
#
# Per the cross-platform-backend-design spec (§8) Linux differs from macOS:
# - denyRead is sealed forbidden-list, not a subtractive deny (see §8).
# - allowExec MUST be per-binary literals — directory subpaths defeat
# the threat model on Linux (a /usr/bin subpath grants sudo).
# - denyExec removes overlapping entries from the final allowExec set.
common:
# The project is readable but not broadly writable. The Linux compiler
# carves denyRead paths (for example .env) out of this subtree instead of
# granting a single parent rule, because Landlock has no subtractive deny.
allowRead:
- "$PWD/"
# Sealed forbidden-read list. The Linux backend refuses to silently add
# these paths to the read allowlist, even via user config.
denyRead:
# SSH / GPG
- "~/.ssh/"
- "~/.gnupg/"
# Cloud credentials
- "~/.aws/"
- "~/.azure/"
- "~/.config/gcloud/"
- "~/.kube/config"
# Container / registry auth
- "~/.docker/config.json"
- "~/.netrc"
# Password managers
- "~/.password-store/"
# Package manager tokens
- "~/.cargo/credentials.toml"
- "~/.cargo/credentials"
- "~/.pypirc"
- "~/.hex/hex_api_key"
- "~/.config/gh/"
# Environment secrets
- "$PWD/.env"
- "$PWD/.env.local"
- "$PWD/.env.production"
# Browser profiles
- "~/.mozilla/"
- "~/.config/google-chrome/"
- "~/.config/chromium/"
- "~/.config/BraveSoftware/"
# Linux realizes denyExec by removing any overlapping allowExec entry. A
# directory allow may therefore be removed in full to fail closed.
denyExec:
allowExec:
# Shells
- "/bin/sh"
- "/bin/bash"
- "/bin/dash"
- "/usr/bin/env"
- "/usr/bin/sh"
- "/usr/bin/bash"
- "/usr/bin/dash"
# Core utilities — each one explicit (no /usr/bin subpath)
- "/bin/cat"
- "/bin/cp"
- "/bin/mv"
- "/bin/rm"
- "/bin/mkdir"
- "/bin/rmdir"
- "/bin/ls"
- "/bin/ln"
- "/bin/chmod"
- "/bin/date"
- "/bin/echo"
- "/bin/dd"
- "/bin/sleep"
- "/usr/bin/cat"
- "/usr/bin/cp"
- "/usr/bin/mv"
- "/usr/bin/rm"
- "/usr/bin/mkdir"
- "/usr/bin/rmdir"
- "/usr/bin/ls"
- "/usr/bin/ln"
- "/usr/bin/chmod"
- "/usr/bin/date"
- "/usr/bin/echo"
- "/usr/bin/basename"
- "/usr/bin/dirname"
- "/usr/bin/head"
- "/usr/bin/tail"
- "/usr/bin/cut"
- "/usr/bin/tr"
- "/usr/bin/sed"
- "/usr/bin/awk"
- "/usr/bin/grep"
- "/usr/bin/sort"
- "/usr/bin/uniq"
- "/usr/bin/wc"
- "/usr/bin/tee"
- "/usr/bin/xargs"
- "/usr/bin/find"
- "/usr/bin/touch"
- "/usr/bin/mktemp"
- "/usr/bin/install"
- "/usr/bin/test"
- "/usr/bin/expr"
- "/usr/bin/printf"
- "/usr/bin/readlink"
- "/usr/bin/uname"
- "/usr/bin/which"
- "/usr/bin/file"
- "/usr/bin/stat"
- "/usr/bin/sleep"
# Archive / compression
- "/usr/bin/tar"
- "/usr/bin/gzip"
- "/usr/bin/gunzip"
- "/usr/bin/bzip2"
- "/usr/bin/bunzip2"
- "/usr/bin/xz"
- "/usr/bin/zstd"
- "/usr/bin/unzip"
- "/usr/bin/zip"
# Build toolchain — each binary explicit
- "/usr/bin/cc"
- "/usr/bin/gcc"
- "/usr/bin/g++"
- "/usr/bin/clang"
- "/usr/bin/clang++"
- "/usr/bin/ld"
- "/usr/bin/ld.gold"
- "/usr/bin/ld.lld"
- "/usr/bin/as"
- "/usr/bin/ar"
- "/usr/bin/ranlib"
- "/usr/bin/strip"
- "/usr/bin/nm"
- "/usr/bin/objdump"
- "/usr/bin/objcopy"
- "/usr/bin/make"
- "/usr/bin/cmake"
- "/usr/bin/pkg-config"
- "/usr/local/bin/cmake"
- "/usr/local/bin/pkg-config"
# GCC launches versioned, architecture-specific helpers such as
# collect2, cc1, and lto-wrapper from these immutable compiler-only
# trees. Keep the grant narrower than /usr/lib or /usr/libexec.
- "/usr/libexec/gcc/"
- "/usr/lib/gcc/"
# Dynamic linker — Landlock EXECUTE is required to start any
# dynamically-linked binary on Linux.
- "/lib64/ld-linux-x86-64.so.2"
- "/lib/ld-linux-x86-64.so.2"
- "/lib/ld-linux-aarch64.so.1"
- "/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1"
# Git (used by cargo, mix deps.get, etc.)
- "/usr/bin/git"
- "/usr/local/bin/git"
profiles:
node:
allowWrite:
- "$PWD/node_modules/"
- "$PWD/package-lock.json"
- "$PWD/yarn.lock"
- "$PWD/pnpm-lock.yaml"
- "$PWD/bun.lock"
- "$PWD/.yarn/"
- "$PWD/.pnp.cjs"
- "$PWD/.pnp.loader.mjs"
- "~/.npm/"
- "~/.cache/yarn/"
- "~/.yarn/"
- "~/.local/share/pnpm/"
- "~/.bun/"
- "~/.cache/bun/"
allowDomains:
- "registry.npmjs.org"
- "registry.yarnpkg.com"
- "registry.npmmirror.com"
- "github.com"
- "codeload.github.com"
- "objects.githubusercontent.com"
allowExec:
- "/usr/local/bin/node"
- "/usr/bin/node"
- "/usr/bin/npm"
- "/usr/bin/npx"
- "/usr/local/bin/npm"
- "/usr/local/bin/npx"
- "/usr/local/bin/yarn"
- "/usr/local/bin/pnpm"
- "/usr/local/bin/bun"
- "~/.nvm/"
- "~/.volta/"
- "~/.fnm/"
- "~/.local/share/fnm/"
- "~/.local/state/fnm_multishells/"
# GitHub Actions setup-node installs versioned toolchains here.
- "/opt/hostedtoolcache/node/"
# mise (polyglot version manager)
- "~/.local/share/mise/"
# asdf shim layout
- "~/.asdf/"
rust:
allowRead:
# The rustup proxy reads its selected toolchain from this non-secret
# settings file before dispatching cargo/rustc. Toolchain contents are
# already read+execute via allowExec below.
- "~/.rustup/settings.toml"
allowWrite:
- "$PWD/target/"
- "$PWD/Cargo.lock"
- "~/.cargo/registry/"
- "~/.cargo/git/"
# NOTE: ~/.cargo/bin/ is NOT writable — prevents trojaning cargo binaries
- "~/.cache/zig/"
allowDomains:
- "crates.io"
- "static.crates.io"
- "index.crates.io"
- "static.rust-lang.org"
- "github.com"
- "codeload.github.com"
- "objects.githubusercontent.com"
allowExec:
- "~/.cargo/bin/"
- "~/.rustup/toolchains/"
python:
allowWrite:
- "$PWD/uv.lock"
- "$PWD/poetry.lock"
- "$PWD/pdm.lock"
- "$PWD/dist/"
- "$PWD/build/"
- "~/.cache/pip/"
- "~/.cache/uv/"
- "~/.local/lib/"
# NOTE: ~/.local/bin/ is NOT writable — prevents trojaning user binaries
- "$PWD/.venv/"
- "$PWD/venv/"
# Poetry cache
- "~/.cache/pypoetry/"
# PDM cache
- "~/.local/share/pdm/"
allowDomains:
- "pypi.org"
- "files.pythonhosted.org"
- "github.com"
- "codeload.github.com"
- "objects.githubusercontent.com"
allowExec:
- "/usr/bin/python3"
- "/usr/local/bin/python3"
- "/usr/bin/pip3"
- "/usr/local/bin/pip3"
- "/usr/local/bin/uv"
- "/usr/bin/uv"
# GitHub Actions setup-python installs versioned interpreters here.
- "/opt/hostedtoolcache/Python/"
# GitHub Actions setup-uv installs versioned binaries here.
- "/opt/hostedtoolcache/uv/"
- "/usr/local/bin/poetry"
- "/usr/local/bin/pdm"
# Version managers
- "~/.pyenv/"
- "~/.local/bin/"
# uv-managed Python installations
- "~/.local/share/uv/"
# Rye-managed Python
- "~/.rye/"
# mise (polyglot version manager)
- "~/.local/share/mise/"
# asdf
- "~/.asdf/"
elixir:
allowWrite:
- "$PWD/deps/"
- "$PWD/_build/"
- "$PWD/mix.lock"
- "~/.hex/"
- "~/.mix/"
- "~/.cache/rebar3/"
allowDomains:
- "hex.pm"
- "repo.hex.pm"
- "builds.hex.pm"
- "cdn.hex.pm"
- "github.com"
- "codeload.github.com"
- "objects.githubusercontent.com"
allowExec:
- "/usr/bin/elixir"
- "/usr/bin/mix"
- "/usr/bin/iex"
- "/usr/bin/erl"
- "/usr/bin/epmd"
- "/usr/local/bin/elixir"
- "/usr/local/bin/mix"
- "/usr/local/bin/iex"
- "/usr/local/bin/erl"
- "/usr/local/bin/epmd"
# erl is a launcher; the versioned ERTS VM and helpers (erlexec,
# inet_gethost, beam.smp) live below this immutable runtime tree.
- "/usr/lib/erlang/"
# Version managers
- "~/.asdf/"
- "~/.kiex/"
- "~/.local/share/mise/"
java:
# SBE injects authenticated JVM proxy properties after allocating the
# per-run proxy port, so Maven/sbt HTTPS stays on the exact proxy route.
enableProxy: true
# Maven keeps `settings.xml` and `settings-security.xml` at the `~/.m2/`
# root, not under `repository/`. Landlock's per-path grant means we have
# to allow read on the parent explicitly — on macOS SBPL this works
# implicitly because reads are allowed-by-default.
allowRead:
- "~/.m2/"
- "~/.sbt/"
- "~/.ivy2/"
- "~/.gradle/"
allowWrite:
- "~/.m2/repository/"
- "$PWD/.gradle/"
- "$PWD/build/"
- "$PWD/target/"
- "$PWD/project/target/"
- "$PWD/project/project/"
# Scala / sbt
# sbt's XDG runtime socket and tool caches are redirected to SBE's
# private per-run directory by the launcher environment.
allowDomains:
- "repo1.maven.org"
- "repo.maven.apache.org"
- "plugins.gradle.org"
- "services.gradle.org"
- "downloads.gradle.org"
- "downloads.gradle-dn.com"
- "jcenter.bintray.com"
- "github.com"
- "codeload.github.com"
- "objects.githubusercontent.com"
# Scala
- "repo.scala-sbt.org"
- "repo1.scala-sbt.org"
- "scala-ci.typesafe.com"
- "downloads.lightbend.com"
allowExec:
- "/usr/bin/java"
- "/usr/bin/javac"
- "/usr/bin/jar"
- "/usr/bin/jshell"
- "/usr/lib/jvm/"
- "/usr/bin/mvn"
- "/usr/share/maven/bin/"
# GitHub Actions setup-java Temurin installations.
- "/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/"
- "~/.sdkman/"
# Gradle wrapper and daemon execs from here
- "~/.gradle/"
# Coursier downloads launchers here
- "~/.cache/coursier/"
# Scala / sbt tools
- "/usr/bin/sbt"
- "/usr/bin/scala"
- "/usr/bin/scalac"
- "/usr/local/bin/sbt"
- "/usr/local/bin/scala"
- "/usr/local/bin/scalac"
- "/usr/share/sbt/"
# GitHub Actions setup-sbt versioned runner distribution.
- "/opt/hostedtoolcache/sbt/"
# Project-local gradlew / mvnw wrapper scripts
- "$PWD/gradlew"
- "$PWD/mvnw"
# Version managers
- "~/.local/share/mise/"
- "~/.asdf/"
- "~/.jenv/"