Skip to content

[2.0] Fixes #28299: mask and encrypt secrets nested in a schema oneOf (#33193) - #37962

Merged
Khairajani merged 7 commits into
2.0from
backport-33193-2.0
Nov 18, 2026
Merged

Khairajani merged 7 commits into
2.0from
backport-33193-2.0

Conversation

@Khairajani

@Khairajani Khairajani commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #28299

Backport of #33193 to 2.0, plus the follow-up from #37965.

On 2.0, secrets inside a oneOf auth property come back unmasked from the API and show as plain text on the service Connection tab. Example: the Databricks Pipeline token / clientSecret; SFTP, OpenSearch and sslConfig are affected too.

Commit 1: backport of #33193, with these 2.0 adaptations

  • Dropped the NatsConnection converter (connector not on 2.0)
  • Kept 2.0's dedicated MicroStrategyConnectionClassConverter
  • Ported only getSchemaProperties into 2.0's ServiceConnectionDetailsUtils.tsx (main's file has diverged)
  • Added Databricks Pipeline tests: backend masker (token + OAuth client secret) and UI against the generated schema

Commit 2: cherry-pick of #37965 (review follow-up)

  • The coverage test now checks every secret-bearing branch, all the way down. That surfaced three more unmasked secrets (PowerBI GCS, Superset API sslConfig, MySQL CloudSQL), now fixed.
  • 2.0 only: SampleDataStorageConfig.config is listed as a known gap. Its S3 credentials are not typed on 2.0, and the property no longer exists on main.

Verification (on 2.0)

  • All org.openmetadata.service.secrets.** tests pass (251). The new tests fail without the fixes.
  • ServiceConnectionDetailsUtils.test.tsx passes
  • SFTP Python unit tests pass

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 4/5

The remaining explicit Java requirements must be satisfied before merging.

Findings

  1. P2 Java additions violate repository requirements ▶

Summary

This PR extends secret masking and encryption to credentials nested inside oneOf connection settings on 2.0.

  • Nested connection secrets now reach the service’s masking and encryption paths.
  • Nested connection secrets now appear as password fields.

No new findings. The previous Java requirements finding remains partly addressed. Khairajani lists SampleDataStorageConfig.config as a known 2.0 gap because its S3 credentials lack generated types and the property no longer exists on main.

Reviews (6) · Last reviewed commit: "Merge branch '2.0' into backport-33193-2..." · Reviewed by Greptile

…#33193)

Backport of #33193 to 2.0. On 2.0 a secret inside a oneOf auth property
(Databricks Pipeline token / clientSecret, SFTP, OpenSearch, sslConfig, ...)
was returned unmasked by the API and rendered as plain text in the UI.

2.0 adaptations:
- drop the NatsConnection converter (the connector is not on 2.0)
- keep MicroStrategy's dedicated converter, as 2.0 has it
- port only getSchemaProperties into 2.0's ServiceConnectionDetailsUtils
- add Databricks Pipeline masking tests (backend and UI)

(cherry picked from commit 8e465d2)
@Khairajani
Khairajani requested review from a team as code owners November 17, 2026 09:03
@Khairajani
Khairajani requested review from chirag-madlani and ulixius9 and removed request for a team November 17, 2026 09:03
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@Khairajani Khairajani added the safe to test Add this label to run secure Github workflows on PRs label Nov 17, 2026
Comment on lines +280 to +281
} catch (Exception ignored) {
// Not every JSON under json/schema parses as a schema; those cannot declare secrets.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Java additions violate repository requirements

loadSchemas silently catches Exception, contrary to the Java guide's requirements to catch specific errors and report them. Catch the expected read/parse errors and make skipped schemas visible.

The additions also violate these guide requirements:

  • Use one trailing return, small focused methods, named constants for repeated strings, and final on unchanged locals and parameters.
  • Import classes instead of adding the fully qualified reference in ClassConverterFactory.
  • Share the repeated Elasticsearch/OpenSearch conversion flow instead of copying it into OpenSearchConnectionClassConverter.

These repository requirements must be satisfied before merging.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Khairajani and others added 3 commits November 17, 2026 14:58
The coverage test from #33193 converted only the first secret-bearing
branch of each oneOf and only checked that the property itself was no
longer a Map, so a secret in a later branch, or a oneOf nested inside a
typed value, passed unnoticed. Checking every branch through a walk that
mirrors the password walkers finds three secrets still returned unmasked:

- PowerBI GCS pbitFilesSource: securityConfig.gcpConfig.privateKey
- Superset API connection: sslConfig certificates and key
- MySQL GCP CloudSQL authType: password and gcpConfig.privateKey

convertProperty now sets a property through its getter's type, so a typed
property such as GCPCredentials can be run through its own converter, and
the registry gains converters for GcpCloudSqlConfig, the PowerBI GCSConfig
and SupersetApiConnection. MySQL's authType candidates include CloudSQL.

2.0: the coverage test also lists SampleDataStorageConfig.config as a
known gap (2.0-only; the property is gone on main) and skips allowlisted
properties where they are nested in another connection.
(cherry picked from commit bcadc18)
…chemas

A converter that dropped a nested secret would have passed the previous
check, which only looked for the original value and any mask in the JSON.
The coverage test also stops silently skipping a schema it cannot read,
matching main's JsonSchemas helper.
Choosing None for an optional oneOf (e.g. the Alation database connection)
submits {}, which converted to the first candidate class filled with schema
defaults.
@gitar-bot

gitar-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🔴 High risk

Expands credential encryption and API masking across nested connection schemas; conversion regressions could leave connector secrets stored or returned in clear.

Masks and encrypts secrets nested inside schema oneOf branches, such as the Databricks Pipeline token and clientSecret, SFTP, OpenSearch, and sslConfig, so they no longer appear unmasked on the Connection tab. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@Khairajani
Khairajani merged commit 9189e20 into 2.0 Nov 18, 2026
76 of 85 checks passed
@Khairajani
Khairajani deleted the backport-33193-2.0 branch November 18, 2026 12:08
ShaileshParmar11 added a commit that referenced this pull request Nov 19, 2026
…38167)

Partial cherry-pick of #38070 (d3649e0), ServiceForm.spec.ts hunk only.

#37962 backported masking of Superset sslConfig certificates to 2.0, so
the workflow response now returns caCertificate as a mask. Assert on the
request body the form sent instead. The other #38070 hunks cover
personal-space and AI profile code that does not exist on 2.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants