Skip to content

Commit 48d4f38

Browse files
committed
Fixed docs
1 parent 6cc8f4b commit 48d4f38

File tree

1 file changed

+19
-46
lines changed
  • docs/build-your-software-catalog/sync-data-to-catalog/kubernetes-stack/kubernetes

1 file changed

+19
-46
lines changed

docs/build-your-software-catalog/sync-data-to-catalog/kubernetes-stack/kubernetes/advanced.md

Lines changed: 19 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ The K8s exporter supports configuration options to control access to environment
142142

143143
The `allowAllEnvironmentVariablesInJQ` parameter controls whether all environment variables are accessible in JQ queries.
144144

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).
147147

148148
:::warning Security Risk
149149
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
152152
- Any other environment variables injected into the pod
153153
- Secrets mounted as environment variables
154154

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.
156156
:::
157157

158158
### `allowedEnvironmentVariablesInJQ`
159159

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.
163161

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
166166

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.
178169

179-
#### Example 2: Restrict to specific environment variables (recommended)
180-
181-
```bash
182-
--set allowAllEnvironmentVariablesInJQ=false \
183-
--set allowedEnvironmentVariablesInJQ="CLUSTER_NAME,NAMESPACE,REGION"
184-
```
185-
186-
#### Example 3: Using values.yaml file
170+
#### Configuration Example
187171

188172
```yaml
189173
allowAllEnvironmentVariablesInJQ: false
190-
allowedEnvironmentVariablesInJQ: "CLUSTER_NAME,NAMESPACE,REGION"
191-
```
192-
193-
#### Example 4: Using patterns to allow groups of variables
194-
195-
```bash
196-
--set allowAllEnvironmentVariablesInJQ=false \
197-
--set allowedEnvironmentVariablesInJQ="CLUSTER_*,NAMESPACE,REGION_*"
174+
allowedEnvironmentVariablesInJQ:
175+
- ^CLUSTER_
176+
- AWS_REGION
177+
- AWS_ACCOUNT_ID
178+
resources:
179+
- kind: v1/namespaces
180+
...
198181
```
199182

200183
This configuration allows:
201184
- All environment variables starting with `CLUSTER_` (e.g., `CLUSTER_NAME`, `CLUSTER_ID`)
202-
- Specific variable: `NAMESPACE`
203-
- All environment variables starting with `REGION_` (e.g., `REGION_US`, `REGION_EU`)
204-
205-
#### Example 5: Using patterns in values.yaml
206-
207-
```yaml
208-
allowAllEnvironmentVariablesInJQ: false
209-
allowedEnvironmentVariablesInJQ: "CLUSTER_*,NAMESPACE_*,REGION_*"
210-
```
211-
212-
This configuration allows all environment variables that start with `CLUSTER_`, `NAMESPACE_`, or `REGION_`.
185+
- Specific variables: `AWS_REGION` & `AWS_ACCOUNT_ID`
213186

214187
</TabItem>
215188

0 commit comments

Comments
 (0)