Skip to content

Commit 2a379ec

Browse files
fix: remove unprivileged and macos
1 parent 543f7e6 commit 2a379ec

File tree

6 files changed

+5
-471
lines changed

6 files changed

+5
-471
lines changed

README.md

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -69,32 +69,13 @@ boundary --log-level debug --allow "domain=github.com" -- git pull # Debug info
6969

7070
**Log Levels:** `error`, `warn` (default), `info`, `debug`
7171

72-
## Unprivileged Mode
73-
74-
When you can't or don't want to run with sudo privileges, use `--unprivileged`:
75-
76-
```bash
77-
# Run without network isolation (uses HTTP_PROXY/HTTPS_PROXY environment variables)
78-
boundary --unprivileged --allow "domain=github.com" -- npm install
79-
80-
# Useful in containers or restricted environments
81-
boundary --unprivileged --allow "domain=*.npmjs.org" --allow "domain=registry.npmjs.org" -- npm install
82-
```
83-
84-
**Unprivileged Mode:**
85-
- No network namespaces or firewall rules
86-
- Works without sudo privileges
87-
- Uses proxy environment variables instead
88-
- Applications must respect HTTP_PROXY/HTTPS_PROXY settings
89-
- Less secure but more compatible
90-
9172
## Platform Support
9273

9374
| Platform | Implementation | Sudo Required |
9475
|----------|----------------|---------------|
95-
| Linux | Network namespaces + iptables | Yes |
96-
| macOS | Process groups + PF rules | Yes |
97-
| Windows | Not supported | - |
76+
| Linux | Network namespaces + iptables | No |
77+
| macOS | Not supported | - |
78+
| Windows | Not supported | - |
9879

9980
## Command-Line Options
10081

cli/cli.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,6 @@ func BaseCommand() *serpent.Command {
8383
Description: "Set a directory to write logs to rather than stderr.",
8484
Value: serpent.StringOf(&config.LogDir),
8585
},
86-
{
87-
Flag: "unprivileged",
88-
Env: "BOUNDARY_UNPRIVILEGED",
89-
Description: "Run in unprivileged mode (no network isolation, uses proxy environment variables).",
90-
Value: serpent.BoolOf(&config.Unprivileged),
91-
},
9286
{
9387
Flag: "proxy-port",
9488
Env: "PROXY_PORT",
@@ -211,7 +205,7 @@ func Run(ctx context.Context, config Config, args []string) error {
211205
HomeDir: homeDir,
212206
ConfigDir: configDir,
213207
CACertPath: caCertPath,
214-
}, config.Unprivileged)
208+
})
215209
if err != nil {
216210
return fmt.Errorf("failed to create jailer: %v", err)
217211
}
@@ -334,11 +328,7 @@ func setupLogging(config Config) (*slog.Logger, error) {
334328
}
335329

336330
// createJailer creates a new jail instance for the current platform
337-
func createJailer(config jail.Config, unprivileged bool) (jail.Jailer, error) {
338-
if unprivileged {
339-
return jail.NewUnprivileged(config)
340-
}
341-
331+
func createJailer(config jail.Config) (jail.Jailer, error) {
342332
// Use the DefaultOS function for platform-specific jail creation
343333
return jail.DefaultOS(config)
344334
}

jail/jail.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ func DefaultOS(config Config) (Jailer, error) {
3030
switch runtime.GOOS {
3131
case "linux":
3232
return NewLinuxJail(config)
33-
case "darwin":
34-
return NewMacOSJail(config)
3533
default:
3634
return nil, fmt.Errorf("unsupported operating system: %s", runtime.GOOS)
3735
}

0 commit comments

Comments
 (0)