Configure Queries
After importing a Kubernetes cluster, you can configure which resources Guardrails monitors and how frequently. Each resource type has its own query that tells osquery which columns to include and how often to run. You modify these queries through the Kubernetes > {ResourceType} > osquery > Configuration > * policies.
Query Configuration Policies
For each Kubernetes resource type (e.g., ConfigMaps), the following policies are available:
| Policy | Description |
|---|---|
Kubernetes > ConfigMap > osquery > Configuration | The calculated configuration for this resource type's query. Read-only, computed from the sub-policies below. |
Kubernetes > ConfigMap > osquery > Configuration > Columns | Which columns to include in the query results. |
Kubernetes > ConfigMap > osquery > Configuration > Interval | How frequently to run the query (in seconds). |
Kubernetes > ConfigMap > osquery > Configuration > Name | The query name. Do not change this. Guardrails relies on this value for event handling. |
[!CAUTION] Do not modify the query Name policy. Guardrails depends on this value to map query results to the correct resource type. Changing it will break resource discovery for that type.
Columns
Most columns from the underlying Steampipe plugin table schema are included by default. For example, the ConfigMap resource uses the kubernetes_config_map table schema.
Some columns are excluded by default because they change too frequently or provide no useful governance data, for example, the _ctx column which contains Steampipe context.
[!NOTE] If you include a column name that is not supported by the Steampipe table schema, the agent will fail to run the query and no further data will be reported for that resource type. Verify column names against the Steampipe table schema before modifying.
Query Interval
The default query interval is 60 seconds. You can adjust this based on:
- How frequently the resource type changes: Resources that change rarely (like namespaces) can use longer intervals.
- Performance requirements: Shorter intervals increase load on the cluster API server.
- Compliance requirements: Some compliance frameworks require near-real-time visibility.
Viewing the Calculated Configuration
To see the full computed query configuration for a resource type, check the Kubernetes > {ResourceType} > osquery > Configuration policy value. This read-only policy shows the final query that Guardrails sends to osquery, compiled from the Columns, Interval, and Name sub-policies.