Skip to content

Commit 5e26a6d

Browse files
buraizuestherk15
andauthored
[DOCS-10999] Update copy for style (#29898)
* [DOCS-10999] Update copy for style * [DOCS-10999] Update anchor links * Apply suggestions from code review Co-authored-by: Esther Kim <esther.kim@datadoghq.com> --------- Co-authored-by: Esther Kim <esther.kim@datadoghq.com>
1 parent daf7a6a commit 5e26a6d

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

content/en/agent/configuration/secrets-management.md

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ algolia:
1313

1414
## Overview
1515

16-
The Datadog Agent allows you to securely manage secrets by integrating with any external secrets management solution (HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, a custom solution...). Instead of hardcoding sensitive values like API keys or passwords in plaintext within configuration files, the Agent can retrieve them dynamically at runtime.
16+
The Datadog Agent allows you to securely manage secrets by integrating with any external secrets management solution (such as HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, or a custom solution). Instead of hardcoding sensitive values like API keys or passwords in plaintext within configuration files, the Agent can retrieve them dynamically at runtime.
1717

1818
### How it works
1919

@@ -27,22 +27,22 @@ instances:
2727
password: "ENC[db_prod_password]"
2828
```
2929

30-
The secret handle must make up the full value of the YAML field and is always resolved as strings. This means configurations like `password: "db-ENC[prod_password]"` are not be recognized as secrets.
30+
The secret handle must make up the full value of the YAML field and is always resolved as strings. This means configurations like `password: "db-ENC[prod_password]"` are not recognized as secrets.
3131

3232
You can use any characters inside the `ENC[]` brackets as long as the YAML is valid. If your secret ID includes special characters or is a JSON string, make sure to properly escape it. For example:
3333
```
3434
"ENC[{\"env\": \"prod\", \"check\": \"postgres\", \"id\": \"user_password\"}]"
3535
```
3636

37-
It's also possible to use [Autodiscovery](/agent/kubernetes/integrations/) variables in secret handles. The Agent resolves these variables before resolving the secret. For example:
37+
It's also possible to use [Autodiscovery][1] variables in secret handles. The Agent resolves these variables before resolving the secret. For example:
3838
```
3939
instances:
4040
- server: %%host%%
4141
user: ENC[db_prod_user_%%host%%]
4242
password: ENC[db_prod_password_%%host%%]
4343
```
4444

45-
However, note that you cannot use the `ENC[]` syntax in `secret_*` settings like `secret_backend_command`.
45+
**Note**: You cannot use the `ENC[]` syntax in `secret_*` settings like `secret_backend_command`.
4646

4747
### Agent security requirements
4848

@@ -64,7 +64,7 @@ On Windows, the executable must:
6464

6565
* Have read/exec for `ddagentuser` (the user used to run the Agent).
6666
* Have no rights for any user or group except for the `Administrators` group, the built-in `Local System` account, or the Agent user context (`ddagentuser` by default)
67-
* Be a valid Win32 application so the Agent can execute it (a PowerShell or Python script would not work for example).
67+
* Be a valid Win32 application so the Agent can execute it (for example, a PowerShell or Python script doesn't work).
6868

6969
{{% /tab %}}
7070
{{< /tabs >}}
@@ -98,11 +98,9 @@ The executable should respond through STDOUT:
9898
}
9999
```
100100

101-
102101
* `value` (string): the secret value to be used in the configurations. This can be `null` in the case of an error.
103102
* `error` (string): an error message or `null`.
104103

105-
106104
If a secret fails to resolve (either by returning a non-zero exit code or a non-null error), the related configuration is ignored by the Agent.
107105

108106
**Never output sensitive information on `stderr`**. If the binary exits with a different status code than `0`, the Agent logs the standard error output of the executable to ease troubleshooting.
@@ -140,7 +138,7 @@ DD_SECRET_BACKEND_COMMAND=/readsecret_multiple_providers.sh
140138
141139
#### Example: Reading from mounted files
142140
143-
Kubernetes supports [exposing Secrets as files](https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/#create-a-pod-that-has-access-to-the-secret-data-through-a-volume) inside a pod that the Agent can read to resolve secrets.
141+
Kubernetes supports [exposing Secrets as files][2] inside a pod that the Agent can read to resolve secrets.
144142
145143
In Kubernetes, you can mount a Secret as a volume like this:
146144
```yaml
@@ -166,9 +164,9 @@ password: ENC[file@/etc/secret-volume/password]
166164
- The Secret must exist in the same namespace as the pod it is being mounted in.
167165
- The script is able to access all subfolders, including the sensitive `/var/run/secrets/kubernetes.io/serviceaccount/token`. As such, Datadog recommends using a dedicated folder instead of `/var/run/secrets`.
168166

169-
[Docker swarm secrets](https://docs.docker.com/engine/swarm/secrets/) are mounted in the `/run/secrets` folder. For example, the Docker secret `db_prod_passsword` is located in `/run/secrets/db_prod_password` in the Agent container. This would be referenced in the configuration with `ENC[file@/run/secrets/db_prod_password]`.
167+
[Docker swarm secrets][3] are mounted in the `/run/secrets` folder. For example, the Docker secret `db_prod_passsword` is located in `/run/secrets/db_prod_password` in the Agent container. This would be referenced in the configuration with `ENC[file@/run/secrets/db_prod_password]`.
170168

171-
**Example: Reading a Kubernetes Secret Across Namespaces**
169+
#### Example: Reading a Kubernetes secret across namespaces
172170

173171
If you want the Agent to read a Secret from a different namespace, use the `k8s_secret@` prefix. For example:
174172
```
@@ -208,7 +206,7 @@ This `Role` gives access to the `Secret: database-secret` in the `Namespace: dat
208206

209207
### Option 2: Using a prebuilt executable
210208

211-
If you're using a standard secrets provider like `AWS Secrets Manager`, `AWS SSM` or other, you can use the prebuilt [datadog-secret-backend](https://github.com/DataDog/datadog-secret-backend) executable.
209+
If you're using a standard secrets provider like `AWS Secrets Manager`, `AWS SSM` or other, you can use the prebuilt [datadog-secret-backend][4] executable.
212210

213211
Here's an example showing how to set it up:
214212

@@ -233,15 +231,13 @@ Here's an example showing how to set it up:
233231
]
234232
}
235233
```
236-
3. Download the binary to your EC2 instance and configure it at /datadog-secret-backend.yaml:
237234

238-
3. Download the latest release of `datadog-secret-backend` on your EC2 instance and create its configuration `datadog-secret-backend.yaml` next to the binary (more information [at this link](https://github.com/DataDog/datadog-secret-backend/blob/main/docs/aws/secrets.md)):
235+
3. Download the latest release of [datadog-secret-backend][5] on your EC2 instance and create its configuration `datadog-secret-backend.yaml` next to the binary. The following example shows a configuration for a backend of type `aws.secrets` under the name `staging-aws`:
239236
```
240237
backends:
241238
staging-aws:
242239
backend_type: aws.secrets
243240
```
244-
We are configuring one backend of type `aws.secrets` under the name `staging-aws`
245241
4. Set the correct access rights for the binary as described in [Agent security requirements](#agent-security-requirements):
246242
```
247243
$> chown dd-agent:dd-agent datadog-secret-backend
@@ -322,7 +318,6 @@ instances:
322318
password: decrypted_db_prod_password
323319
```
324320
325-
326321
## Refreshing API/APP keys at runtime
327322
328323
Starting in Agent version v7.67, you can configure the Agent to refresh its API and APP keys at regular intervals without requiring a restart. This relies on the API key and APP key being pulled as secrets.
@@ -416,7 +411,6 @@ Secrets handle decrypted:
416411
{{% /tab %}}
417412
{{< /tabs >}}
418413

419-
420414
### Seeing configurations after secrets were injected
421415

422416
To quickly see how the check's configurations are resolved, you can use the `configcheck` command:
@@ -443,7 +437,7 @@ password: <obfuscated_password2>
443437
===
444438
```
445439

446-
**Note**: The Agent needs to be [restarted](/agent/configuration/agent-commands/#restart-the-agent) to pick up changes on configuration files.
440+
**Note**: The Agent needs to be [restarted][6] to pick up changes on configuration files.
447441

448442
### Debugging your secret_backend_command
449443

@@ -459,14 +453,12 @@ sudo -u dd-agent bash -c "echo '{\"version\": \"1.0\", \"secrets\": [\"secret1\"
459453

460454
The `dd-agent` user is created when you install the Datadog Agent.
461455

462-
463456
{{% /tab %}}
464457
{{% tab "Windows" %}}
465-
**Windows**
466458

467-
##### Rights related errors
459+
##### Rights-related errors
468460

469-
If you encounter one of the following errors, then something is missing in your setup. See the [Windows instructions](#windows).
461+
The following errors indicate that something is missing in your setup.
470462

471463
1. If any other group or user than needed has rights on the executable, a similar error to the following is logged:
472464
```
@@ -556,7 +548,6 @@ exit code:
556548
{{% /tab %}}
557549
{{< /tabs >}}
558550

559-
560551
### Agent refusing to start
561552

562553
The first thing the Agent does on startup is to load `datadog.yaml` and decrypt any secrets in it. This is done before setting up the logging. This means that on platforms like Windows, errors occurring when loading `datadog.yaml` aren't written in the logs, but on `stderr`. This can occur when the executable given to the Agent for secrets returns an error.
@@ -573,7 +564,7 @@ When reading Secrets directly from Kubernetes you can double check your permissi
573564
kubectl auth can-i get secret/<SECRET_NAME> -n <SECRET_NAMESPACE> --as system:serviceaccount:<AGENT_NAMESPACE>:<AGENT_SERVICE_ACCOUNT>
574565
```
575566

576-
Consider the previous [Kubernetes Secrets example](#read-from-kubernetes-secret-example), where the Secret `Secret:database-secret` exists in the `Namespace: database`, and the Service Account `ServiceAccount:datadog-agent` exists in the `Namespace: default`.
567+
Consider the previous [Kubernetes Secrets example](#example-reading-a-kubernetes-secret-across-namespaces), where the Secret `Secret:database-secret` exists in the `Namespace: database`, and the Service Account `ServiceAccount:datadog-agent` exists in the `Namespace: default`.
577568

578569
In this case, use the following command:
579570

@@ -586,3 +577,10 @@ This command returns whether the permissions are valid for the Agent to view thi
586577
## Further Reading
587578

588579
{{< partial name="whats-next/whats-next.html" >}}
580+
581+
[1]: /agent/kubernetes/integrations/
582+
[2]: https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/#create-a-pod-that-has-access-to-the-secret-data-through-a-volume
583+
[3]: https://docs.docker.com/engine/swarm/secrets/
584+
[4]: https://github.com/DataDog/datadog-secret-backend
585+
[5]: https://github.com/DataDog/datadog-secret-backend/blob/main/docs/aws/secrets.md
586+
[6]: /agent/configuration/agent-commands/#restart-the-agent

0 commit comments

Comments
 (0)