Repository navigation
Conversation
SbloodyS
left a comment
There was a problem hiding this comment.
Encrypt definition snapshots created by instance edits
updateWorkflowInstance() is not an instance-only persistence path. It calls saveTaskDefine() and saveWorkflowDefine(), which write definition history even when syncDefine=false and also update current definitions when syncDefine=true.
Passing false to mergeLocalParams() therefore persists newly entered sensitive local values as plaintext in definition tables. The merged runtime globalParams are also passed directly into workflowDefinition.set(), so even keeping an existing sensitive global unchanged can copy its plaintext instance value back into the definition.
Please preserve plaintext instance globals while encrypting the copies persisted as task/workflow definitions. Add service-level coverage for instance edits with encryption enabled and both syncDefine values; the new utility tests do not cover this persistence path.
Instance edits persist task and workflow definition history, so sensitive values written there must be encoded while instance global params stay plaintext.
|
@SbloodyS Thanks for the review. Addressed in 5454ea3.
Service coverage is in |
SbloodyS
left a comment
There was a problem hiding this comment.
Encrypt the instance-resolved globals when saving definition snapshots
WorkflowInstanceServiceImpl.java:470–474
updateWorkflowInstance() resolves ****** against the instance globals, but then resolves the same submitted placeholder again against the latest workflow definition when building the encrypted snapshot.
For example, if the definition contains secret A and the instance was started with override B, an unchanged ****** preserves B in the instance but saves A in the definition snapshot. With syncDefine=true, the synchronized definition therefore differs from the edited instance. If the parameter was removed from the latest definition, the second merge can instead reject an otherwise valid instance edit.
Build the encrypted snapshot from the already-resolved instance values, preserving plaintext instance storage and avoiding double encoding. Add service-level coverage where the instance value differs from the definition value, for both syncDefine settings; the current test uses matching values and misses this case.
…bals Address review feedback: when editing a workflow instance, build the encrypted definition snapshot from already-resolved instance globals instead of merging ****** against the latest definition again. Keep instance global_params plaintext and encode only at the definition persist boundary. Add coverage for instance override differing from definition for both syncDefine values.
|
@SbloodyS Thanks for the follow-up review. Addressed in 4ce442a. Instance-resolved definition snapshot
This covers the case where the definition has secret A and the instance was started with override B: an unchanged Coverage is in 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:
Happy to adjust further if anything still looks off. |
Purpose
Implements #18587 (subtask of #17937 / DSIP-105). Depends on #18586 / #18585.
Reuse
PasswordUtilsfor definition-time at-rest protection ofsensitive=truevalues whendatasource.encryption.enable=true. Do not change datasource CRUD. Runtime instance params stay plaintext materialization; API/UI still return masked copies only.Changes
******) then encode new sensitive plaintext; skip re-encode when value equals existing sensitive DB valuerestoreStartParamslocalParamsinTaskExecutionContext/ prepare-params so Worker receives plaintextTests
false→truekeep-original then encode, encryption flag on/off, start-path decrypt, Master localParams decryptRelated issues