det101 commented on PR #18659: URL: https://github.com/apache/dolphinscheduler/pull/18659#issuecomment-6159222032
@SbloodyS Thanks for the follow-up review. Addressed in 4ce442acc2. **Instance-resolved definition snapshot** `updateWorkflowInstance()` no longer merges `******` a second time against the latest workflow definition. The definition snapshot is built from the already-resolved instance globals (`instanceGlobalParams`), then encoded only at the persist boundary before `saveWorkflowDefine()`. Instance `global_params` stay plaintext. This covers the case where the definition has secret A and the instance was started with override B: an unchanged `******` keeps B on the instance and encodes B (not A) into the definition snapshot for both `syncDefine=true` and `syncDefine=false`. Coverage is in `WorkflowInstanceServiceTest#assertInstanceEditUsesInstanceOverrideForDefinitionSnapshot`. **Crypto closer to load/persist boundaries** We also tightened the encode/decode placement so sensitive definition values are handled as close as possible to DB I/O: - **Persist**: encode task `localParams` / workflow `globalParams` immediately before `saveTaskDefine` / `saveWorkflowDefine` (definition create/update and instance-edit definition snapshots). Business logic (merge, permission, DAG checks) stays on plaintext. - **Load**: decode right after reading definition rows for start/backfill (`decodeAfterLoad`), and once when Master assembles the workflow definition; task `localParams` stay ciphertext in the graph / `task_instance` and are decrypted only when building the worker `TaskExecutionContext`. Happy to adjust further if anything still looks off. -- 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]
