Skip to content

[#12982] fix(core): mask undeclared credential-like properties by name - #12983

Open
lasdf1234 wants to merge 8 commits into
apache:mainfrom
lasdf1234:feat/sensitive-property-name-mask
Open

[#12982] fix(core): mask undeclared credential-like properties by name#12983
lasdf1234 wants to merge 8 commits into
apache:mainfrom
lasdf1234:feat/sensitive-property-name-mask

Conversation

@lasdf1234

@lasdf1234 lasdf1234 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

What changes were proposed in this pull request?

  • Treat property keys whose names look credential-like (contain secret, password, token, credential, or access, case-insensitive; _/- equivalent) as sensitive even when undeclared in properties metadata
  • Mask those values as ****** on API read paths via HiddenPropertyMaskUtils
  • Return stored plaintext for those keys from getSecrets / SecretPropertyUtils.buildSecrets (in addition to existing secret-manager URN resolution), so clients that merge properties() + getSecrets() (Spark/Flink/IRC standalone) still receive usable credentials

Why are the changes needed?

Redaction previously depended only on declared hidden metadata. A mistyped credential property name bypassed masking and leaked plaintext on catalog get/list.

Fix: #12982

Does this PR introduce any user-facing change?

Yes.

  1. Undeclared properties whose names match the sensitive pattern are returned as ****** instead of plaintext.
  2. getSecrets may include additional keys: sensitive-named inline plaintext values, not only secret-manager URN resolutions.

How was this patch tested?

./gradlew :core:test --tests 'org.apache.gravitino.secret.TestSecretPropertyUtils' \
  --tests 'org.apache.gravitino.connector.TestHiddenPropertyMaskUtils' -PskipITs

lasdf1234 and others added 3 commits September 8, 2026 15:59
…by name

Mask API responses for property keys matching secret/password/token/
credential/access, and return stored plaintext for those keys from
getSecrets so clients that merge properties() + getSecrets() still work.

Co-authored-by: Cursor <cursoragent@cursor.com>
…buildSecrets

buildSecrets only reads raw stored properties, which already reject ******.

Co-authored-by: Cursor <cursoragent@cursor.com>
Cover azure-storage-account-key/name and gcs-service-account-file via the
same name-based mask and getSecrets plaintext path.

Co-authored-by: Cursor <cursoragent@cursor.com>
lasdf1234 and others added 5 commits September 8, 2026 17:02
…c tables

Keep name-based property masking for tables; recover plaintext via
SupportsSecrets so Flink JDBC generic tables do not connect with ******.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ersion

Name-masked sensitive properties need plaintext recovery via SupportsSecrets
for every entity type that applies name-based masking, including MODEL_VERSION.

Co-authored-by: Cursor <cursoragent@cursor.com>
Name-masked catalog/schema properties() return ******, while Lance
describeNamespace merges getSecrets() plaintext for storage options.

Co-authored-by: Cursor <cursoragent@cursor.com>
ModelVersion is a storage entity, not a MetadataObject; secrets/tags/roles
APIs hang on MODEL. Keep name-masking but drop MODEL_VERSION object wiring.

Co-authored-by: Cursor <cursoragent@cursor.com>
@lasdf1234
lasdf1234 requested a review from diqiu50 September 8, 2026 11:45
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.

[Bug report] Undeclared credential-like catalog properties are returned unredacted

1 participant