Skip to content

Commit 143c628

Browse files
fix: remove unprivileged and macos (#78)
* fix: remove unprivileged and macos * ci: remove macos from CI * fix: remove mentioning of unprivileged and macos from docs
1 parent 543f7e6 commit 143c628

File tree

11 files changed

+28
-565
lines changed

11 files changed

+28
-565
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
strategy:
4848
fail-fast: false
4949
matrix:
50-
os: [ubuntu-latest, macos-latest]
50+
os: [ubuntu-latest]
5151
runs-on: ${{ matrix.os }}
5252

5353
steps:

ARCHITECTURE.md

Lines changed: 12 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ This document describes the architecture and components of boundary, a network i
4848
│ │ │ TARGET COMMAND │ │ │
4949
│ │ │ │ │ │
5050
│ │ │ npm install │ ◄── HTTP_PROXY/HTTPS_PROXY env vars │ │
51-
│ │ │ curl https://... │ ◄── Network isolation (Linux/macOS) │ │
51+
│ │ │ curl https://... │ ◄── Network isolation (Linux) │ │
5252
│ │ │ git clone │ ◄── DNS redirection │ │
5353
│ │ │ │ │ │
5454
│ │ └─────────────────────┘ │ │
@@ -61,7 +61,7 @@ This document describes the architecture and components of boundary, a network i
6161
## Component Details
6262

6363
### 1. CLI Layer
64-
**Input**: Command line arguments (`--allow`, `--log-level`, `--unprivileged`, target command)
64+
**Input**: Command line arguments (`--allow`, `--log-level`, target command)
6565
**Output**: Configured boundary instance and executed target command
6666

6767
**Responsibilities**:
@@ -106,57 +106,7 @@ Platform-specific implementations:
106106
└─────────────────────────────────────────────┘
107107
```
108108

109-
#### macOS Jailer
110-
```
111-
┌─────────────────────────────────────────────┐
112-
│ MACOS JAILER │
113-
├─────────────────────────────────────────────┤
114-
│ │
115-
│ PF (Packet Filter) Rules │
116-
│ │ │
117-
│ ├─ Create custom anchor │
118-
│ ├─ REDIRECT HTTP → proxy (127.0.0.1:8080) │
119-
│ ├─ REDIRECT HTTPS → proxy (127.0.0.1:8080) │
120-
│ └─ Apply rules to specific process group │
121-
│ │
122-
│ Process Group Isolation │
123-
│ │ │
124-
│ ├─ Create restricted group │
125-
│ ├─ Set process group ID │
126-
│ └─ Configure environment variables │
127-
│ │
128-
│ Process Execution │
129-
│ │ │
130-
│ ├─ Set HTTP_PROXY env var │
131-
│ ├─ Set HTTPS_PROXY env var │
132-
│ ├─ Set SSL_CERT_FILE (custom CA) │
133-
│ └─ Execute with group restrictions │
134-
│ │
135-
└─────────────────────────────────────────────┘
136-
```
137109

138-
#### Unprivileged Jailer
139-
```
140-
┌─────────────────────────────────────────────┐
141-
│ UNPRIVILEGED JAILER │
142-
├─────────────────────────────────────────────┤
143-
│ │
144-
│ Environment Variables Only │
145-
│ │ │
146-
│ ├─ Set HTTP_PROXY env var │
147-
│ ├─ Set HTTPS_PROXY env var │
148-
│ ├─ Set SSL_CERT_FILE (custom CA) │
149-
│ └─ No network isolation │
150-
│ │
151-
│ Process Execution │
152-
│ │ │
153-
│ ├─ Execute with proxy env vars │
154-
│ └─ Relies on application proxy support │
155-
│ │
156-
│ Note: Less secure but works without sudo │
157-
│ │
158-
└─────────────────────────────────────────────┘
159-
```
160110

161111
### 3. Proxy Server Component
162112
**Input**: HTTP/HTTPS requests from jailed processes
@@ -427,15 +377,15 @@ Platform-specific implementations:
427377

428378
## Platform Differences
429379

430-
| Aspect | Linux | macOS | Unprivileged |
431-
|--------|--------|--------|--------------|
432-
| **Isolation** | Network namespaces | Process groups + PF | Environment variables only |
433-
| **Traffic Interception** | iptables REDIRECT | PF rdr rules | HTTP_PROXY/HTTPS_PROXY |
434-
| **DNS** | Custom resolv.conf | System DNS + PF | System DNS |
435-
| **Privileges** | Requires sudo | Requires sudo | No privileges required |
436-
| **Security** | Strong isolation | Moderate isolation | Weak (app-dependent) |
437-
| **Compatibility** | Linux kernel 3.8+ | macOS with PF | Any platform |
438-
| **Process Control** | Network namespace | Process group | Standard process |
380+
| Aspect | Linux |
381+
|--------|-------|
382+
| **Isolation** | Network namespaces |
383+
| **Traffic Interception** | iptables REDIRECT |
384+
| **DNS** | Custom resolv.conf |
385+
| **Privileges** | Requires network capabilities (e.g., CAP_NET_ADMIN) |
386+
| **Security** | Strong isolation |
387+
| **Compatibility** | Linux kernel 3.8+ |
388+
| **Process Control** | Network namespace |
439389

440390
## Security Model
441391

@@ -445,7 +395,7 @@ Platform-specific implementations:
445395
- Fail-safe behavior: unknown requests are denied
446396

447397
### Network Isolation
448-
- Process cannot bypass boundary (except in unprivileged mode)
398+
- Process cannot bypass boundary
449399
- All traffic routed through proxy server
450400
- TLS interception prevents encrypted bypass
451401

Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ build-all:
2828
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="$(LDFLAGS)" -o $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64 ./cmd/boundary
2929
@echo "Building Linux arm64..."
3030
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -ldflags="$(LDFLAGS)" -o $(BUILD_DIR)/$(BINARY_NAME)-linux-arm64 ./cmd/boundary
31-
@echo "Building macOS amd64..."
32-
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="$(LDFLAGS)" -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-amd64 ./cmd/boundary
33-
@echo "Building macOS arm64..."
34-
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags="$(LDFLAGS)" -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-arm64 ./cmd/boundary
31+
@# macOS builds removed; Linux only
3532
@echo "✓ All binaries built successfully!"
3633
@echo "Binaries are in the '$(BUILD_DIR)' directory:"
3734
@ls -la $(BUILD_DIR)/

README.md

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ boundary creates an isolated network environment for target processes, intercept
66

77
## Features
88

9-
- Process-level network isolation (Linux namespaces, macOS process groups)
9+
- Process-level network isolation (Linux namespaces)
1010
- HTTP/HTTPS interception with transparent proxy and TLS certificate injection
1111
- Wildcard pattern matching for URL patterns
1212
- Request logging and monitoring
13-
- Cross-platform support (Linux and macOS)
13+
- Linux support
1414
- Default deny-all security model
1515

1616
## Installation
@@ -69,42 +69,22 @@ 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

93-
| Platform | Implementation | Sudo Required |
94-
|----------|----------------|---------------|
95-
| Linux | Network namespaces + iptables | Yes |
96-
| macOS | Process groups + PF rules | Yes |
97-
| Windows | Not supported | - |
74+
| Platform | Implementation | Privileges |
75+
|----------|--------------------------------|---------------------------|
76+
| Linux | Network namespaces + iptables | CAP_NET_ADMIN (or root) |
77+
| macOS | Not supported | - |
78+
| Windows | Not supported | - |
9879

9980
## Command-Line Options
10081

10182
```text
10283
boundary [flags] -- command [args...]
10384
104-
--allow <SPEC> Allow rule (repeatable)
105-
--log-level <LEVEL> Set log level (error, warn, info, debug)
106-
--unprivileged Run without network isolation
107-
-h, --help Print help
85+
--allow <SPEC> Allow rule (repeatable)
86+
--log-level <LEVEL> Set log level (error, warn, info, debug)
87+
-h, --help Print help
10888
```
10989

11090
## Development

RELEASES.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ This triggers the **Release** workflow which:
2626
|----------|--------------|-------------|----------|
2727
| Linux | x64 | `boundary-linux-amd64` | `.tar.gz` |
2828
| Linux | ARM64 | `boundary-linux-arm64` | `.tar.gz` |
29-
| macOS | Intel | `boundary-darwin-amd64` | `.tar.gz` |
30-
| macOS | Apple Silicon | `boundary-darwin-arm64` | `.tar.gz` |
29+
3130

3231
## Version Naming
3332

@@ -87,19 +86,7 @@ sudo mv boundary-linux-arm64 /usr/local/bin/boundary
8786
boundary --help
8887
```
8988

90-
**macOS (Intel)**
91-
```bash
92-
curl -fsSL https://github.com/coder/boundary/releases/latest/download/boundary-darwin-amd64.tar.gz | tar -xz
93-
sudo mv boundary-darwin-amd64 /usr/local/bin/boundary
94-
boundary --help
95-
```
9689

97-
**macOS (Apple Silicon)**
98-
```bash
99-
curl -fsSL https://github.com/coder/boundary/releases/latest/download/boundary-darwin-arm64.tar.gz | tar -xz
100-
sudo mv boundary-darwin-arm64 /usr/local/bin/boundary
101-
boundary --help
102-
```
10390

10491
### Verify Installation
10592

cli/cli.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ type Config struct {
2727
AllowStrings []string
2828
LogLevel string
2929
LogDir string
30-
Unprivileged bool
3130
ProxyPort int64
3231
PprofEnabled bool
3332
PprofPort int64
@@ -83,12 +82,6 @@ func BaseCommand() *serpent.Command {
8382
Description: "Set a directory to write logs to rather than stderr.",
8483
Value: serpent.StringOf(&config.LogDir),
8584
},
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-
},
9285
{
9386
Flag: "proxy-port",
9487
Env: "PROXY_PORT",
@@ -211,7 +204,7 @@ func Run(ctx context.Context, config Config, args []string) error {
211204
HomeDir: homeDir,
212205
ConfigDir: configDir,
213206
CACertPath: caCertPath,
214-
}, config.Unprivileged)
207+
})
215208
if err != nil {
216209
return fmt.Errorf("failed to create jailer: %v", err)
217210
}
@@ -334,11 +327,7 @@ func setupLogging(config Config) (*slog.Logger, error) {
334327
}
335328

336329
// 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-
330+
func createJailer(config jail.Config) (jail.Jailer, error) {
342331
// Use the DefaultOS function for platform-specific jail creation
343332
return jail.DefaultOS(config)
344333
}

install.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,8 @@ detect_platform() {
6464
Linux*)
6565
os="linux"
6666
;;
67-
Darwin*)
68-
os="darwin"
69-
;;
7067
*)
71-
log_error "Unsupported operating system: $(uname -s). Only Linux and macOS are supported."
68+
log_error "Unsupported operating system: $(uname -s). Only Linux is supported."
7269
;;
7370
esac
7471

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)