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

Aperta
#9,899 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 10 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Go
Stelle
21.8k
Fork
1.6k
Merge medio
11g 7h
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di dgraph-io/dgraph

Tutte le issue di dgraph-io/dgraph

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.