Skip to main content
This page covers securing communication between Restate and your service deployments. For securing the Restate Server itself (network ports, admin access, header handling), see Server Security.

Locking down service access

Only Restate needs to be able to make requests to your services. The Restate Server will proxy all requests for these services. Therefore, it is advisable to ensure that only Restate can reach your service. Unrestricted access to the services is dangerous. If you’re working with multiple Restate instances, you also may want to check that requests are coming from the right instance. To make this easier, Restate has a native request identity feature which can be used in the SDK to cryptographically verify that requests have come from a particular Restate instance.
1

Create a request identity key

Restate Cloud and BYOC environments create and manage the request identity key for you.Copy the environment’s public key from Developers > Security > HTTP endpoints in the Restate Cloud UI.
2

Validate requests with the public key

Configure your service to use that public key to validate requests. The SDK then rejects discovery and invocation requests that were not signed by the corresponding Restate environment.For a long running service, configure request identity validation on the SDK endpoint:
For a TypeScript serverless platform handler, provide the public key to restate.createEndpointHandler instead:
The public key is not secret, so you can include it in your service source code or configuration.

Private services

When registering an endpoint, every service is by default reachable via HTTP requests to the ingress. You can configure a service as private, via the service configuration. Note that private services can still be invoked by other handlers via the SDK.

Client-side journal encryption

The TypeScript SDK has experimental support for client-side journal value encryption. It lets the SDK encrypt selected values after serializing them but before sending them to Restate. The codec is applied to:
  • Handler inputs and successful outputs
  • Successful ctx.run results
  • Service call and send parameters, and successful call results
  • State values
  • Successful awakeable, signal, and workflow promise values
  • Successful ctx.attach results
The codec does not encrypt journal metadata or other fields such as service and handler names, state keys, headers, or failure messages. How to enable encryption? Implement the JournalValueCodec interface:
Then provide the codec to the SDK when serving your services. For example for AWS KMS:
Have a look at a reference implementation that uses AWS KMS to manage encryption keys:
restatedev/journal-encryption
Loading repository data...
Currently, this feature is only available in the TypeScript SDK. Contact us on Discord or Slack to request this feature for other SDKs.