14
- 'google secret manager'
15
overview:
16
description: |
17
- 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.
17
+ Netdata can pull collector credentials directly from Google Secret Manager at runtime, so you never store passwords or tokens in plain-text configuration files.
18
19
- This page covers Google Secret Manager specific setup. For the shared resolver workflow and syntax, see [Secrets Management](/src/collectors/SECRETS.md).
19
+ 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](/src/collectors/SECRETS.md).
20
limitations: |
21
- If you omit the version in the operand, Netdata reads the `latest` secret version automatically.
21
+ 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.
22
setup:
23
prerequisites:
24
list:
35
If you use `service_account_file`, the JSON file contains a private key. Keep it on the Netdata host, make it readable by the `netdata` user, and restrict access as tightly as possible. A common setup is `chmod 0600` with ownership that allows the `netdata` user to read the file.
36
- title: 'Allow Secret Manager access'
37
description: |
38
- The Google identity used by this secretstore must be allowed to access the referenced secrets in Google Secret Manager.
38
+ 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`.
39
- title: 'Plan for file-based changes'
40
description: |
41
If you edit `/etc/netdata/go.d/ss/gcp-sm.conf`, restart the Netdata Agent to load the updated secretstore definition.
55
detailed_description: |
56
Supported values:
57
58
- - `metadata`: get an access token from the Google metadata server.
58
+ - `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.
59
- `service_account_file`: use a local service account JSON file.
60
61
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.
62
- name: 'mode_service_account_file.path'
63
group: 'Service Account File'
64
- description: '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.'
64
+ description: '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.'
65
default_value: ''
66
required: true
67
examples:
85
path: /etc/netdata/gcp-service-account.json
86
collector_configs:
87
description: |
88
- Reference Google Secret Manager secrets from collector configs with the `gcp-sm` secretstore kind.
88
+ Use the `${store:gcp-sm:...}` syntax to reference Google Secret Manager secrets in any string field of a collector configuration file.
89
summary:
90
operand_format: 'project/secret[/version]'
91
example_operand: 'my-project/mysql-password'
93
description: |
94
The operand is `project/secret` or `project/secret/version`.
95
96
- If you omit the version, Netdata uses `latest`.
96
+ - Use `project/secret` to read the latest version, for example: `${store:gcp-sm:gcp_prod:my-project/mysql-password}`.
97
+ - Use `project/secret/version` to read a specific version, for example: `${store:gcp-sm:gcp_prod:my-project/mysql-password/3}`.
98
+
99
Project IDs may use letters, numbers, `.`, `_`, `:`, or `-`. Secret names and versions may use letters, numbers, `_`, or `-`.
98
- When you specify a version, use the version name accepted by Secret Manager, such as `3`.
100
syntax: '${store:gcp-sm:<store-name>:<project/secret[/version]>}'
101
parts:
102
list:
108
description: 'The Google Cloud project ID, secret name, and optional version.'
109
examples:
110
list:
110
- - name: 'Latest version'
111
- description: 'Read the latest version of the `mysql-password` secret from the `my-project` project.'
112
- language: 'text'
113
- content: '${store:gcp-sm:gcp_prod:my-project/mysql-password}'
114
- - name: 'Specific version'
115
- description: 'Read version `3` of the `mysql-password` secret.'
116
- language: 'text'
117
- content: '${store:gcp-sm:gcp_prod:my-project/mysql-password/3}'
118
- - name: 'Collector config example'
119
- description: 'Use a Google Secret Manager secret in a collector DSN.'
120
- language: 'yaml'
111
+ - name: 'MySQL collector with password from Google Secret Manager'
112
+ description: |
113
+ This example configures a MySQL collector job in `/etc/netdata/go.d/mysql.conf`.
114
+ The password in the DSN connection string is not stored in plain text. Instead,
115
+ `${store:gcp-sm:gcp_prod:my-project/mysql-password}` tells Netdata to fetch the
116
+ latest version of the `mysql-password` secret from the `my-project` project using
117
+ the `gcp_prod` store, and substitute its value into the DSN at runtime.
118
content: |
119
+ # /etc/netdata/go.d/mysql.conf
120
jobs:
121
- name: mysql_prod
122
dsn: "netdata:${store:gcp-sm:gcp_prod:my-project/mysql-password}@tcp(127.0.0.1:3306)/"
123
+ - name: 'HTTP check collector with password from Google Secret Manager'
124
+ description: |
125
+ This example configures an HTTP check collector job in `/etc/netdata/go.d/httpcheck.conf`.
126
+ The `password` field uses a secret reference instead of a plain-text value. Netdata fetches
127
+ the `api-password` secret from the `my-project` project and substitutes its value into the
128
+ `password` field at runtime.
129
+ content: |
130
+ # /etc/netdata/go.d/httpcheck.conf
131
+ jobs:
132
+ - name: internal_api
133
+ url: https://api.example.com/health
134
+ username: netdata
135
+ password: "${store:gcp-sm:gcp_prod:my-project/api-password}"
136
troubleshooting:
137
problems:
138
list: