Skip to content

Commit 3848321

Browse files
Ingest New Documentation (#2819)
Co-authored-by: netdatabot <43409846+netdatabot@users.noreply.github.com>
1 parent 40ae5cc commit 3848321

5 files changed

Lines changed: 197 additions & 77 deletions

File tree

docs/Collecting Metrics/Secret Stores/AWS Secrets Manager.mdx

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ Kind: aws-sm
2525

2626
## Overview
2727

28-
Use AWS Secrets Manager as a secretstore backend when you want Netdata collectors to read secrets from AWS at runtime instead of storing them in plain text in collector configuration files.
28+
Netdata can pull collector credentials directly from AWS Secrets Manager at runtime, so you never store passwords or tokens in plain-text configuration files.
2929

30-
This page covers AWS Secrets Manager specific setup. For the shared resolver workflow and syntax, see [Secrets Management](/docs/collecting-metrics/secrets-management).
30+
This page covers AWS Secrets Manager specific setup. For the full resolver overview and syntax reference, including simpler alternatives like `${env:...}`, `${file:...}`, and `${cmd:...}`, see [Secrets Management](/docs/collecting-metrics/secrets-management).
3131

3232

3333
### Limitations
@@ -59,7 +59,7 @@ For production on AWS, prefer `ecs` or `imds` over `env` so credentials are supp
5959

6060
#### Allow access to Secrets Manager
6161

62-
The AWS identity used by this secretstore must be allowed to read the secrets you reference in collector configs in the configured `region`.
62+
The AWS identity used by this secretstore must have the `secretsmanager:GetSecretValue` permission on the secrets you reference in collector configs. Scope the IAM policy to only the secret ARNs Netdata needs.
6363

6464

6565
#### Plan for file-based changes
@@ -81,7 +81,7 @@ The following options can be defined for this secretstore backend.
8181
| Option | Description | Default | Required |
8282
|:-----|:------------|:--------|:---------:|
8383
| [auth_mode](#option-auth-mode) | How Netdata obtains AWS credentials. | env | yes |
84-
| region | AWS region used for Secrets Manager requests. | | yes |
84+
| region | AWS region used for Secrets Manager requests. There is no automatic region detection — you must always set this explicitly. | | yes |
8585

8686
<a id="option-auth-mode"></a>
8787
##### auth_mode
@@ -154,13 +154,13 @@ jobs:
154154

155155
## Use in collector configs
156156

157-
Reference AWS Secrets Manager secrets from collector configs with the `aws-sm` secretstore kind.
157+
Use the `${store:aws-sm:...}` syntax to reference AWS Secrets Manager secrets in any string field of a collector configuration file.
158158

159159

160160
The operand is `secret-name` or `secret-name#key`.
161161

162-
- Use `secret-name` to return the whole `SecretString`.
163-
- Use `secret-name#key` to read one top-level field from a JSON `SecretString`.
162+
- Use `secret-name` to return the whole `SecretString`, for example: `${store:aws-sm:aws_prod:netdata/mysql/password}`.
163+
- Use `secret-name#key` to read one top-level field from a JSON `SecretString`, for example: `${store:aws-sm:aws_prod:netdata/mysql#password}`.
164164
- If you use `#key`, Netdata parses the secret value as JSON. Secret resolution fails if the value is not valid JSON or if the key does not exist.
165165
- Nested paths such as `parent.child` are not interpreted as nested JSON lookups.
166166

@@ -174,28 +174,37 @@ ${store:aws-sm:<store-name>:<secret-name[#key]>}
174174
- `<secret-name[#key]>`: The AWS Secrets Manager secret name, optionally followed by `#key` to read one field from a JSON `SecretString`.
175175

176176
### Examples
177-
#### Whole secret value
177+
#### MySQL collector with password from AWS Secrets Manager
178178

179-
Return the full `SecretString` stored under the `netdata/mysql/password` secret.
179+
This example configures a MySQL collector job in `/etc/netdata/go.d/mysql.conf`.
180+
The password in the DSN connection string is not stored in plain text. Instead,
181+
`${store:aws-sm:aws_prod:netdata/mysql#password}` tells Netdata to fetch the secret
182+
named `netdata/mysql` from the `aws_prod` store, extract the `password` field from
183+
its JSON value, and substitute it into the DSN at runtime.
180184

181-
```text
182-
${store:aws-sm:aws_prod:netdata/mysql/password}
183-
```
184-
#### JSON field from SecretString
185185

186-
Read the `password` field from a JSON `SecretString`.
186+
```yaml
187+
# /etc/netdata/go.d/mysql.conf
188+
jobs:
189+
- name: mysql_prod
190+
dsn: "netdata:${store:aws-sm:aws_prod:netdata/mysql#password}@tcp(127.0.0.1:3306)/"
187191

188-
```text
189-
${store:aws-sm:aws_prod:netdata/mysql#password}
190192
```
191-
#### Collector config example
193+
#### Elasticsearch collector with HTTP basic auth
194+
195+
This example configures an Elasticsearch collector job in `/etc/netdata/go.d/elasticsearch.conf`.
196+
The `password` field uses a secret reference instead of a plain-text password. Netdata fetches
197+
the secret named `netdata/elasticsearch/password` from the `aws_prod` store and substitutes
198+
its full value into the `password` field at runtime.
192199

193-
Use an AWS-stored password in a collector DSN.
194200

195201
```yaml
202+
# /etc/netdata/go.d/elasticsearch.conf
196203
jobs:
197-
- name: mysql_prod
198-
dsn: "netdata:${store:aws-sm:aws_prod:netdata/mysql#password}@tcp(127.0.0.1:3306)/"
204+
- name: es_prod
205+
url: https://elasticsearch.example.com:9200
206+
username: netdata
207+
password: "${store:aws-sm:aws_prod:netdata/elasticsearch/password}"
199208

200209
```
201210

docs/Collecting Metrics/Secret Stores/Azure Key Vault.mdx

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ Kind: azure-kv
2525

2626
## Overview
2727

28-
Use Azure Key Vault as a secretstore backend when you want Netdata collectors to read secrets from Azure at runtime instead of storing them in plain text in collector configuration files.
28+
Netdata can pull collector credentials directly from Azure Key Vault at runtime, so you never store passwords or tokens in plain-text configuration files.
2929

30-
This page covers Azure Key Vault specific setup. For the shared resolver workflow and syntax, see [Secrets Management](/docs/collecting-metrics/secrets-management).
30+
This page covers Azure Key Vault specific setup. For the full resolver overview and syntax reference, including simpler alternatives like `${env:...}`, `${file:...}`, and `${cmd:...}`, see [Secrets Management](/docs/collecting-metrics/secrets-management).
3131

3232

3333
### Limitations
@@ -59,7 +59,7 @@ Prefer `managed_identity` for production on Azure when Netdata runs on an Azure
5959

6060
#### Allow secret read access
6161

62-
The Azure identity used by this secretstore must be allowed to read secret values from the target vaults.
62+
The Azure identity used by this secretstore must be allowed to read secret values from the target vaults. Assign the `Key Vault Secrets User` built-in role scoped to the vault. Do not use broader roles like `Key Vault Administrator`.
6363

6464

6565
#### Plan for file-based changes
@@ -133,6 +133,20 @@ jobs:
133133
client_id: 00000000-0000-0000-0000-000000000000
134134
client_secret: your-client-secret
135135

136+
```
137+
###### Service principal with credentials from environment
138+
139+
Use `${env:...}` resolvers for sensitive fields to avoid storing the client secret in plain text in the secretstore config file.
140+
141+
```yaml
142+
jobs:
143+
- name: azure_prod
144+
mode: service_principal
145+
mode_service_principal:
146+
tenant_id: "${env:AZURE_TENANT_ID}"
147+
client_id: "${env:AZURE_CLIENT_ID}"
148+
client_secret: "${env:AZURE_CLIENT_SECRET}"
149+
136150
```
137151
###### Managed identity
138152

@@ -160,10 +174,10 @@ jobs:
160174

161175
## Use in collector configs
162176

163-
Reference Azure Key Vault secrets from collector configs with the `azure-kv` secretstore kind.
177+
Use the `${store:azure-kv:...}` syntax to reference Azure Key Vault secrets in any string field of a collector configuration file.
164178

165179

166-
The operand is `vault-name/secret-name`.
180+
The operand is `vault-name/secret-name`, for example: `${store:azure-kv:azure_prod:my-keyvault/mysql-password}`.
167181

168182
Netdata requests the latest secret value from `https://<vault-name>.vault.azure.net/secrets/<secret-name>?api-version=7.4`.
169183
Both `vault-name` and `secret-name` must use only letters, numbers, and hyphens.
@@ -178,23 +192,37 @@ ${store:azure-kv:<store-name>:<vault-name/secret-name>}
178192
- `<vault-name/secret-name>`: The Azure Key Vault name and the secret name, separated by `/`.
179193

180194
### Examples
181-
#### Secret reference
195+
#### MySQL collector with password from Azure Key Vault
182196

183-
Read the latest value of the `mysql-password` secret from the `my-keyvault` vault.
197+
This example configures a MySQL collector job in `/etc/netdata/go.d/mysql.conf`.
198+
The password in the DSN connection string is not stored in plain text. Instead,
199+
`${store:azure-kv:azure_prod:my-keyvault/mysql-password}` tells Netdata to fetch
200+
the secret named `mysql-password` from the `my-keyvault` vault using the `azure_prod`
201+
store, and substitute its value into the DSN at runtime.
184202

185-
```text
186-
${store:azure-kv:azure_prod:my-keyvault/mysql-password}
187-
```
188-
#### Collector config example
189-
190-
Use an Azure Key Vault secret in a collector DSN.
191203

192204
```yaml
205+
# /etc/netdata/go.d/mysql.conf
193206
jobs:
194207
- name: mysql_prod
195208
dsn: "netdata:${store:azure-kv:azure_prod:my-keyvault/mysql-password}@tcp(127.0.0.1:3306)/"
196209

197210
```
211+
#### PostgreSQL collector with password from Azure Key Vault
212+
213+
This example configures a PostgreSQL collector job in `/etc/netdata/go.d/postgres.conf`.
214+
The `password` field uses a secret reference instead of a plain-text value. Netdata fetches
215+
the secret named `postgres-password` from the `my-keyvault` vault and substitutes its value
216+
into the `password` field at runtime.
217+
218+
219+
```yaml
220+
# /etc/netdata/go.d/postgres.conf
221+
jobs:
222+
- name: postgres_prod
223+
dsn: "postgresql://netdata:${store:azure-kv:azure_prod:my-keyvault/postgres-password}@localhost:5432/postgres"
224+
225+
```
198226

199227

200228
## Troubleshooting

docs/Collecting Metrics/Secret Stores/Google Secret Manager.mdx

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ Kind: gcp-sm
2525

2626
## Overview
2727

28-
Use Google Secret Manager as a secretstore backend when you want Netdata collectors to read secrets from GCP at runtime instead of storing them in plain text in collector configuration files.
28+
Netdata can pull collector credentials directly from Google Secret Manager at runtime, so you never store passwords or tokens in plain-text configuration files.
2929

30-
This page covers Google Secret Manager specific setup. For the shared resolver workflow and syntax, see [Secrets Management](/docs/collecting-metrics/secrets-management).
30+
This page covers Google Secret Manager specific setup. For the full resolver overview and syntax reference, including simpler alternatives like `${env:...}`, `${file:...}`, and `${cmd:...}`, see [Secrets Management](/docs/collecting-metrics/secrets-management).
3131

3232

3333
### Limitations
3434

35-
If you omit the version in the operand, Netdata reads the `latest` secret version automatically.
35+
Netdata reads existing secrets from Google Secret Manager. It does not create, rotate, or manage those secrets. If you omit the version in the operand, Netdata reads the `latest` secret version automatically.
3636

3737

3838
## Setup
@@ -63,7 +63,7 @@ If you use `service_account_file`, the JSON file contains a private key. Keep it
6363

6464
#### Allow Secret Manager access
6565

66-
The Google identity used by this secretstore must be allowed to access the referenced secrets in Google Secret Manager.
66+
The Google identity used by this secretstore must have the `roles/secretmanager.secretAccessor` IAM role on the secrets you reference from collector configs. Do not use broader roles like `roles/secretmanager.admin`.
6767

6868

6969
#### Plan for file-based changes
@@ -85,14 +85,14 @@ The following options can be defined for this secretstore backend.
8585
| Group | Option | Description | Default | Required |
8686
|:------|:-----|:------------|:--------|:---------:|
8787
| | [mode](#option-mode) | GCP authentication mode. | metadata | yes |
88-
| **Service Account File** | mode_service_account_file.path | Path to a service account JSON file. Required when `mode` is `service_account_file`. The file contains a private key and should be readable only by the `netdata` user or another tightly scoped owner. | | yes |
88+
| **Service Account File** | mode_service_account_file.path | Absolute path to a service account JSON file. Required when `mode` is `service_account_file`. The file contains a private key and should be readable only by the `netdata` user or another tightly scoped owner. | | yes |
8989

9090
<a id="option-mode"></a>
9191
##### mode
9292

9393
Supported values:
9494

95-
- `metadata`: get an access token from the Google metadata server.
95+
- `metadata`: get an access token from the Google metadata server. This works in GCE, GKE (with Workload Identity configured), Cloud Run, and other Google Cloud environments where the metadata server is reachable.
9696
- `service_account_file`: use a local service account JSON file.
9797

9898
Prefer `metadata` for production when Netdata runs in a supported Google Cloud environment. Use `service_account_file` when you need explicit credentials or when the metadata server is not available.
@@ -146,14 +146,15 @@ jobs:
146146

147147
## Use in collector configs
148148

149-
Reference Google Secret Manager secrets from collector configs with the `gcp-sm` secretstore kind.
149+
Use the `${store:gcp-sm:...}` syntax to reference Google Secret Manager secrets in any string field of a collector configuration file.
150150

151151

152152
The operand is `project/secret` or `project/secret/version`.
153153

154-
If you omit the version, Netdata uses `latest`.
154+
- Use `project/secret` to read the latest version, for example: `${store:gcp-sm:gcp_prod:my-project/mysql-password}`.
155+
- Use `project/secret/version` to read a specific version, for example: `${store:gcp-sm:gcp_prod:my-project/mysql-password/3}`.
156+
155157
Project IDs may use letters, numbers, `.`, `_`, `:`, or `-`. Secret names and versions may use letters, numbers, `_`, or `-`.
156-
When you specify a version, use the version name accepted by Secret Manager, such as `3`.
157158

158159

159160
```text
@@ -165,28 +166,37 @@ ${store:gcp-sm:<store-name>:<project/secret[/version]>}
165166
- `<project/secret[/version]>`: The Google Cloud project ID, secret name, and optional version.
166167

167168
### Examples
168-
#### Latest version
169+
#### MySQL collector with password from Google Secret Manager
169170

170-
Read the latest version of the `mysql-password` secret from the `my-project` project.
171+
This example configures a MySQL collector job in `/etc/netdata/go.d/mysql.conf`.
172+
The password in the DSN connection string is not stored in plain text. Instead,
173+
`${store:gcp-sm:gcp_prod:my-project/mysql-password}` tells Netdata to fetch the
174+
latest version of the `mysql-password` secret from the `my-project` project using
175+
the `gcp_prod` store, and substitute its value into the DSN at runtime.
171176

172-
```text
173-
${store:gcp-sm:gcp_prod:my-project/mysql-password}
174-
```
175-
#### Specific version
176177

177-
Read version `3` of the `mysql-password` secret.
178+
```yaml
179+
# /etc/netdata/go.d/mysql.conf
180+
jobs:
181+
- name: mysql_prod
182+
dsn: "netdata:${store:gcp-sm:gcp_prod:my-project/mysql-password}@tcp(127.0.0.1:3306)/"
178183

179-
```text
180-
${store:gcp-sm:gcp_prod:my-project/mysql-password/3}
181184
```
182-
#### Collector config example
185+
#### HTTP check collector with password from Google Secret Manager
186+
187+
This example configures an HTTP check collector job in `/etc/netdata/go.d/httpcheck.conf`.
188+
The `password` field uses a secret reference instead of a plain-text value. Netdata fetches
189+
the `api-password` secret from the `my-project` project and substitutes its value into the
190+
`password` field at runtime.
183191

184-
Use a Google Secret Manager secret in a collector DSN.
185192

186193
```yaml
194+
# /etc/netdata/go.d/httpcheck.conf
187195
jobs:
188-
- name: mysql_prod
189-
dsn: "netdata:${store:gcp-sm:gcp_prod:my-project/mysql-password}@tcp(127.0.0.1:3306)/"
196+
- name: internal_api
197+
url: https://api.example.com/health
198+
username: netdata
199+
password: "${store:gcp-sm:gcp_prod:my-project/api-password}"
190200

191201
```
192202

0 commit comments

Comments
 (0)