Skip to content

Commit c0cdeb0

Browse files
docs: update docs (#93)
* docs: update docs * add comments * remove unnecessary check * docs: update docs
1 parent 1e1ba6c commit c0cdeb0

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,14 @@ boundary-run -- bash
6868
If you prefer to run `boundary` directly, you'll need to handle privilege escalation:
6969
7070
```bash
71+
# Note: sys_admin is only needed in restricted environments (e.g., Docker with seccomp).
72+
# If boundary works without it on your system, you can remove +sys_admin from both flags.
7173
sudo -E env PATH=$PATH setpriv \
7274
--reuid=$(id -u) \
7375
--regid=$(id -g) \
7476
--clear-groups \
75-
--inh-caps=+net_admin \
76-
--ambient-caps=+net_admin \
77+
--inh-caps=+net_admin,+sys_admin \
78+
--ambient-caps=+net_admin,+sys_admin \
7779
boundary --allow "domain=github.com" -- curl https://github.com
7880
```
7981
@@ -134,6 +136,18 @@ boundary-run --log-level debug --allow "domain=github.com" -- git pull # Debug
134136
| macOS | Not supported | - |
135137
| Windows | Not supported | - |
136138
139+
## Security and Privileges
140+
141+
**All processes are expected to run as non-root users** for security best practices:
142+
143+
- **boundary-parent**: The main boundary process that sets up network isolation
144+
- **boundary-child**: The child process created within the network namespace
145+
- **target/agent process**: The command you're running (e.g., `curl`, `npm`, `bash`)
146+
147+
The `boundary-run` wrapper script handles privilege escalation automatically using `setpriv` to drop privileges before launching boundary. This ensures all processes run with the minimum required capabilities (`CAP_NET_ADMIN` and optionally `CAP_SYS_ADMIN` for restricted environments) while executing as your regular user account.
148+
149+
If you run `boundary` directly with `sudo` (without `setpriv`), all processes will run as root, which is **not recommended** for security reasons. Always use `boundary-run` or the equivalent `setpriv` command shown in the [Direct Usage](#direct-usage) section.
150+
137151
## Command-Line Options
138152
139153
```text

scripts/boundary-wrapper.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,9 @@ else
1313
exit 1
1414
fi
1515

16-
# Check if we're already running as the target user (not root)
17-
if [ "$(id -u)" -eq 0 ]; then
18-
echo "Error: This wrapper should not be run as root. It will handle privilege escalation automatically." >&2
19-
exit 1
20-
fi
21-
2216
# Run boundary with proper privilege handling
17+
# Note: sys_admin is only needed in restricted environments (e.g., Docker with seccomp).
18+
# If boundary works without it on your system, you can remove +sys_admin from both flags.
2319
exec sudo -E env PATH="$PATH" setpriv \
2420
--reuid="$(id -u)" \
2521
--regid="$(id -g)" \

0 commit comments

Comments
 (0)