openai / openai/codex

Support glob patterns in features.network_proxy.unix_sockets

Open
#38,523 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

CLI config enhancement sandbox
Dominant language
Rust
Stars
125k
Forks
19.5k
PR merge metrics
PR metrics pending

Description

Summary

[features.network_proxy].unix_sockets currently accepts a map keyed by absolute paths, but those keys are treated literally. There is no way to allow a bounded family of dynamically named Unix sockets without allowing an entire parent directory or setting dangerously_allow_all_unix_sockets = true.

Current behavior

For example, this does not match /private/tmp/service-123.sock:

[features.network_proxy]
enabled = true
unix_sockets = { "/private/tmp/*.sock" = "allow" }

In the macOS Seatbelt implementation, configured paths are normalized as absolute paths and emitted as subpath rules; no glob matching is performed. See normalization and Unix-socket policy generation.

The current directory-level workaround:

unix_sockets = { "/private/tmp" = "allow" }

also permits every Unix socket under /private/tmp, which is wider than necessary.

Request

Support an explicit, documented glob syntax for unix_sockets, for example:

unix_sockets = { "/private/tmp/*.sock" = "allow" }

The implementation should preserve existing literal absolute-path semantics and fail closed for invalid or ambiguous patterns. The generated Seatbelt policy should remain bounded to the intended matching paths.

Motivation

Developer daemons often create Unix sockets with dynamic filenames. A narrowly scoped glob would avoid choosing between an overly broad directory allowlist and dangerously_allow_all_unix_sockets = true.

Scope

This request is specifically about AF_UNIX configuration. It is not intended as a workaround for daemons that use TCP loopback instead of Unix sockets.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the normalization code in codex-rs/sandboxing/src/seatbelt.rs around lines 2042-2066 and Unix-socket policy generation around lines 2132-2192. Define and document the supported glob syntax while preserving literal absolute paths and rejecting invalid or ambiguous patterns. Done means the generated Seatbelt policy remains bounded to the intended socket paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.