helm: validate values with a schema, render-time guards, and helm tests - #26
Open
David Larsen (dc-larsen) wants to merge 1 commit into
Open
helm: validate values with a schema, render-time guards, and helm tests#26David Larsen (dc-larsen) wants to merge 1 commit into
David Larsen (dc-larsen) wants to merge 1 commit into
Conversation
Three failure modes this chart previously accepted silently: - A values file where an indentation accident turns a section (e.g. pathRouting) into null and promotes its children to top-level keys. The stray keys were ignored and the firewall deployed with zero routes, returning 404 for all traffic. - Dead config: top-level keys no template reads (e.g. an env: block holding an API token). - An ElastiCache cluster-mode configuration endpoint (clustercfg.*) in redis.host, which the firewall's single-endpoint Redis client cannot use (no MOVED-redirect support). What's added: - values.schema.json (draft-07) covering every top-level key, with additionalProperties: false at the root and in structured sections. Kubernetes passthrough maps (annotations, resources, affinity, tolerations, extraConfig, ...) stay free-form. Validated against the chart defaults and all bundled examples. - templates/validations.yaml render-time guards: pathRouting enabled with no route source, clustercfg.* Redis endpoints, and missing socket.apiToken/existingSecret all fail with actionable messages. Guards are no-ops under helm lint (lint mode) and enforce on install/upgrade/template. - helm test pod (templates/tests/): checks the /health endpoint, egress + TLS to the Socket API (expects exactly 401 from /v0/quota), redis_available via /metrics when Redis is enabled, and Host-header route matching for the first pathRouting route. - NOTES.txt warnings for socket.failOpen=true and for internet-facing ALB ingress with no client auth gate (open proxy). - README section on the validation layers and the strictness change. Breaking change: unknown top-level values keys now fail instead of being ignored. Use extraConfig for raw socket.yml passthrough.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit b0eccdb. Configure here.
| echo " outbound HTTPS to {{ $apiUrl }} to fetch package verdicts." | ||
| fail "Socket API returned HTTP ${code} (expected exactly 401 — an unauthenticated 401 proves egress and TLS work)." | ||
| fi | ||
| echo " OK (HTTP 401 — egress and TLS to the Socket API verified)" |
There was a problem hiding this comment.
API test ignores egress settings
Medium Severity
Check 2 curls socket.apiUrl from the test pod and requires exactly HTTP 401. It does not use socket.outboundProxy, socket.apiSslCaCert, or socket.apiSslVerify, so a working firewall behind a corporate proxy or custom CA still fails helm test.
Reviewed by Cursor Bugbot for commit b0eccdb. Configure here.
Phil Gran (philgran)
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


A recent enterprise rollout lost days to three misconfigurations this chart accepted without complaint:
pathRouting:block lost its indentation, so YAML parsedpathRouting: nulland the children (enabled,domain,routes, ...) became top-level keys. Helm ignored them, the firewall deployed with zero routes, and every request 404'd.env:block no template reads, holding the API token.clustercfg.*) inredis.host. The firewall's Redis client is single-endpoint and cannot follow MOVED redirects, so caching fails at runtime while the deployment looks healthy.What's added
values.schema.json(draft-07) covering every top-level key, validated on install/upgrade/lint/template. Root and structured sections reject unknown keys; Kubernetes passthrough maps (annotations,resources,affinity,tolerations,extraConfig, ...) remain free-form.templates/validations.yaml): path routing enabled with no route source (inline routes, routesFile, or private-registry auto-discovery),clustercfg.*Redis hosts, and missingsocket.apiToken/socket.existingSecretall fail with actionable messages.helm testpod:/healthreturns 200 with "Health OK", egress + TLS to the Socket API (expects exactly 401 from/v0/quota, honoringsocket.apiUrl),redis_available 1via/metricswhen Redis is enabled, and Host-header route matching for the first path route.socket.failOpen=true(packages pass unscanned when the API is unreachable) and internet-facing ALB ingress with no client auth gate (open proxy).Breaking change
Unknown top-level values keys now fail validation instead of being silently ignored. This is deliberate; use
extraConfigfor rawsocket.ymlpassthrough. Chart version bumped to 0.12.0.Validation
helm lint(default and--strict) passes; all three bundled examples lint and template cleanly; regression fixtures for each failure mode fail with the intended errors; render-diff against main with default values shows the new test pod as the only change.Note
Medium Risk
The breaking schema strictness can fail existing upgrades that relied on ignored top-level keys; otherwise changes are chart-only validation and test hooks with no runtime firewall logic changes.
Overview
Helm chart 0.12.0 adds layered configuration validation and post-deploy checks so misconfigurations fail before or right after install instead of silently breaking production traffic.
A new
values.schema.jsonvalidates types on install/upgrade/lint/template and rejects unknown top-level keys (breaking change: stray keys like mis-indentedpathRoutingchildren or unusedenv:blocks no longer pass; useextraConfigfor rawsocket.yml).templates/validations.yamladds cross-fieldfailguards: path routing enabled with no routes/routesFile/private-registry discovery,clustercfg.*Redis hosts, and missingsocket.apiToken/socket.existingSecret.helm testruns a hook pod that checks health, Socket API egress (401 on/v0/quota), optionalredis_availablevia/metrics, and path-route Host matching. NOTES.txt now warns onsocket.failOpenand internet-facing ALB without client auth, and points operators athelm test. README documents the three validation layers.Reviewed by Cursor Bugbot for commit b0eccdb. Configure here.