Skip to content

Use router KEK for object encryption#38

Merged
louisgls merged 1 commit intomainfrom
fix/use-router-kek
Apr 22, 2026
Merged

Use router KEK for object encryption#38
louisgls merged 1 commit intomainfrom
fix/use-router-kek

Conversation

@louisgls
Copy link
Copy Markdown
Collaborator

Summary

  • pass the KEK computed by Router.New() into GET/PUT object handlers
  • remove per-request environment lookup for S3PROXY_ENCRYPT_KEY inside handlers
  • keep forwarding paths requiring a concrete S3 client, while allowing object handlers to use the internal S3 client interface
  • add a regression test proving PUT encryption uses the router KEK and cannot be decrypted with a zero KEK

Closes #21.

Validation

  • go test ./...
  • CGO_ENABLED=0 GOOS=linux go build -o /tmp/s3proxy-kek ./s3proxy/cmd

Not run: bazel test //s3proxy/internal/router:router_test because bazel is not installed in this local environment.

@louisgls louisgls marked this pull request as ready for review April 22, 2026 14:38
@louisgls louisgls force-pushed the fix/use-router-kek branch from d90e0ad to a0c0e03 Compare April 22, 2026 14:42
@louisgls louisgls merged commit 22b84ce into main Apr 22, 2026
2 checks passed
@louisgls louisgls deleted the fix/use-router-kek branch April 22, 2026 14:44
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.

Unexpected behavior: is the encryption key being used correctly?

1 participant