Skip to content

Commit 9bd1439

Browse files
authored
Merge branch 'main' into claude/issue-1196-20251222-1314
2 parents 4946b1d + a7f4e9b commit 9bd1439

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

docs/advanced/security_isolation/index.mdx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,11 @@ UNSHARE_ISOLATION_FLAGS="--user --map-root-user --pid --fork --mount-proc"
116116
What each flag does:
117117

118118
- `--user --map-root-user` - Creates user namespace and maps current user to root inside it
119-
- `--pid --fork` - Creates isolated PID namespace
119+
- `--pid --fork` - Creates isolated PID namespace (both flags required together)
120120
- `--mount-proc` - Mounts isolated /proc filesystem (requires privileged mode in Docker)
121121

122+
**Note**: The `--fork` flag is required when using `--pid`. Custom configurations must include `--fork` for PID namespace isolation to work correctly.
123+
122124
#### Custom flags
123125

124126
You can customize the isolation flags:
@@ -137,6 +139,22 @@ UNSHARE_ISOLATION_FLAGS="--pid --fork --mount-proc"
137139

138140
**Recommendation**: Use the default flags with `privileged: true` for best security. Only use truly unprivileged mode if you cannot enable privileged mode and understand the security tradeoffs.
139141

142+
#### Tini for signal handling
143+
144+
When PID namespace isolation is enabled and tini is available, Windmill uses [tini](https://github.com/krallin/tini) as PID 1 inside the namespace. Tini properly handles signal forwarding, which ensures:
145+
146+
- OOM-killed processes return exit code 137 (128 + SIGKILL) instead of ambiguous errors
147+
- Zombie processes are properly reaped
148+
- Signals are correctly forwarded to child processes
149+
150+
Tini is included in the official Windmill Docker images. If tini is not available, Windmill falls back to running without it (with a warning about potentially incorrect OOM exit codes).
151+
152+
You can customize the tini path:
153+
154+
```bash
155+
UNSHARE_TINI_PATH=/custom/path/to/tini
156+
```
157+
140158
### Failure behavior
141159

142160
If `ENABLE_UNSHARE_PID=true` but unshare is unavailable or fails, **the worker will panic at startup** with a detailed error message:

docs/core_concepts/47_environment_variables/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ You can use them in a Script by clicking on "+Context Var":
2727
| ENABLE_UNSHARE_PID | false (true in docker-compose) | Enable PID namespace isolation to protect process memory and environment variables. Linux only. See [Security and Process Isolation](/docs/advanced/security_isolation) | Worker |
2828
| DISABLE_NSJAIL | true | NSJAIL sandboxing status. Default `true` means NSJAIL is **disabled**. Set to `false` to enable NSJAIL (requires `-nsjail` image). See [Security and Process Isolation](/docs/advanced/security_isolation) | Worker |
2929
| UNSHARE_ISOLATION_FLAGS | --user --map-root-user --pid --fork --mount-proc | Customize unshare isolation flags when ENABLE_UNSHARE_PID is true. See [Security and Process Isolation](/docs/advanced/security_isolation) | Worker |
30+
| UNSHARE_TINI_PATH | tini | Path to tini binary for PID 1 signal handling in unshare namespaces. Ensures correct OOM exit codes. See [Security and Process Isolation](/docs/advanced/security_isolation) | Worker |
3031
| LICENSE_KEY (EE only) | None | License key checked at startup for the Enterprise Edition of Windmill | Worker |
3132
| SLACK_SIGNING_SECRET | None | The signing secret of your Slack app. See [Slack documentation](https://api.slack.com/authentication/verifying-requests-from-slack) | Server |
3233
| COOKIE_DOMAIN | None | The domain of the cookie. If not set, the cookie will be set by the browser based on the full origin | Server |

0 commit comments

Comments
 (0)