You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/production-deployment/data-encryption.mdx
+29-45Lines changed: 29 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
id: data-encryption
3
-
title: Codec Server - Temporal Platform feature guide
3
+
title: Codecs and Encryption
4
4
sidebar_label: Codecs and Encryption
5
5
description: Encrypt data in Temporal Server to secure Workflow, Activity, and Worker information. Use custom Payload Codecs for encryption/decryption, set up Codec Servers for remote decoding, and ensure secure access.
Temporal Server stores and persists the data handled in your Workflow Execution.
22
-
Encrypting this data ensures that any sensitive application data is secure when handled by the Temporal Server.
21
+
The Temporal Service persists data from your Workflow Executions, including inputs, outputs, and results. To protect
22
+
sensitive data, use a [Payload Codec](/payload-codec) to encrypt payloads before they reach the Temporal Service. With
23
+
encryption enabled, data exists unencrypted only on the Client and the Worker process, on hosts that you control.
23
24
24
-
For example, if you have sensitive information passed in the following objects that are persisted in the Workflow Execution Event History, use encryption to secure it:
25
+
The following data is persisted in the Event History and can be encrypted:
25
26
26
27
- Inputs and outputs/results in your [Workflow](/workflow-execution), [Activity](/activity-execution), and [Child Workflow](/child-workflows)
@@ -30,51 +31,30 @@ For example, if you have sensitive information passed in the following objects t
30
31
-[Query](/sending-messages#sending-queries) inputs and results
31
32
- Results of [Local Activities](/local-activity) and [Side Effects](/workflow-execution/event#side-effect)
32
33
-[Application errors and failures](/references/failures).
33
-
Failure messages and call stacks are not encoded as codec-capable Payloads by default; you must explicitly enable encoding these common attributes on failures.
34
-
For more details, see [Failure Converter](/failure-converter).
34
+
Failure messages and call stacks are not encoded as codec-capable Payloads by default; you must explicitly enable
35
+
encoding these common attributes on failures. For more details, see [Failure Converter](/failure-converter).
35
36
36
-
Using encryption ensures that your sensitive data exists unencrypted only on the Client and the Worker Process that is executing the Workflows and Activities, on hosts that you control.
37
+
To view encrypted data in the Web UI and CLI, set up a [Codec Server](/codec-server). The following sections cover how
38
+
to set up a Codec Server and configure the Web UI and CLI to use it.
37
39
38
-
By default, your data is serialized to a [Payload](/dataconversion#payload) by a [Data Converter](/dataconversion).
39
-
To encrypt your Payload, configure your custom encryption logic with a [Payload Codec](/payload-codec) and set it with a [custom Data Converter](/default-custom-data-converters#custom-data-converter).
40
+
For encryption implementation examples, see the following samples:
40
41
41
-
A Payload Codec does byte-to-byte conversion to transform your Payload (for example, by implementing compression and/or encryption and decryption) and is an optional step that happens between the Client and the [Payload Converter](/payload-converter):
42
-
43
-
<CaptionedImage
44
-
src="/diagrams/remote-data-encoding.svg"
45
-
title="Remote data encoding architecture" />
46
-
47
-
You can run your Payload Codec with a [Codec Server](/codec-server) and use the Codec Server endpoints in the Web UI and CLI to decode your encrypted Payload locally.
48
-
For details on how to set up a Codec Server, see [Codec Server setup](#codec-server-setup).
49
-
50
-
However, if you plan to set up [remote data encoding](/remote-data-encoding) for your data, ensure that you consider all security implications of running encryption remotely before implementing it.
51
-
52
-
When implementing a custom codec, it is recommended to perform your compression or encryption on the entire input Payload and store the result in the data field of a new Payload with a different encoding metadata field.
53
-
This ensures that the input Payload's metadata is preserved.
54
-
When the encoded Payload is sent to be decoded, you can verify the metadata field before applying the decryption.
55
-
If your Payload is not encoded, it is recommended to pass the unencoded data to the decode function instead of failing the conversion.
Use a Codec Server to programmatically decode your encoded [payloads](/dataconversion#payload).
68
51
69
52
A Codec Server is an HTTP server that uses your custom Codec logic to decode your data remotely.
70
53
The Codec Server is independent of the Temporal Service and decodes your encrypted payloads through predefined endpoints. You create, operate, and manage access to your Codec Server in your own environment.
71
-
The Temporal CLI and the Web UI in turn provide built-in hooks to call the Codec Server to decode encrypted payloads on demand.
72
-
73
-
The Codec Server is independent of the Temporal Server and decodes your encrypted payloads through endpoints.
74
-
When you configure a Codec Server endpoint in the Temporal Web UI or CLI, the Web UI and CLI use the remote endpoint to receive decoded payloads from the Codec Server.
54
+
When you configure a Codec Server endpoint in the Web UI or CLI, the Web UI and CLI use the remote endpoint to send and receive payloads from the Codec Server.
75
55
See [API contract requirements](#api-contract-specifications).
76
56
77
-
Decoded payloads can then be displayed in the Workflow Execution Event History on the Web UI. Note that when you use a Codec Server, the decoded payloads are decoded and returned on the client side only; payloads on the Temporal Server (whether on Temporal Cloud or a self-hosted Temporal Service) remain encrypted.
57
+
Decoded payloads can then be displayed in the Workflow Execution Event History on the Web UI. When you use a Codec Server, the decoded payloads are decoded and returned on the client side only. Payloads on the Temporal Service (whether on Temporal Cloud or self-hosted) remain encrypted.
78
58
79
59
Because you create, operate, and manage access to your Codec Server in your controlled environment, ensure that you consider the following:
80
60
@@ -91,7 +71,13 @@ When you create your Codec Server to handle requests from the Web UI, the follow
91
71
92
72
#### Endpoints
93
73
94
-
The Web UI and CLI send a POST to a `/decode` endpoint. In your Codec Server, create a `/decode` path and pass the incoming payload to the decode method in your Payload Codec.
74
+
The Web UI and CLI send POST requests to the following endpoints on your Codec Server:
75
+
76
+
-`/decode` passes incoming payloads to the decode method in your Payload Codec.
77
+
-`/encode` passes incoming payloads to the encode method in your Payload Codec.
78
+
-`/download` retrieves and decodes payloads from [External Storage](/external-storage). This endpoint is only needed if
79
+
your Workers use External Storage. See [Codec Server with External Storage](/codec-server#external-storage) for
80
+
details.
95
81
96
82
For examples on how to create your Codec Server, see the following Codec Server implementation samples:
97
83
@@ -346,14 +332,12 @@ temporal workflow show \
346
332
--codec-auth 'auth-header'
347
333
```
348
334
349
-
### Working with Large Payloads
350
-
351
-
Codec Servers can be used for more than encryption and decryption of sensitive data.
352
-
Codec Server behavior is left up to implementers -- they can also call external services or perform other tasks, as long as they hook in at the encoding and decoding stages of a Workflow payload.
335
+
### Working with large payloads
353
336
354
-
By default, Temporal limits payload size to 4MB.
355
-
If this limitation is problematic for your use case, you could implement a codec that persists your payloads to an object store outside of workflow histories.
356
-
An example implementation is available from [DataDog](https://github.com/DataDog/temporal-large-payload-codec).
337
+
If your payloads exceed the Temporal Service's size limits, use [External Storage](/external-storage) to offload large
338
+
payloads to an external store like Amazon S3. When External Storage is configured, your Codec Server can also retrieve
339
+
and decode these payloads for viewing in the Web UI and CLI. See
340
+
[Codec Server with External Storage](/codec-server#external-storage) for details.
0 commit comments