lasdf1234 opened a new pull request, #13858:
URL: https://github.com/apache/gravitino/pull/13858

   ### What changes were proposed in this pull request?
   
   - Add `HiddenPropertyMaskUtils.maskSensitiveNamedProperties` that masks
     sensitive-named keys (and secret-manager URNs) using
     `SecretPropertyUtils.isSensitivePropertyKey`, including nested JSON string
     maps such as `updater_options` / `spark_conf`.
   - Apply that masking when converting a job's stored runtime job template to
     the Job API DTO (`JobOperations.toDTO(JobEntity)`), covering
     `environments`, `customFields`, and Spark `configs`.
   - Keep registered job templates and stored runtime JSON unmasked
     (response-only masking).
   
   ### Why are the changes needed?
   
   Resolved job runtime templates can contain plaintext credentials substituted
   from jobConf (passwords, tokens, access keys, nested updater/spark JSON).
   Those values were returned in clear text on job get/list/run/cancel 
responses.
   Default sensitive keywords: `secret`, `password`, `token`, `credential`,
   `access`, `account` (overridable via `gravitino.sensitiveKeyKeywords`).
   
   Fix: #13857
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Job API responses that include `runtimeJobTemplate` now replace
   sensitive-named map values (and nested JSON map values) with `******`.
   Stored data and registered templates are unchanged.
   
   ### How was this patch tested?
   
   - `TestHiddenPropertyMaskUtils` (keyword keys + nested JSON)
   - `TestJobOperations.testToDTORuntimeJobTemplateMasksSensitiveFields`
   
   Made with [Cursor](https://cursor.com)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to