Skip to content

Commit dcd6a2a

Browse files
fix encrypt and decrypt policy docs
1 parent 2485e8e commit dcd6a2a

File tree

10 files changed

+153
-171
lines changed

10 files changed

+153
-171
lines changed

app/_event_gateway_policies/decrypt/examples/decrypt-a-key.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

app/_event_gateway_policies/decrypt/examples/decrypt-everything.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
title: Decrypt everything using an AWS key vault
2+
3+
description: Decrypt everything using a specific AWS key vault.
4+
5+
extended_description: |
6+
Decrypt everything using a specific AWS key vault.
7+
8+
weight: 900
9+
10+
requirements:
11+
- "A corresponding [Encrypt policy](/event-gateway/policies/encrypt/examples/encrypt-with-aws/). Event Gateway uses the AWS ARN from the Encrypt policy to find the key for the Decrypt policy."
12+
13+
type: decrypt
14+
name: decrypt-using-aws
15+
config:
16+
failure_mode: passthrough
17+
key_sources:
18+
- type: aws
19+
decrypt:
20+
- part_of_record: key
21+
- part_of_record: value
22+
23+
tools:
24+
- konnect-api
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
title: Decrypt using a static key
2+
3+
description: Decrypt everything using a static key.
4+
5+
6+
extended_description: |
7+
Decrypt everything using a static key.
8+
9+
The key must be a secret reference to a 128-bit (16-byte) base64-encoded string, or the key itself as a string.
10+
We recommend using secret references to avoid exposing sensitive data in your configuration.
11+
12+
requirements:
13+
- "A corresponding [Encrypt policy](/event-gateway/policies/encrypt/examples/encrypt-with-static-key/). Event Gateway uses the key ID from the Encrypt policy along with the actual key in the Decrypt policy to successfully decrypt."
14+
weight: 900
15+
16+
variables:
17+
key_id:
18+
description: |
19+
A custom ID for a static key that will be used for encryption.
20+
For example, you can define a key source named `my-key-id`, and reference it as the `decrypt.key.id` for the part of the record you want to encrypt.
21+
value: $KEY_ID
22+
23+
24+
name: decrypt-static-key
25+
type: decrypt
26+
config:
27+
failure_mode: error
28+
key_sources:
29+
- type: static
30+
keys:
31+
- id: ${key_id}
32+
key: "${env['MY_SECRET']}"
33+
decrypt:
34+
- part_of_record: key
35+
key_id: ${key_id}
36+
- part_of_record: value
37+
key_id: ${key_id}
38+
39+
tools:
40+
- konnect-api

app/_event_gateway_policies/decrypt/index.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Use this policy to enforce standards for decryption across {{site.event_gateway}
3434

3535
The Decrypt policy uses AES-128-GCM for decryption, therefore keys must be 128 bits long.
3636

37+
Use this policy together with the [Encrypt policy](/event-gateway/policies/encrypt/), which encrypts portions of a message using the same referenced key.
38+
3739
## Use cases
3840

3941
Common use cases for the Decrypt policy:
@@ -46,11 +48,11 @@ columns:
4648
- title: Description
4749
key: description
4850
rows:
49-
- use_case: "[Decrypt a specific key from a source](/event-gateway/policies/decrypt/examples/decrypt-a-key/)"
50-
description: Decrypt a key based on a specific key reference name.
51+
- use_case: "[Decrypt using a static key](/event-gateway/policies/decrypt/examples/decrypt-with-static-key/)"
52+
description: Decrypt a key or value based on a key reference name.
5153

52-
- use_case: "[Decrypt all keys](/event-gateway/policies/decrypt/examples/decrypt-everything/)"
53-
description: Define an AWS key source and decrypt all keys that come from that source.
54+
- use_case: "[Decrypt using an AWS key source](/event-gateway/policies/decrypt/examples/decrypt-with-aws/)"
55+
description: Decrypt a keys or value using an AWS key source.
5456

5557
{% endtable %}
5658
<!--vale on-->

app/_event_gateway_policies/encrypt/examples/encrypt-a-key.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

app/_event_gateway_policies/encrypt/examples/encrypt-everything.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
title: Encrypt everything using an AWS key vault
2+
3+
description: Encrypt everything in a message using a specific AWS key vault.
4+
5+
requirements:
6+
- "A corresponding [Decrypt policy](/event-gateway/policies/decrypt/examples/decrypt-with-aws/). Event Gateway uses the AWS ARN from the Encrypt policy to find the key for the Decrypt policy."
7+
- "[An AWS KMS key ARN](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/credproviders.html#credproviders-default-credentials-provider-chain)."
8+
weight: 900
9+
10+
type: encrypt
11+
name: encrypt-using-aws
12+
config:
13+
failure_mode: passthrough
14+
key_sources:
15+
- type: aws
16+
encrypt:
17+
- part_of_record: key
18+
key_id: ${key_id}
19+
- part_of_record: value
20+
key_id: ${key_id}
21+
22+
variables:
23+
key_id:
24+
description: |
25+
A KMS key ARN in the following format: `arn:aws:kms:REGION:ACCOUNT_ID:key/KEY_ID`
26+
value: "$AWS_KEY_ID"
27+
28+
tools:
29+
- konnect-api
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
title: Encrypt using a static key
2+
3+
description: Encrypt portions of a message using a list of static keys.
4+
5+
extended_description: |
6+
Encrypt portions of a message using a list of static keys.
7+
8+
The key must be a secret reference to a 128-bit (16-byte) base64-encoded string, or the key itself as a string.
9+
We recommend using secret references to avoid exposing sensitive data in your configuration.
10+
11+
weight: 900
12+
13+
requirements:
14+
- "A corresponding [Decrypt policy](/event-gateway/policies/decrypt/examples/decrypt-with-static-key/). Event Gateway uses the key ID from the Encrypt policy along with the actual key in the Decrypt policy to successfully decrypt."
15+
16+
variables:
17+
key_id1:
18+
description: |
19+
A custom ID for a static key that will be used for encryption.
20+
For example, you can define a key source named `my-key-id1`, and reference it as the `encrypt.key.id` for the part of the record you want to encrypt.
21+
value: $KEY_ID1
22+
key_id2:
23+
description: |
24+
Another custom ID for a static key that will be used for encryption.
25+
For example, you can define a key source named `my-key-id2`, and reference it as the `encrypt.key.id` for the part of the record you want to encrypt.
26+
value: $KEY_ID2
27+
28+
type: encrypt
29+
name: encrypt-static-key
30+
config:
31+
failure_mode: error
32+
encrypt:
33+
- part_of_record: value
34+
key_id: ${key_id1}
35+
- part_of_record: key
36+
key_id: ${key_id2}
37+
key_sources:
38+
- type: static
39+
keys:
40+
- id: ${key_id1}
41+
key: ${env["MY_SECRET"]}
42+
- type: static
43+
keys:
44+
- id: ${key_id2}
45+
key: ${env["MY_SECRET"]}
46+
47+
tools:
48+
- konnect-api

app/_event_gateway_policies/encrypt/index.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Use this policy to enforce standards for encryption across {{site.event_gateway}
3434

3535
The Encrypt policy uses AES-128-GCM for encryption, therefore keys must be 128 bits long.
3636

37+
Use this policy together with the [Decrypt policy](/event-gateway/policies/decrypt/), which decrypts portions of a message using the same referenced key.
38+
3739
## Use cases
3840

3941
Common use cases for the Encrypt policy:
@@ -46,11 +48,11 @@ columns:
4648
- title: Description
4749
key: description
4850
rows:
49-
- use_case: "[Encrypt a specific key from a source](/event-gateway/policies/encrypt/examples/encrypt-a-key/)"
50-
description: Decrypt a key based on a specific key reference name.
51+
- use_case: "[Encrypt portions of a message based on a static key](/event-gateway/policies/encrypt/examples/encrypt-with-static-key/)"
52+
description: Encrypt a specific key or value based on a key reference name.
5153

52-
- use_case: "[Encrypt all keys](/event-gateway/policies/encrypt/examples/encrypt-everything/)"
53-
description: Define an AWS key source and encrypt all keys that come from that source.
54+
- use_case: "[Encrypt a message using an AWS key source](/event-gateway/policies/encrypt/examples/encrypt-with-aws/)"
55+
description: Encrypt all defined keys or values using an AWS key source.
5456

5557
{% endtable %}
5658
<!--vale on-->

0 commit comments

Comments
 (0)