|
27 | 27 | ], |
28 | 28 | "jump_to": [ |
29 | 29 | {"label": "Resolver Quick Reference", "anchor": "resolver-quick-reference"}, |
| 30 | + {"label": "Choosing a Resolver", "anchor": "choosing-a-resolver"}, |
30 | 31 | {"label": "Environment Variables", "anchor": "environment-variables"}, |
31 | 32 | {"label": "Files", "anchor": "files"}, |
32 | 33 | {"label": "Commands", "anchor": "commands"}, |
|
61 | 62 | "notes": "Configure the secretstore first, then reference it from collector configs.", |
62 | 63 | }, |
63 | 64 | ], |
| 65 | + "choosing_a_resolver": [ |
| 66 | + "Use `${env:...}` or `${file:...}` for simple setups where secrets are already available locally on the Netdata host.", |
| 67 | + "Use `${cmd:...}` when you need dynamic secret retrieval via a trusted local command, such as 1Password CLI or a custom script.", |
| 68 | + "Use `${store:...}` when your organization manages secrets centrally in a cloud provider or Vault and you want Netdata to pull from that source directly.", |
| 69 | + "You can use different resolver types across different collectors, different jobs within the same collector, or even within the same configuration value. See [Mixing resolver types](#mixing-resolver-types).", |
| 70 | + ], |
64 | 71 | "sections": { |
65 | 72 | "env": { |
66 | 73 | "heading": "## Environment Variables", |
|
87 | 94 | "The file path must be absolute.", |
88 | 95 | "Netdata trims leading and trailing whitespace from the file contents.", |
89 | 96 | "The file must exist on the Netdata host and be readable by the `netdata` user.", |
| 97 | + "**Docker Secrets**: Docker mounts secrets as files under `/run/secrets/` inside the container. Use `${file:/run/secrets/<secret-name>}` to read them.", |
| 98 | + "**Kubernetes Secrets**: If you mount Kubernetes Secrets as volume files in the Netdata pod, reference them with `${file:/path/to/mounted/secret}`.", |
90 | 99 | ], |
91 | 100 | }, |
92 | 101 | "cmd": { |
|
130 | 139 | ], |
131 | 140 | "file_intro": "Each secretstore backend has its own file under `/etc/netdata/go.d/ss/`:", |
132 | 141 | "file_note": "File-based secretstores are loaded at agent startup. If you edit these files, restart the Netdata Agent to apply the changes.", |
| 142 | + "file_directory": ( |
| 143 | + "If the `/etc/netdata/go.d/ss/` directory does not exist, create it:\n\n" |
| 144 | + "```bash\n" |
| 145 | + "sudo mkdir -p /etc/netdata/go.d/ss\n" |
| 146 | + "sudo chown netdata:netdata /etc/netdata/go.d/ss\n" |
| 147 | + "sudo chmod 0750 /etc/netdata/go.d/ss\n" |
| 148 | + "```\n\n" |
| 149 | + "Secretstore configuration files may contain sensitive values such as tokens or client secrets. " |
| 150 | + "Restrict directory and file permissions to the `netdata` user." |
| 151 | + ), |
| 152 | + "mixing": ( |
| 153 | + "You can mix different resolver types in the same configuration value or the same config file. " |
| 154 | + "For example, you might read the username from an environment variable and the password from a secretstore:\n\n" |
| 155 | + "```yaml\n" |
| 156 | + "jobs:\n" |
| 157 | + " - name: mysql_prod\n" |
| 158 | + ' dsn: "${env:MYSQL_USER}:${store:vault:vault_prod:secret/data/netdata/mysql#password}@tcp(127.0.0.1:3306)/"\n' |
| 159 | + "```\n\n" |
| 160 | + "Different jobs within the same collector config file can also use different resolver types." |
| 161 | + ), |
| 162 | + "multiple_stores": ( |
| 163 | + "Each secretstore config file can contain multiple `jobs` entries, each with a unique store name. " |
| 164 | + "You can use different secretstore backends simultaneously. " |
| 165 | + "For example, you might configure a Vault store for database credentials and an AWS Secrets Manager store for API keys, " |
| 166 | + "then reference each one using its `${store:<kind>:<name>:<operand>}` syntax in the relevant collector configs." |
| 167 | + ), |
133 | 168 | }, |
134 | 169 | "secretstores": { |
135 | 170 | "heading": "## Supported Secretstore Backends", |
|
145 | 180 | "security_notes": [ |
146 | 181 | "Prefer secret references over plain-text credentials in collector configs.", |
147 | 182 | "Prefer platform-native identity modes for production when a backend supports them, such as instance roles, managed identities, or metadata-based credentials.", |
| 183 | + "Secretstore configuration values (such as tokens and client secrets) also support `${env:...}`, `${file:...}`, and `${cmd:...}` resolvers. Use them to avoid storing backend credentials in plain text. Note that `${store:...}` references are not supported inside secretstore configurations.", |
148 | 184 | "Keep local secret material readable only by the `netdata` user, including token files, service account files, and any files used with `${file:...}`.", |
149 | 185 | "Use `${cmd:...}` only with trusted local commands and absolute paths.", |
150 | 186 | ], |
@@ -288,6 +324,7 @@ def build_page_context() -> Dict[str, Any]: |
288 | 324 | f'[{jump["label"]}](#{jump["anchor"]})' for jump in SECRETS_PAGE["jump_to"] |
289 | 325 | ), |
290 | 326 | "quick_reference": SECRETS_PAGE["quick_reference"], |
| 327 | + "choosing_a_resolver": SECRETS_PAGE["choosing_a_resolver"], |
291 | 328 | "sections": [ |
292 | 329 | SECRETS_PAGE["sections"]["env"], |
293 | 330 | SECRETS_PAGE["sections"]["file"], |
|
0 commit comments