Project

General

Profile

Actions

Bug #77693

open
RK

cephadm doesn't validate spec-provided TLS certificates during service apply

Bug #77693: cephadm doesn't validate spec-provided TLS certificates during service apply

Added by Redouane Kachach Elhicou 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

Service specs that provide user certificates through inline TLS fields may bypass the same certificate validation used by the certmgr CLI path.

For example, certificates provided through:

  • RGW `rgw_frontend_ssl_certificate`
  • service spec `ssl_cert` / `ssl_key` with `certificate_source: inline`

are parsed and later stored/applied, but they are not consistently validated at spec-apply time using `cert_mgr.check_certificate_state()`. This means invalid or expired certificates may be accepted through service specs even though similar input is rejected when uploaded through `ceph orch certmgr cert-key set`.

Expected behavior:

Service-spec-provided certificates should be validated before the spec is stored/applied. Invalid or expired certificates should fail `ceph orch apply -i` with a clear `OrchestratorError`.

Suggested fix:

Add apply-time validation in the cephadm service spec apply path, close to the existing certificate source checks. The validation should reuse `cert_mgr.check_certificate_state()` for user-provided inline certificates and service-scoped reference certificates.

`parse_tls_pem_bundle()` should remain focused on PEM parsing and structural validation only.

Affected paths:

  • `certificate_source: inline`
  • RGW legacy `rgw_frontend_ssl_certificate`
  • service-scoped `certificate_source: reference` entries already present in certmgr

Validation should happen before persisting the service spec.

Tests to add:

  • expired inline `ssl_cert` / `ssl_key` is rejected during service apply
  • expired RGW `rgw_frontend_ssl_certificate` bundle is rejected during service apply
  • valid fullchain PEM remains accepted
  • reference-mode service-scoped invalid/expired cert is rejected during service apply

No data to display

Actions

Also available in: PDF Atom