callstack / callstack/agent-device

macOS sandbox blocks ps-backed recording process identity

Offen
#2,376 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
TypeScript
Sterne
4.7k
Forks
303
Ø Merge
10 Std. 42 Min.
Gemergte PRs (30 T.)
493

Beschreibung

## Purpose

Allow iOS simulator recording to establish and verify process ownership inside a macOS sandbox that refuses execution of `/bin/ps`.

## Reproduction

Run a synthetic Node child-process identity query under `sandbox-exec -p '(version 1)(allow default)'`. On macOS where `/bin/ps` is setuid, its execution is refused. `readProcessStartTime` and `readProcessCommand` return null, and recording startup can fail with `simctl recordVideo did not expose a complete process identity`.

The shared host-process module currently shells out to ps. A non-privileged native probe using `proc_pidinfo(PROC_PIDTBSDINFO)` and `sysctl(KERN_PROCARGS2)` can read the same owned child under this policy. `PROC_PIDTBSDINFO` needs a nonzero argument to include zombie processes.

## Required behavior

- Keep command/start-time ownership checks and fail closed when identity cannot be proven; do not replace ownership with PID liveness alone.
- Bound native reads and preserve argument boundaries before rendering the existing command string.
- Detect changed start identity, zombie state, permission refusal, and exited processes.
- Package the native implementation without a global installation and keep non-macOS behavior unchanged.

## Completion evidence

Real sandbox tests on synthetic owned children, malformed/bounded parsing tests, and iOS recording start/stop with a nonempty playable artifact. No benchmark transcripts or private run results are needed.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne beim gemeinsamen host-process-Modul und verfolge readProcessStartTime und readProcessCommand bis zum Start von simctl recordVideo. Untersuche unter macOS den bestehenden /bin/ps-Pfad und die erforderliche native Probe, einschließlich begrenztem Parsing und beibehaltener Argumentgrenzen. Als abgeschlossen gilt die Aufgabe, wenn die Tests für Sandbox, fehlerhafte Eingaben, Besitzverhältnisse sowie den Start/Stopp der Aufzeichnung mit einem abspielbaren Artefakt bestehen und das Verhalten außerhalb von macOS unverändert bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
ios, macos, node.js, typescript
Bereich
devtools, mobile, operating-systems
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
52/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.