Skip to content

docs: record that vendor keys and long-lived credentials cross the Go host - #1563

Closed
freshtonic wants to merge 2 commits into
james/kms-router-one-vendorfrom
james/kms-host-boundary-record
Closed

freshtonic wants to merge 2 commits into
james/kms-router-one-vendorfrom
james/kms-host-boundary-record

Conversation

@freshtonic

Copy link
Copy Markdown
Contributor

Summary

Docs only. A review found that two security claims about the Go SDK were not true when a key vendor backend is used, and this PR records them honestly.

In the Go SDK, the encryption runs inside a WebAssembly guest. The Go program around it is the host, which sends the guest's HTTP requests. ZeroKMS responses are safe for the host to see, because a response alone gives no usable key. A key vendor backend (AWS KMS, Google Cloud KMS, Azure Key Vault, Vault Transit) is different. The host does the TLS, so the host, and any WithTransport RoundTripper, see the unwrapped vendor key in plaintext. Also, the credentials that cross to the guest are not always short-lived.

The design stays as it is. Keeping vendor keys from the host would need TLS inside the guest, which is not planned.

Changes

  • ADR-0011: amended with both corrections. The rejected option no longer claims a property the chosen design does not have.
  • Go docs: doc.go (Transport and auth, key vendor backends), KeyVendor, WithTransport (trust the RoundTripper with key material), AWSCredentialsFromEnv (long-lived IAM keys cross on each request; prefer a role), StaticKey (the key crosses once).
  • transport.go: the comment said the response carries "wrapped key material". For a vendor it is an unwrapped key.
  • guest/src/host.rs: says what the host sees, and what credentials cross.
  • Decision log: a new "Review after CIP-5313" section records the findings, and lists in one place the work that no ticket asked for: the @cipherstash/auth napi exports, the Go client with no ZeroKMS, the rewrap fix, the extra stash keyset flags and variable names, Azure workload identity, and the rule that a local record name wins.

Verification

Related

Refs #1562. Review findings on the key vendor backend stack.

@freshtonic
freshtonic added this pull request to stack #1523 November 6, 2026 11:33
@changeset-bot

changeset-bot Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e67e9d7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

@freshtonic
freshtonic force-pushed the james/kms-host-boundary-record branch from c9a9918 to c686e38 Compare November 9, 2026 04:16
@freshtonic
freshtonic removed this pull request from stack #1523 November 9, 2026 04:17
@freshtonic
freshtonic added this pull request to stack #1579 November 9, 2026 04:17
… host

ADR-0011 said key material never crosses to the Go host, and that only
short-lived credentials cross to the guest. Neither is true for a key
vendor backend.

The guest sends each vendor request through transport_send, and the host
does the TLS. So the host and a WithTransport RoundTripper see the
unwrapped vendor key in plaintext: a root key under derived data keys, a
data key under wrapped data keys. With ZeroKMS a response alone is not
usable, so the claim held there. The credential import carries what the Go
source returns, so AWSCredentialsFromEnv can pass an IAM user's long-lived
keys, and StaticKey's key crosses once.

Keep the design and say so. Amend ADR-0011. Correct the Go package docs,
KeyVendor, WithTransport, AWSCredentialsFromEnv, StaticKey, the transport.go
comment and guest/src/host.rs. Add a review section to the decision log
that records these findings and the work that no ticket asked for.
@freshtonic
freshtonic force-pushed the james/kms-router-one-vendor branch from 4c88fcb to ee8d9d6 Compare November 10, 2026 02:37
@freshtonic
freshtonic force-pushed the james/kms-host-boundary-record branch from c686e38 to e67e9d7 Compare November 10, 2026 02:37
@freshtonic
freshtonic removed this pull request from stack #1579 November 12, 2026 03:45
@freshtonic

Copy link
Copy Markdown
Contributor Author

Folded into #1521 (ADR-0011's amendment on what crosses the Go host) and #1532 (the Go docs).

The plan is docs/plans/2026-11-12-key-vendor-backends-scope-reduction.md, and the decision log (docs/plans/2026-11-05-key-vendor-backends-decisions.md, "Scope reduction") records what changed. The old branch tip is kept locally as refs/backup/2026-11-12/<branch>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant