Sandbox each iOS simulator, so a lease cannot reach the worker or another lease
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- ios, typescript
- Lĩnh vực
- infrastructure
Hướng nghiên cứu
Start with the draft pull request linked from the issue; it contains the prototype library, host tool and sandbox profile. Read the simulator driver entry points and trace how simulators are prepared and leased. The issue leaves key decisions and completion conditions open; done means an operator can enable sandboxing, unsafe simulators are refused, and install, XCTest and agent-device sessions work under the sandbox.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Request: none
Problem
A leased iOS simulator is not isolated from the Mac it runs on, or from the other simulators on it. Every process of a simulator runs as the worker's user with no sandbox. Measured on macOS 26.6 with Xcode 27.2 and the iOS 27.2 runtime, an app installed in one simulator could:
- read and change another simulator's app data;
- read and write the worker user's home folder,
~/.sshand the keychain folder included; - connect to any service on the worker's loopback, and to the other simulator's
testmanagerdsocket; - start programs of the Mac itself;
- look up the Mac's own services (pasteboard, WindowServer, the keychain server,
CoreSimulatorService), because CoreSimulator hands every simulator the host's bootstrap port.
The docs say as much today: a device root is an accident boundary, and an agent token is shell access to the worker. So one worker cannot serve two clients who do not trust each other.
No vendor documents isolation at the simulator level. The usual answer is one macOS VM per job, which is capped at two per Mac, or a dedicated Mac.
A prototype shows a simulator can be boxed in. A small library, loaded into the simulator's first process at boot, puts it and every process it starts under a macOS sandbox profile that refuses everything not listed. With it, all the attempts above were refused, while Safari, Settings, an XCTest run and an agent-device session still worked. The prototype's library, host tool and profile are in the draft PR that refers to this issue; nothing in the driver uses them yet.
Who it is for
An operator who runs a worker behind a gateway for clients who do not trust each other: a device farm. An agent that runs on the worker itself already has its own shell there and gains nothing.
Outcome
- The operator turns the sandbox on for a worker.
- From then on every simulator that worker leases runs sandboxed: it reaches its own folders, the iOS runtime, the internet and the loopback ports its lease was given, and nothing else of the worker or of another lease.
- A simulator whose sandbox did not take is never leased.
- Installing and launching an app, an XCTest run and an agent-device session keep working on a sandboxed simulator.
What could go wrong
- A macOS or Xcode update changes one of the private Apple interfaces this rests on. Leases on that worker are then refused until the sandbox is checked again.
- A client's command that names a file outside its lease's folders fails where it worked before, an install from a path on the worker for example.
- An operator reads "sandbox" as a guarantee. Some services of the Mac stay shared between simulators, so this is weaker than a VM.
Words used
- sandbox profile: the text file of rules macOS enforces on a process, here "refuse everything, then allow this list".
- jail library: the library loaded into a simulator's first process that applies the profile before anything else runs.
- host bootstrap port: the handle CoreSimulator gives each simulator, through which a process can ask the Mac's
launchdfor any service of the logged-in user.
Non-goals
- Android. An emulator is a virtual machine already.
- A guarantee as strong as a VM or a dedicated Mac.
- Limits on CPU, memory or disk per simulator.
- Network rules by domain or address: the profile language only tells loopback from everything else, by port.
Completion conditions
- ...
Open questions
- How the operator turns it on, and whether it is per worker or per lease.
- What a client sees when a simulator cannot be sandboxed: the refusal, its code and its event.
- Where a lease's inputs live.
simctl install,addmediaand Xcode's test-runner install read their source inside the simulator, so the source must be in a folder the profile allows. - Loopback ports. A profile cannot change after boot, and a tunnel can be opened later in a lease.
- Passthrough arguments that name a path on the worker (
simctl io screenshot <path>) run outside the sandbox and need their own check. - Pseudo-terminals. XCTest and
simctl launch --console-ptyneed one, and its name is not known before boot, so the prototype allows every terminal of the worker's user. - The 27 services CoreSimulator forwards from the Mac into every simulator (rendering, input, audio, network configuration, file events) stay shared. Nobody has tested them for abuse.
- Which macOS, Xcode and iOS runtime versions are supported, and how a new one is checked. The prototype ran on one combination, on Apple silicon; the Intel build of the library has not run in a simulator.
- agent-device's fast accessibility snapshot stayed off under the sandbox, and its XCTest path was used instead. The cause is not known.
- What the docs may claim once this ships.
Written by an agent.
- Ngôn ngữ chính
- TypeScript
- Star
- 730
- Fork
- 44
- Merge trung bình
- 16 giờ 13 phút
- Pull request đã merge (30 ngày)
- 387
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của callstackincubator/simlock
-
The SIGKILL escalation test passes without escalation when its child starts later than 100 msĐang mởbug:new
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
callstackincubator/simlock#1986 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug:new
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
callstackincubator/simlock#1979 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
process-runner.test.ts fails four tests when a child starts 1 to 3 s lateCó thể đã có người làm @V3RON đã nhận hôm nay. Đang mởbug:new
callstackincubator/simlock#1985 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug:new
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
callstackincubator/simlock#1984 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
iOS runCommand passes timeoutMs to spawn, which ignores it, and its comment relies on that backstopĐang mởbug:new
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
callstackincubator/simlock#1980 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của callstackincubator/simlock
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
audacity/audacity.github.io#118 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
crxjs/chrome-extension-tools#1261 ·
-
Resources: Update work of fuzhouCó thể đã có người làm @rmt-svc đã nhận hôm nay. Đang mởresources
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
railmapgen/rmp-gallery#4245 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
mike-north/AgentMonitors#717 ·
Maintainer thường phản hồi trong vòng 1 ngày