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: docs/build-your-software-catalog/sync-data-to-catalog/kubernetes-stack/kubernetes/advanced.md
+19-46Lines changed: 19 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -142,8 +142,8 @@ The K8s exporter supports configuration options to control access to environment
142
142
143
143
The `allowAllEnvironmentVariablesInJQ` parameter controls whether all environment variables are accessible in JQ queries.
144
144
145
-
-**Default value**: `true` (all environment variables are accessible)
146
-
-**Security implications**: When set to `true`, JQ queries in your resource mappings can access any environment variable available to the exporter pod, including sensitive information like API keys, passwords, and other secrets.
145
+
-**Default value**: `true` (all environment variables are accessible within JQ queries)
146
+
-**Security implications**: When set to `true`, JQ queries in your resource mappings can access any environment variable available to the exporter pod, including sensitive information like API keys, passwords, and other secrets (if those are mapped to the exporter pod as environment variables).
147
147
148
148
:::warning Security Risk
149
149
Setting `allowAllEnvironmentVariablesInJQ` to `true` can expose sensitive environment variables to JQ queries. This includes:
@@ -152,64 +152,37 @@ Setting `allowAllEnvironmentVariablesInJQ` to `true` can expose sensitive enviro
152
152
- Any other environment variables injected into the pod
153
153
- Secrets mounted as environment variables
154
154
155
-
Only enable this setting if you trust all JQ queries in your resource mappings and understand the security implications.
155
+
Due to the potential security implication, if you have a need to limit the exposure of environment variables in the exporter's JQ, please set this parameter to `false`and explicitly specify the variables that need to be accessed using JQ through the `allowedEnvironmentVariablesInJQ` parameter.
156
156
:::
157
157
158
158
### `allowedEnvironmentVariablesInJQ`
159
159
160
-
The `allowedEnvironmentVariablesInJQ` parameter specifies which environment variables are allowed in JQ queries when `allowAllEnvironmentVariablesInJQ` is set to `false`. This parameter accepts a comma-separated list that can include:
161
-
- Specific environment variable names (e.g., `CLUSTER_NAME`)
162
-
- JQ expressions/patterns for matching multiple variables (e.g., `CLUSTER_*` to match all cluster-related environment variables)
160
+
The `allowedEnvironmentVariablesInJQ` parameter specifies which environment variables are allowed in JQ queries when `allowAllEnvironmentVariablesInJQ` is set to `false`. This parameter accepts a list of JQ expressions that evaluate to environment variable names or patterns.
163
161
164
-
-**Default value**: `""` (empty - no environment variables allowed when `allowAllEnvironmentVariablesInJQ` is `false`)
165
-
-**Use case**: Restrict access to only specific, safe environment variables in JQ queries for enhanced security. Use patterns to allow groups of related environment variables.
162
+
Each entry in the list is a JQ expression that should return:
163
+
- A specific environment variable name (e.g., `"CLUSTER_NAME"`)
164
+
- A pattern for matching multiple variables (e.g., `"^CLUSTER_"` to match all cluster-related environment variables)
165
+
- An array of environment variable names or patterns
166
166
167
-
:::tip Recommended Security Practice
168
-
For production environments, set `allowAllEnvironmentVariablesInJQ` to `false` and explicitly list only the environment variables your JQ queries need in `allowedEnvironmentVariablesInJQ`.
169
-
:::
170
-
171
-
#### Configuration Examples
172
-
173
-
#### Example 1: Allow all environment variables (default, less secure)
174
-
175
-
```bash
176
-
--set allowAllEnvironmentVariablesInJQ=true
177
-
```
167
+
-**Default value**: `^PORT_, CLUSTER_NAME`
168
+
-**Use case**: Restrict access to only specific, safe environment variables in JQ queries for enhanced security. Use JQ expressions to dynamically determine which environment variables should be accessible.
178
169
179
-
#### Example 2: Restrict to specific environment variables (recommended)
0 commit comments