Repository navigation
[2.0] Fixes #37552: Verify MySQL sslConfig certificates and reject invalid sslConfig - #37633
Conversation
…sslConfig (#37553) * Fixes #37552: Verify MySQL sslConfig certificates and reject invalid sslConfig SSLManager passed the sslConfig file paths to PyMySQL as ssl_ca/ssl_cert/ssl_key, keys the ssl dict ignores, so MySQL, Doris and StarRocks connected over TLS without verifying the server and without presenting client certificates. Use PyMySQL's ca/cert/key keys. sslConfig is a oneOf, so the converters kept any map they could not type and the server saved configs (e.g. sslMode on MySQL) that the ingestion runner refused to load. Reject them with a 400 on service create/update; reads stay lenient so already-stored configs can still be fixed. * Test valid sslConfig on MySQL only in the IT Java DatabaseServiceType constants from Databricks onward carry the next service's value on main (javaEnums is missing Clickzetta), so the SDK sends MongoDB as SapSuccessFactors. The untyped-map case stays covered by SecretsUtilSslConfigTest. (cherry picked from commit f28197e)
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved 🔴 High riskPassing CA certificates under PyMySQL's recognized keys enables server verification, so untrusted or mismatched certificates may prevent database connections. Backport of the MySQL sslConfig fix to 2.0: the ingestion SSLManager now passes CA, cert, and key to PyMySQL under the correct VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Backport of #37553 to
2.0(cherry-pick of f28197e). Fixes #37552.SSLManagernow passes thesslConfigcert files to PyMySQL asca/cert/key(it wasssl_ca/ssl_cert/ssl_key, which PyMySQL ignores inside thessldict). Before this fix, MySQL/Doris/StarRocks connections used TLS but never verified the server certificate.sslConfig(e.g.{"sslMode": "require"}on MySQL) is now rejected with a 400 on create/update. Before, it was saved and then crashed the ingestion runner.See #37553 for the full description and the end-to-end TLS test matrix.
Conflicts resolved for 2.0
ServiceEntityRepository.prepare: 2.0 hasencryptServiceConnectionConfig, not main'sprepareServiceConnectionConfig(Fixes #36586: Defer external service secret writes #36587 isn't on 2.0). The validation call wraps 2.0's method instead.ssl_manager.py: kept 2.0'sUnion[...]cast style; only the comment and key names changed.DatabaseServiceResourceIT: added theorg.openmetadata.sdk.exceptions.OpenMetadataExceptionimport, which main already had.Behaviour change (same as on main): if a service already has an invalid
sslConfigstored, its next PUT/PATCH returns 400 unless the same request fixessslConfig. GET and list still work.Type of change:
Tests (run on this branch, against 2.0):
pytest tests/unit/test_ssl_manager.py tests/unit/source/database/test_mysql_iam.py: 59 passedmvn test -pl openmetadata-service -Dtest=SecretsUtilSslConfigTest: 4 passedDatabaseServiceResourceIT#post_mysqlService*(mysql-elasticsearch, parallel lane): 2 passedruff check/ruff format --checkandspotless:checkcleanChecklist:
Fixes <issue-number>: <short explanation>🤖 Generated with Claude Code