Skip to content

fix(helm): harden client certificate auth values and probe over HTTPS when HTTP is off - #99

Open
Andre Coetzee (Andre153) wants to merge 2 commits into
mainfrom
claude/chart-client-mtls-followups
Open

Andre Coetzee (Andre153) wants to merge 2 commits into
mainfrom
claude/chart-client-mtls-followups

Conversation

@Andre153

Copy link
Copy Markdown

What & why

Follow-ups to #98 (client certificate auth), found while testing it. With default values, and with mTLS on and valid values, the rendered manifests are unchanged apart from the chart version label and the checksum annotation.

  • On/off values are strict. socket.clientMtls.enabled, require and the new skipImageVersionCheck take true or false only (boolean or string). Anything else fails the render. Before, --set-string socket.clientMtls.enabled=false turned mTLS on, and a typo in require reached the firewall as log-only. An unset or null require now renders true.
  • Image version check. With mTLS on, the render fails when image.tag starts with a major.minor version older than 2.15. That image ignores client_mtls, so the release would look protected while checking no certificate. skipImageVersionCheck: true is the way out for a re-tagged image. A tag that does not start with major.minor (latest, a bare digest, a custom name) is not checked.
  • Install notes. A new mTLS section says what is enforced (a certificate, or a certificate or the configured bearer/basic credential), lists the routes the check does not cover, and warns when:
    • service.httpsTargetPort sends the HTTPS port to the pod's plain-HTTP port,
    • ingress.enabled is true,
    • log-only mode runs with socket.logLevel warn or error, which hides the log-only lines (they are notice level).
  • Probes follow the listener. With ports.disableHttp: true the liveness and readiness probes use HTTPS. Before, they stayed on the HTTP port and the pod never became ready.
  • --reuse-values upgrades. The Secret key names fall back to their defaults in the template. Before, helm upgrade --reuse-values from a chart older than 0.11.25 with mTLS switched on rendered an empty key and Kubernetes rejected the Deployment.

Chart 0.11.26.

Testing

  • helm lint passes. The pin check from chart-checks.yaml passes when run by hand.
  • helm template matrix: boolean, string, number, null and missing values for each on/off value; a missing or non-map socket.clientMtls; 30 tag shapes for the version check (2.14.2, v2.14.0, 2.14, 2.14.2.1, 2.14.2-internal, 2.14.2@sha256:…, 2.15.0-rc1, latest, …); every combination of the three install-note warnings with and without a bearer or basic credential.
  • On a local k3s cluster (v1.34) with image 2.20.1 and test certificates, through kubectl port-forward:
Case main (0.11.25) This branch
ports.disableHttp: true, mTLS enforcing pod never ready, probe gets connection refused ready, no probe failures
No certificate / untrusted certificate / trusted certificate not reached 401 / 401 / 200
/health, no certificate not reached 200
Bearer token also set: no certificate with the token / with a wrong token not reached 200 / 401
Log-only at the default log level not run request admitted, log-only line written
Log-only at logLevel: warn not run request admitted, no log-only line, install notes warn
helm upgrade --reuse-values from 0.11.24 with mTLS on upgrade fails: secret.items[0].key: Required value succeeds, enforcing (401 / 401 / 200)

The Ingress and httpsTargetPort warnings were checked in rendering only. The CRL path is unchanged and was not re-tested.

🤖 Generated with Claude Code

… when HTTP is off

Follow-ups to the client certificate (mTLS) values.

socket.clientMtls.enabled, require and the new skipImageVersionCheck
take true or false only; anything else fails the render. Before, the
string "false" turned mTLS on and a typo in require reached the
firewall as log-only. An unset require renders true.

With mTLS on, the render fails when image.tag starts with a major.minor
version older than 2.15: that image ignores client_mtls and would check
no certificate.

The install notes say what is enforced and warn when the Service or an
Ingress ends TLS before the pod, or when the log level hides the
log-only lines.

With ports.disableHttp the liveness and readiness probes use HTTPS.
Before, they stayed on the HTTP port and the pod never became ready.

The Secret key names fall back to their defaults in the template, so
`helm upgrade --reuse-values` from an older chart works with mTLS on.

Bump the chart to 0.11.26.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@cursor

cursor Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes client authentication rendering, fail-closed validation, and probe behavior when HTTP is disabled; incorrect values or upgrades could block deploys or affect pod readiness, but defaults keep prior behavior for typical installs.

Overview
Releases Helm chart 0.11.26 (CloudFormation defaults and docs updated to match).

Client mTLS configuration is hardened at render time: new socket.clientMtls.skipImageVersionCheck, strict true/false parsing for enabled, require, and skipImageVersionCheck (typos and "false" strings no longer flip behavior silently), default enforce when require is unset, and a fail-fast check that blocks enabling mTLS on image tags that look older than 2.15. Templates and install NOTES add rollout guidance and warnings for Ingress, httpsTargetPort, and log levels that hide log-only cert messages.

Operational fixes: when ports.disableHttp is true, liveness/readiness probes use HTTPS; mTLS secret item keys get defaults so helm upgrade --reuse-values does not emit invalid Deployments.

Reviewed by Cursor Bugbot for commit aa1f7f2. Configure here.

@juliangruber

Copy link
Copy Markdown
Member

Claude (@claude) review

@juliangruber

Copy link
Copy Markdown
Member

Cursor (@cursor) review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit aa1f7f2. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Helm helper accepts empty-string switches and malformed clientMtls values, allowing invalid configurations to silently disable mTLS authentication instead of failing validation.

2 open issues
What changed in this PR

This PR hardens the Helm chart’s client certificate authentication introduced in #98 and fixes health probes for HTTPS-only deployments. It also improves upgrade compatibility and releases chart version 0.11.26.

Changes:

  • Adds mTLS value validation, an image-version guard, and deployment warnings.
  • Switches probes to HTTPS when HTTP is disabled and supplies fallback Secret key names for --reuse-values upgrades.
  • Updates documentation and aligns CloudFormation’s chart version default.
File Description
helm/​values.yaml Documents validation, version-check override, and HTTPS probes.
helm/​templates/​NOTES.txt Adds mTLS enforcement guidance and configuration warnings.
helm/​templates/​deployment.yaml Updates mTLS checks, probes, and Secret key defaults.
helm/​templates/​configmap.yaml Invokes validation and defaults certificate enforcement to true.
helm/​templates/​_helpers.tpl Adds mTLS boolean parsing and image-version validation.
helm/​README.md Explains validation, authentication alternatives, and excluded routes.
helm/​Chart.yaml Bumps chart version to 0.11.26.
cloudformation/​README.md Documents the updated chart default.
cloudformation/​firewall-eks.yaml Sets the chart version default to 0.11.26.

Review effort: Balanced

Comment thread helm/templates/_helpers.tpl Resolved
Comment thread helm/templates/_helpers.tpl Resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have never used helm, so I think it's better for someone else to review. Tell me if I should skill up instead

Review follow-up on the client certificate auth hardening.

- An empty string for enabled, require or skipImageVersionCheck now fails
  the render. Before, it took the default, so `--set-string
  socket.clientMtls.enabled=` rendered with mTLS off.
- socket.clientMtls set to false, 0, "" or [] now fails the map check.
  Before, `default dict` turned each into an empty map and the render
  passed with mTLS off. Only a missing or null block counts as empty.
- The map error prints at most 40 characters of the bad value.
- Install notes: with mTLS on and a ClusterIP Service, the production hint
  no longer suggests an Ingress, which would end TLS before the pod.
- Comments and docs: a blank value in a values file is null and takes the
  default; the reason semverCompare is not used is stated correctly.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants