Commit Graph
4 Commits
Author SHA1 Message Date
iceweasel-oai 2a32e7c963 Expand Linux sandbox deny globs in process (#59711)
## What changed

Replace external `rg` scans and the fallback walker with an in-process `ignore` walker for bubblewrap deny-glob expansion. Remove scanner lookup and dependency tracking from sandbox integrity checks.

Include hidden and ignored files, respect scan depth limits, and fail closed on traversal errors. Anchor patterns to their static search roots and preserve literal leading `#`, leading `!`, trailing spaces, and unclosed character classes. Follow explicit symlink roots while skipping child symlinks, and mask canonical targets of matched paths.

## Testing

Extend unit and sandbox integration coverage for glob syntax, depth limits, traversal failures, symlink handling, commands launched from `/`, and operation without executing `rg`.

GitOrigin-RevId: 1767d7f37acb149457642bf24ee5971a28696438
2026-11-05 17:56:59 +00:00
viyatb-oai ac9b5b8380 Ignore ripgrep configuration when expanding sandbox deny globs (#51527)
## Why

User ripgrep configuration can suppress the file list used to construct Linux sandbox deny masks. For example, `--quiet` in `RIPGREP_CONFIG_PATH` can leave files matching deny globs unmasked.

## What changed

Pass `--no-config` to the ripgrep invocation that expands denied-file globs.

## Testing

Extend the multiple-denied-files regression test with a ripgrep configuration containing `--quiet`, checking that denied files remain unreadable and unwritable while allowed files remain accessible. Skip the ripgrep-specific case when no protected `rg` executable is available.

GitOrigin-RevId: 06a6e27e0edec92e79e99af5144b57f86079953f
2026-10-07 00:51:24 +00:00
viyatb-oai ccde2fc8b7 Protect ripgrep lookup during Linux sandbox construction (#51407)
## Why

Deny-read glob expansion runs before sandbox confinement. Resolving `rg` directly from `PATH` could execute a writable workspace binary at that stage.

## What changed

Use the existing protected executable lookup to select a canonical `rg` path under the filesystem policy. Fall back to the native glob walker when no suitable executable is found, preserving masks for matching denied paths.

## Testing

Extend denied-file integration tests to verify that a writable workspace `rg` never runs, a protected `rg` is used when available, and denied files remain blocked with the native fallback.

GitOrigin-RevId: f06674f3535c8a72a4656871762e45fa13c732f2
2026-10-06 16:30:34 +00:00
Yuzhu Shen ae7aad586e Fix Linux sandbox startup with multiple denied files (#50059)
## Why

Bubblewrap consumes and closes the file descriptor for each `--ro-bind-data` mount. Reusing one descriptor across multiple file masks prevents the sandbox from starting.

## What changed

Open and preserve a separate `/dev/null` descriptor for each empty-file mask.

## Testing

Extend unit tests to verify distinct descriptors for multiple denied files and missing-path masks. Add integration coverage for exact-path and glob deny rules, checking that the sandbox starts, denied files remain unreadable and unwritable, and allowed files remain accessible.

GitOrigin-RevId: 85158c83699afd36bb7aca453b2652d777cf65e4
2026-10-01 18:05:33 +00:00