Hacker News· kunalsin9h·· 5 天前AI 评分60
Popcorn 发布 Linux 桌面安全沙箱,用 Firecracker microVM 隔离不可信代码与 Claude Code
Show HN: Popcorn: a security workbench of disposable microVMs
AI 导读
Popcorn 是面向 Linux 的桌面应用,把不可信代码、可疑包和未知二进制放进名为 corn 的 Firecracker microVM 中运行,每个 microVM 有独立 Linux 内核,约一秒启动。
正文 · AI 翻译
一个用于高风险工作的工作台。
每个任务都在一个 corn 中运行:一台无法触及你电脑的小型虚拟机。
它的功能
Popcorn 是一款 Linux 桌面应用。用它来处理不受信任的代码、可疑的软件包和未知的 二进制文件。你和 Claude Code 在 corn 中完成工作。你的文件、密钥和网络都留在外面。
🌽 一个 corn 是一台 Firecracker 微虚拟机,拥有自己的 Linux 内核。它大约在一秒内启动。
- 终端。 在 corn 中打开一个 shell。
- 网络。 每个新主机都会等待你的批准:拒绝、允许一次或始终允许。
- 文件传入。 将文件拖放到窗口上,或选择它们。它们会进入
~/inbox。 - 文件传出。 从
~/outbox导出文件。Popcorn 将它们保存为无法运行的副本。 - 共享文件夹。 corn 会获得一个文件夹的副本。Popcorn 只写回你批准的更改。
它如何保障你的安全
| 保证 | 方式 |
|---|---|
| corn 拥有自己的内核 | 每个 corn 都是一台独立的虚拟机,而不是容器。内核漏洞利用会被困在 corn 内部。 |
| corn 没有网卡 | 它唯一的连接是通往 Popcorn 的私有通道。它没有通往你的网络或互联网的路由。 |
| 你批准每个新主机 | Popcorn 会拦截每个新连接并询问你。如果你在 90 秒内没有回答,Popcorn 会拒绝它。 |
| corn 无法访问你的网络 | Popcorn 会拒绝你电脑或本地网络上的地址(回环、私有、链路本地),即使是你已允许的主机,并且只连接到它检查过的地址。 |
| 你的 Claude 令牌留在外面 | corn 中的 Claude Code 只有一个假令牌。Popcorn 会将你的真实令牌添加到发往 api.anthropic.com 的请求中。 |
| corn 无法看到你的文件 | 你电脑上的任何文件夹都不会连接到 corn。corn 只有自己的 Linux 系统和自己的磁盘。 |
| 只有当你导出时文件才会传出 | corn 无法将文件发送到你的电脑。导出的文件是普通副本。 |
| 你的文件夹只有在你批准时才会更改 | 你会审查每个更改的文件。Popcorn 只写入你批准的文件,并且只写入该文件夹内。 |
| 你的密钥留在外面 | Popcorn 不会共享你的主文件夹,或包含 .ssh、.gnupg、.aws 或 .config 的文件夹。它也会排除 .git 和被忽略的文件。 |
限制
- 虚拟机管理程序逃逸很罕见,但有可能。Firecracker 以你的用户身份运行,没有使用其 jailer。
- 如果你允许某个主机,corn 就可以向该主机发送数据。
- 在 corn 内部,你的账户拥有 root 权限。corn 才是沙箱,而不是账户。
- 保持你的内核和 Firecracker 为最新版本。
架构
flowchart LR
subgraph host["Your computer"]
app["Popcorn app"]
gate["Network gate<br/>ask, allow, refuse<br/>public addresses only"]
proxy["Claude proxy<br/>adds your token"]
token[("Claude token")]
files["Files<br/>inbox, outbox, review"]
end
subgraph corn["Corn: Firecracker microVM"]
shell["Shell and Claude Code"]
disk[("Corn disk<br/>over a read-only image")]
end
shell -- "vsock" --> gate
shell -- "vsock" --> proxy
gate -- "approved hosts" --> internet(("Internet"))
proxy --> anthropic(("api.anthropic.com"))
token -.-> proxy
app <-- "vsock: terminal" --> shell
files <-- "vsock: tar" --> shell
shell --- disk
加载中
一个新连接正在等待你:
sequenceDiagram
participant C as Code in corn
participant G as Network gate
participant Y as You
participant H as Remote host
C->>G: CONNECT example.com:443
alt An address on your network, such as 127.0.0.1
G-->>C: 403 Forbidden, without asking
else A name
G->>Y: Show the yellow band
alt Deny, or no answer in 90 s
G-->>C: 403 Forbidden
else Allow once or always
G->>G: Resolve the name. Keep public addresses only.
alt No public address
G-->>C: 403 Forbidden
else
G->>H: Connect to a checked address
G-->>C: 200 Connection established
end
end
end
加载中
快速开始
Popcorn 在带有 KVM 的 Linux 上运行。阅读 docs/DEV.md 了解系统软件包。
./scripts/fetch-firecracker.sh # Firecracker and a guest kernel, one time ./scripts/build-image.sh # the workbench image, with Docker, one time cargo run --release
然后 Popcorn 会要求三项内容:你的名字、镜像和一个 Claude 令牌(可选)。使用
claude setup-token 获取令牌。
文档
- docs/DEV.md:技术栈、构建、测试和工作流程。
来源:Hacker News · github.com


