Skip to content

Render page previews inside the container sandbox #46

Closed

Description

@nishide-dev

背景

#26 の container backend(--backend container)では compile だけを container で動かし、page preview(#8)は従来どおり host で動かしている(docs/security.md §4「preview」)。
そのため、sandbox backend でも preview tool(MuPDF / Poppler)の脆弱性と network は in-process 実行と同じ扱いで、docs/security.md §2 の「保証しない」に残っている。#24 の「preview も network 無し」も満たしていない。

engine image(docker/engine/Dockerfile)には preview tool を入れていない(PR #50 のレビューで、使われないうちは攻撃面と AGPL / GPL の配布条件が増えるだけなので、この Issue で入れることにした)。

スコープ

  • engine image に mupdf-tools / poppler-utils を追加する
  • texrun-preview に launcher(texrun_process::Launcher)と path mapping を渡せるようにし、--backend container のときは preview tool を engine image の container で動かす
    • PDF は read-only、preview の出力先だけ書き込み可で mount する
    • preview は 1 回で最大数百回 tool を起動するので、container を 1 つ起動して中で tool を順に動かすか、ページごとに起動するかを、起動のオーバーヘッドを測って決める
    • 上限(RLIMIT_CPU / RLIMIT_AS / cgroup)は §3.10 の preview の値を container に渡す
  • docs/security.md §2・§4 と README の backend の表を更新し、README の「--backend container では --no-preview も併用する」を外す

完了条件

  • --backend container で、preview tool が network 無し・workspace 外が見えない container の中で動く
  • CI の sandbox job で preview の test が container backend でも実行される

関連

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsecurity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions