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: modules/configuration/pages/secrets.adoc
+47-7Lines changed: 47 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,11 @@
1
1
= Secrets
2
+
description: Methods for adding secrets to your Redpanda configuration without exposing them.
2
3
3
4
This topic outlines how to add secrets to a Redpanda Connect configuration without exposing them.
4
5
5
-
== Using environment variables
6
+
== Store secrets in environment variables
6
7
7
-
One of the most prolific approaches to providing secrets to a service is via environment variables. Redpanda Connect allows you to inject the values of environment variables into a configuration with the interpolation syntax `+${FOO}+`, within a configuration it looks like this:
8
+
A common way to securely pass secrets to a service is to use environment variables. Redpanda Connect allows you to inject the values of environment variables into a configuration with the interpolation syntax `+${SECRET}+`. For example:
8
9
9
10
[source,yml]
10
11
----
@@ -15,14 +16,53 @@ thing:
15
16
[NOTE]
16
17
.Use quotes
17
18
====
18
-
Note that it would be valid to have `+super_secret: ${SECRET}+` above (without the quotes), but if `SECRET` is unset then the configuration becomes structurally different. Therefore, it's always best to wrap environment variable interpolations with quotes so that when the variable is unset you still have a valid configuration (with an empty string).
19
+
It is valid to have `+super_secret: ${SECRET}+` above (without the quotes), but if `SECRET` is unset then the configuration becomes structurally different. Therefore, it's always best to wrap environment variable interpolations within quotes so that when the variable is unset you still have a valid configuration (with an empty string).
19
20
====
20
21
21
-
More information about this syntax can be found on the xref:configuration:interpolation.adoc[interpolation field page].
22
+
For more information about this syntax, see the xref:configuration:interpolation.adoc[interpolation field page].
22
23
23
-
== Using CLI flags
24
+
== Look up secrets on a remote system at runtime
24
25
25
-
As an alternative to environment variables, you can set specific fields within a configuration using the CLI flag `--set`, where the syntax is a `<path>=<value>` pair:
26
+
Starting with version 4.39.0, you can use the `rpk connect` CLI flag `--secrets` to look up secrets values on a remote system at runtime (for example, in your secrets management solution). This means that Redpanda Connect resolves interpolations in your configuration at runtime without setting environment variables.
27
+
28
+
29
+
For example, you could run the following command to retrieve the value for `"$\{SECRET}"`, when the secret is stored on a Redis server.
30
+
31
+
```bash
32
+
33
+
rpk connect run ./config.yaml --secrets redis://secret:[email protected]
34
+
35
+
```
36
+
The command tries to load the secret value from the specified Uniform Resource Name (URN) using the format `scheme://secret:server_address`.
37
+
38
+
You can specify multiple URNs separated by commas, which are tried in turn until a secrets value is successfully returned.
39
+
40
+
=== Supported remote systems
41
+
42
+
You can retrieve secrets from all of the following remote systems.
43
+
44
+
|===
45
+
| Remote system | URN format
46
+
47
+
| AWS
48
+
| `aws://region/prefix` +
49
+
For example: `aws://eu-west-1/redpanda/`
50
+
51
+
| AZURE
52
+
| `az://vault-uri/prefix`. The `vault-uri` value should not contain a `https://` prefix.
You can set specific fields within a configuration using the CLI flag `--set`, where the syntax is a `<path>=<value>` pair:
26
66
27
67
* `<path>`: A placeholder for the xref:configuration:field_paths.adoc[dot-separated path to the field being set].
28
68
* `<value>`: The value you want to set the field to.
@@ -59,7 +99,7 @@ rpk connect run ./config.yaml \
59
99
60
100
Using this method lets you inject the secret into the configuration without leaking it into an environment variable.
61
101
62
-
== Avoiding leaked secrets
102
+
== Avoid leaked secrets
63
103
64
104
There are a few ways in which configurations parsed by Redpanda Connect can be exported back out of the service. In all of these cases Redpanda Connect will attempt to scrub any field values within the config that are known secrets (any field marked as a secret in the docs).
0 commit comments