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

Đang mở
#9,899 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 10 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
databases, security

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
21.8k
Fork
1.6k
Merge trung bình
11 ngày 7 giờ
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dgraph-io/dgraph

Tất cả issue của dgraph-io/dgraph

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.