rfc/encryption.md describes encryption config the proxy doesn't read

Aperta Adatta ai principianti
#329 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
71/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
documentation

Direzione di ricerca

Leggi la soluzione proposta nell’issue e confronta le indicazioni rivolte agli operatori con la configurazione e gli esempi attuali, in particolare internal/config/encryption.go, examples/kms/config.yaml e le sezioni pertinenti di rfc/encryption.md. Documenta la rotazione delle KEK al di fuori di rfc/, inclusi i nomi di configurazione e il comportamento al riavvio descritti qui. Il lavoro è completato quando gli operatori dispongono di una procedura di rotazione chiara e coerente con il comportamento del proxy.

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

Descrizione

Following the KEK rotation steps in rfc/encryption.md makes older payloads unreadable, and nothing fails at startup to warn you.

The RFC says to keep the old KEK under decryptOnlyURIs:

https://github.com/temporalio/temporal-proxy/blob/d34391cc5982b23f8989acb5bacef2fe1aed3f51/rfc/encryption.md#L258-L264

The proxy reads decryptURIs, and its config loader ignores keys it doesn't recognize:

https://github.com/temporalio/temporal-proxy/blob/d34391cc5982b23f8989acb5bacef2fe1aed3f51/internal/config/encryption.go#L63-L68

So the proxy starts normally with the RFC's config, but the old KEK is never registered. Every payload sealed under it then fails to open with unknown key. Renaming the key to decryptURIs fixes it.

The RFC is a historical record, so it stays as written. The rest of this issue lists the other places its config has drifted from the proxy, all checked at d34391c.

Extension server keys

The RFC configures them with an externalServers map and an endpoint on the policy:

https://github.com/temporalio/temporal-proxy/blob/d34391cc5982b23f8989acb5bacef2fe1aed3f51/rfc/encryption.md#L358-L368

The proxy uses an extensionServers list and an extension://<server>/<key> URI. The RFC's spelling is silently ignored here too.

https://github.com/temporalio/temporal-proxy/blob/d34391cc5982b23f8989acb5bacef2fe1aed3f51/examples/kms/config.yaml#L33-L35

https://github.com/temporalio/temporal-proxy/blob/d34391cc5982b23f8989acb5bacef2fe1aed3f51/examples/kms/config.yaml#L73-L74

Decrypt-only mode

The RFC says default is optional when encryption is disabled:

https://github.com/temporalio/temporal-proxy/blob/d34391cc5982b23f8989acb5bacef2fe1aed3f51/rfc/encryption.md#L431-L434

Without default, the proxy builds no vault, so sealed payloads pass through unopened:

https://github.com/temporalio/temporal-proxy/blob/d34391cc5982b23f8989acb5bacef2fe1aed3f51/internal/kms/fx.go#L50-L52

Required uri and duration

The RFC marks duration optional. It also says a policy with no uri is skipped, so an override can fall back to default.

https://github.com/temporalio/temporal-proxy/blob/d34391cc5982b23f8989acb5bacef2fe1aed3f51/rfc/encryption.md#L463-L464

The proxy rejects any policy, including an override, that is missing either one:

https://github.com/temporalio/temporal-proxy/blob/d34391cc5982b23f8989acb5bacef2fe1aed3f51/internal/config/encryption.go#L183-L185

Negative cacheSize

The RFC says any value of 0 or less disables the DEK cache:

https://github.com/temporalio/temporal-proxy/blob/d34391cc5982b23f8989acb5bacef2fe1aed3f51/rfc/encryption.md#L427-L429

The proxy accepts 0 but rejects negative values:

https://github.com/temporalio/temporal-proxy/blob/d34391cc5982b23f8989acb5bacef2fe1aed3f51/internal/config/encryption.go#L92

Missing namespaceBinding

The RFC's field reference example omits it. The proxy requires it whenever keys are configured, so the example doesn't load:

https://github.com/temporalio/temporal-proxy/blob/d34391cc5982b23f8989acb5bacef2fe1aed3f51/internal/config/encryption.go#L101-L103

Reusing a key

The RFC doesn't mention it. The proxy fails at startup if the same key appears in more than one place:

https://github.com/temporalio/temporal-proxy/blob/d34391cc5982b23f8989acb5bacef2fe1aed3f51/pkg/crypto/kek.go#L78-L81

Extension server proto

The RFC's sketch calls the service KMSService and passes the Namespace on decrypt:

https://github.com/temporalio/temporal-proxy/blob/d34391cc5982b23f8989acb5bacef2fe1aed3f51/rfc/encryption.md#L344-L347

The real service is EncryptionService, and decrypt takes only the ciphertext:

https://github.com/temporalio/temporal-proxy/blob/d34391cc5982b23f8989acb5bacef2fe1aed3f51/api/kms/v1/decrypt.proto#L9-L13

Reload

The RFC says new keys apply on reload. The proxy reads its config only at startup, so they apply on restart.

Suggested fix

Document KEK rotation outside rfc/, where operators will look.

Lingua principale
Go
Stelle
32
Fork
14
Merge medio
1g 10h
PR unite (30g)
62

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 temporalio/temporal-proxy

Tutte le issue di temporalio/temporal-proxy

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.