Zero's Raft WAL is not encrypted when the cluster runs with encryption at rest (predicate names in plaintext)

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go

調査の方向性

The unencrypted WAL is opened in dgraph/cmd/zero/run.go around line 317 with raftwal.Init, while worker/server_state.go uses raftwal.InitEncrypted for alphas. Reproduce with the steps in the issue and check whether zw/ contains the predicate name. Done means either Zero accepts --encryption and uses the encrypted WAL, or the encryption-at-rest docs state that Zero data is not encrypted. The maintainers still need to choose between these, so confirm the direction before writing code.

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

説明

Summary

With --encryption key-file=... on every alpha, the alphas' postings (p/) and Raft WAL (w/) are encrypted.
Zero has no --encryption flag and opens its WAL with raftwal.Init (unencrypted), dgraph/cmd/zero/run.go
line 317 on main at e95fc2652. Zero's WAL holds the tablet map, so every predicate name of the schema is on
Zero's disk in plaintext. Predicate values are not (Zero does not receive them).

Predicate names can be confidential (they describe what a customer stores). The encryption-at-rest documentation
(https://docs.dgraph.io/installation/configuration/encryption-at-rest) says the feature "encrypts data stored on
disk" and does not say Zero is excluded.

Steps to reproduce

openssl rand 32 > enc_key
dgraph zero --my=localhost:5080 --wal zw &
dgraph alpha --my=localhost:7080 --zero=localhost:5080 --encryption "key-file=enc_key;" &
curl -s localhost:8080/alter -d 'zebraprobepredicate: string .'
curl -s -H 'Content-Type: application/json' 'localhost:8080/mutate?commitNow=true' \
  -d '{"set":[{"zebraprobepredicate":"valueprobe123"}]}'
# stop both, then:
grep -r -a -l zebraprobepredicate p w zw   # -> zw/00001.wal only
grep -r -a -l valueprobe123 p w zw         # -> nothing

What was observed: on v25.5.0 plus fork changes that do not touch Zero or raftwal, with the predicate created
through the fork's schema loader rather than the /alter shown above, and a value written through /mutate:
with encryption on, the predicate name was found only in Zero's zw/00001.wal and the value nowhere; without
encryption both were also in the alpha's p/*.sst and w/*.wal. The steps above are the same sequence with plain
Dgraph calls; they were not run in exactly this form.

Expected

Either Zero accepts --encryption (and --vault) and opens its WAL with raftwal.InitEncrypted, as the alpha does
in worker/server_state.go, or the documentation states that Zero's data, including predicate names, is not
encrypted and should be protected by volume encryption.

主要言語
Go
スター
21.8k
フォーク
1.6k
平均マージ
11日 7時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

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

dgraph-io/dgraph のほかの issue

dgraph-io/dgraph の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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