iOS sandbox: installs read the lease's folder through a grant

未关闭
#2,046 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
ios, typescript

调研方向

Read ADR 0103 §7 and the B12 row, then trace passthrough() and folderOf with the provided rg search. Start with the named seams in src/daemon/dispatcher-exec.test.ts:50, the createDriver tests, and e2e/slow-ios-sandbox.test.ts. Done means every B12 case passes and the slow lane confirms lease-folder installs and addmedia work while paths outside that folder are refused.

由索引模型根据 Issue 内容生成。

描述

task:ready

Part of #1648.

Scope

On a sandboxed worker simlock simctl install and addmedia read a file the client uploaded to its lease's folder: the simulator gets read access to that folder, and nothing else of the worker, once per boot.

If it goes wrong, installs from the lease folder fail on a sandboxed worker, or a simulator reads another lease's folder.

Technical spec

Commit b037ae2a0.

Rows
  • Behaviours: B12
  • Interfaces: I11
  • Existing code: X14, X15, X16
Facts

none

Modules touched

daemon (dispatcher-exec.ts), core (driver.ts passthrough context), drivers/ios (passthrough-rules.ts, jail-grants.ts, src/drivers/ios/index.ts:617 where IosSimctlDriver.passthrough passes the root pid, the issue call and the grants writer), e2e/slow-ios-sandbox.test.ts, website (using-devices/copy-files.mdx). Searches: rg "folderOf|passthrough\(" src/daemon src/core src/drivers/ios.

Rules in play
  • ADR 0103 (Accepted — not yet implemented): the sections named on each line below; the feature's rows hold the shapes.
  • ADR 0103 §7: a file-class grant for the lease folder, once per boot, not bound to a pid.
  • ADR 0067: the lease folder and cwd of device.exec stay as they are; the folder is resolved before the command.
  • Documentation rule 9: copy-files.mdx says what a sandboxed worker installs from.
Tests

Seams: src/daemon/dispatcher-exec.test.ts:50; createDriver for the driver side; the slow-lane file for the read.

  • B12: On a sandboxed worker a device.exec of simctl install or addmedia gives the simulator read access to the lease's folder before the command, once per boot of the simulator, a boot known by the root launchd_sim pid X4 records (T2), so a boot simlock did not make (B17) counts as new; the install then reads the file: first install; second install (no second grant); install after a recovery boot (granted again); install after a boot simlock did not make, root pid changed (granted again); addmedia; other verbs (no grant); grant not acknowledged in 2 s (refused, next install tries again); file self-issue of the lease class refused; without the sandbox (no grant)

Done when

  • Every unit case of B12 passes.
  • Slow lane (real simulator): e2e/slow-ios-sandbox.test.ts uploads an .ipa and a photo to the lease folder on a sandboxed worker and simlock simctl install and addmedia succeed; a worker path outside the folder is refused by the sandbox.

Out of scope

agent-device installs from an upload (a known gap).

Depends on

  • #2045 because: jail-grants.ts and the acknowledgement read (I10, I12)
  • #2044 because: src/drivers/ios/passthrough-rules.ts

Written by an agent.

主要语言
TypeScript
星标
730
派生
44
平均合并
15 小时 28 分钟
30 天内合并 PR
387

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

callstackincubator/simlock 的其他 Issue

查看 callstackincubator/simlock 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。