Skip to content

Unify CA certificates and cover the OIDC provider - #442

Open
Bohreromir wants to merge 2 commits into
mainfrom
worktree-unified-ca-certs
Open

Bohreromir wants to merge 2 commits into
mainfrom
worktree-unified-ca-certs

Conversation

@Bohreromir

@Bohreromir Bohreromir commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Replace the per-service CA settings for Trino, PostgreSQL and S3 with STACKABLE_COCKPIT_TLS_CA_CERTS (Helm: tls.caCerts, tls.secretClasses). The CAs are added to the process-wide default trust store, so every outgoing TLS connection, including the OIDC provider, trusts them while publicly trusted endpoints keep working.
Closes #383

Description

Docs

Release note

Checklist

Author

  • AI review done, findings addressed
  • Tests added or updated
  • Changelog updated (if the repo keeps one)

Reviewer

  • Useful comments and logging
  • Docs added or updated per the style guide

Acceptance

  • Check for release notes and docs

Replace the per-service CA settings for Trino, PostgreSQL and S3 with
STACKABLE_COCKPIT_TLS_CA_CERTS (Helm: tls.caCerts, tls.secretClasses).
The CAs are added to the process-wide default trust store, so every
outgoing TLS connection, including the OIDC provider, trusts them while
publicly trusted endpoints keep working. A missing or invalid
certificate now stops the server at startup.

Add /readyz, used by the Helm readiness probe: it fails until the OIDC
discovery document has been fetched once, and the log names the cause,
e.g. an untrusted provider certificate. Warn in production when Trino
TLS verification is disabled.

Closes #383
@Bohreromir Bohreromir self-assigned this Nov 9, 2026
@Bohreromir
Bohreromir marked this pull request as ready for review November 9, 2026 09:52
@Bohreromir Bohreromir moved this to Development: Waiting for Review in Stackable Engineering Nov 9, 2026
@Bohreromir Bohreromir changed the title feat(tls): Unify CA certificates and cover the OIDC provider Unify CA certificates and cover the OIDC provider Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 67.55% 9217 / 13643
🔵 Statements 66.5% 12400 / 18646
🔵 Functions 68.3% 2972 / 4351
🔵 Branches 57.43% 5187 / 9031
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/hooks.server.ts 0% 0% 0% 0% 25-158
src/lib/server/auth.ts 66.66% 33.33% 50% 74.19% 13, 14, 15, 18, 68, 125-150
src/lib/server/ca-certs.ts 100% 100% 100% 100%
src/lib/server/db-tls.ts 100% 100% 100% 100%
src/lib/server/db.ts 80% 96.15% 0% 82.75% 11, 65, 73-77
src/lib/server/oidc-discovery.ts 100% 78.57% 100% 100%
src/lib/server/storage/config.ts 100% 100% 100% 100%
src/lib/server/storage/s3-client.ts 100% 100% 100% 100%
src/lib/server/trino/client.ts 68.91% 66.12% 53.33% 75.38% 73, 74, 86-87, 107, 125-135, 149, 159, 221-222, 228, 264-271
src/lib/server/trino/config.ts 100% 100% 100% 100%
src/routes/readyz/+server.ts 0% 0% 0% 0% 6-10
Generated in workflow #1250 for commit 9655ffb by the Vitest Coverage Report Action

@labrenbe
labrenbe self-requested a review November 10, 2026 15:33
@Bohreromir
Bohreromir added this pull request to stack #459 November 10, 2026 20:29

@labrenbe labrenbe left a comment

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.

Looks good in general, but I'm not so sure about the readiness gate. Maybe that should also be a separate PR?

Comment thread src/lib/server/oidc-discovery.ts Outdated
/**
* Fetches the discovery document. Returns true once it has succeeded: afterwards
* better-auth has (or retries) the provider metadata, so a later outage of the
* provider doesn't take the cockpit out of service for users with a session.

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.

This is only true if the cockpit Pod doesn't restart. If the Pod restarts while the OIDC provider is not available it won't become ready and users can't continue their sessions. It might be ok to just error on misconfiguration.

@Bohreromir Bohreromir Nov 11, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, makes sense regarding the readyz. That probably deserves another more intense look so I removed it.

@labrenbe labrenbe moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Nov 11, 2026
@Bohreromir
Bohreromir requested a review from labrenbe November 11, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: In Review

Development

Successfully merging this pull request may close these issues.

Unify CA certificate configuration for Trino, PostgreSQL and S3 storage

2 participants