Skip to content

fix: validate mTLS client identity files - #951

Merged
cathleeny merged 3 commits into
mainfrom
codex/mtls-validation
Sep 16, 2026
Merged

cathleeny merged 3 commits into
mainfrom
codex/mtls-validation

Conversation

@cathleeny

@cathleeny cathleeny commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Description

Fix the AUTH-015 and AUTH-016 mTLS conformance gaps for both the Thrift and kernel backends:

  • reject a client private key configured without a client certificate instead of silently falling back to one-way TLS
  • report missing or empty certificate/key files with the failing option name and path
  • share certificate-chain loading through SSLOptions, while preserving separate cert/key files, combined cert+key PEM files, and password forwarding on the Thrift path
  • apply the same client-identity validation before translating settings to kernel TLS arguments

How is this tested?

Focused unit coverage passed for SSLOptions, unified HTTP setup, kernel TLS argument translation, Thrift TLS wiring, and session argument forwarding (33 tests total). The changed production files also pass Black formatting checks.

Related Tickets & Documents

Fixes #942

Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com>
Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com>

@peco-review-bot peco-review-bot 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.

Verdict: 1 Low

Looks good — a well-scoped, well-tested mTLS validation fix. Verified there's no circular import (types.py → exc.py is safe since exc.py's telemetry import is lazy), the cert-chain loading logic is correct, and the key-without-cert / combined-PEM behavior changes are intentional and covered by new unit tests. Only one minor (low) consistency note about mixed direct-vs-getattr access in _kernel_tls_kwargs.

Comment thread src/databricks/sql/backend/kernel/client.py
Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com>

@peco-review-bot peco-review-bot 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.

Verdict: 1 Low

Looks good — a focused, well-tested mTLS validation fix. Key-without-cert is now rejected on both the Thrift/unified and kernel paths, missing/empty identity files are reported with the failing option name, and the new SSLOptions helpers are covered by thorough unit tests. No circular-import or correctness concerns; one Low note about duplicated file-validation logic between SSLOptions and the kernel backend.

Comment thread src/databricks/sql/types.py
@cathleeny
cathleeny enabled auto-merge September 16, 2026 22:44
@cathleeny
cathleeny added this pull request to the merge queue Sep 16, 2026
Merged via the queue into main with commit 70427d7 Sep 16, 2026
52 checks passed
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.

[coverage] Conformance findings: AUTH-015,AUTH-016

1 participant