Implement optional end-to-end at-rest encryption for the complete local workspace

オープン
#1,162 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
20/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

Read plans/ADRs/048-at-rest-encryption.md and the prototype in src/lib/studio/at-rest-crypto.ts first. Inventory the listed plaintext surfaces and resolve the threat model, key lifecycle, migration, and recovery decisions before implementation. Done means the ADR is accepted, all acceptance criteria are verified, and real-browser migration and recovery tests pass.

索引モデルが issue の本文から書いたものです。

説明

Problem

The canonical corpus is currently stored in plaintext in IndexedDB. Encrypted exports and portable backups do not protect the live browser profile. A tested AES-256-GCM/PBKDF2 prototype exists in src/lib/studio/at-rest-crypto.ts, but it is deliberately not wired into persistence.

ADR 048 correctly keeps this proposed until the complete plaintext surface and recovery lifecycle are addressed.

Scope

Treat this as a product/security design and implementation project, not simply wiring the codec into one store.

Phase 1 — Threat model and product decision
  • Define the threat model and clearly state that at-rest encryption does not protect against XSS or a compromised running browser.
  • Decide optional workspace encryption vs. mandatory encryption.
  • Document passphrase loss consequences and recovery requirements.
  • Inventory every plaintext surface: canonical IndexedDB, Yjs/y-indexeddb replica, recovery snapshots, quarantine copies, attachments, semantic caches, exports and temporary import data.
  • Decide which surfaces are encrypted, excluded with explicit rationale, or disclosed.
Phase 2 — Key lifecycle and UX
  • Unlock/lock UI and session lifecycle.
  • Keep passphrases and derived keys out of persistent browser storage, URLs and logs.
  • Clear in-memory key material and derived sensitive caches on lock as far as browser APIs permit.
  • Prevent writes and hydration when unlock fails.
  • Provide a verified encrypted backup/recovery route and explicit irreversible-loss warning.
Phase 3 — Persistence migration
  • Version the encrypted envelope and authenticate all header fields.
  • Use vetted WebCrypto primitives; retain the tested AES-GCM implementation unless a reviewed design change is approved.
  • Migrate with write → read-back/verify → commit ordering.
  • Never delete plaintext until encrypted data has been verified.
  • Fail closed on wrong keys, tampering, unsupported versions and partial migration.
  • Ensure no plaintext fallback writes occur while encryption is enabled.
Phase 4 — Verification
  • Real-browser shadow/canary tests with representative corpora.
  • Kill-tab/mid-write and quota failure tests.
  • Verify lock/unlock, backup restore, sync, attachments, search and recovery.
  • Inspect all storage surfaces after locking and after migration.

Acceptance criteria

  • ADR 048 is accepted with complete threat model and plaintext-surface inventory before shipping.
  • No passphrase or raw key is persisted or logged.
  • All in-scope corpus surfaces are encrypted or explicitly disclosed/excluded.
  • Wrong password/tampering/version mismatch never falls back to plaintext or overwrites data.
  • Migration is recoverable and verifies ciphertext before deleting plaintext.
  • Encrypted backup restore works on a fresh browser profile.
  • Real-browser corpus fingerprints match before and after migration.
  • Security review and user-facing recovery warning are complete.

References

主要言語
TypeScript
スター
3
フォーク
2
平均マージ
11時間 49分
マージ済み PR(30日)
102

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

d-oit/do-knowledge-studio のほかの issue

d-oit/do-knowledge-studio の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。