You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/09/06 12:27:46 UTC

[GitHub] [nifi] exceptionfactory commented on a diff in pull request #6367: NIFI-10435: Masked sensitive properties while writing command arguments to the flow file …

exceptionfactory commented on code in PR #6367:
URL: https://github.com/apache/nifi/pull/6367#discussion_r963636069


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteStreamCommand.java:
##########
@@ -419,14 +420,21 @@ public void onTrigger(ProcessContext context, final ProcessSession session) thro
                 }
                 return 0;
             });
-            for ( final PropertyDescriptor descriptor : propertyDescriptors) {
-                args.add(context.getProperty(descriptor.getName()).evaluateAttributeExpressions(inputFlowFile).getValue());
+            for (final PropertyDescriptor descriptor : propertyDescriptors) {
+                if (descriptor.isSensitive()) {
+                    String value = context.getProperty(descriptor.getName()).evaluateAttributeExpressions(inputFlowFile).getValue();
+                    String maskedValue = IntStream.rangeClosed(0, value.length()).mapToObj(i -> "*").collect(Collectors.joining());

Review Comment:
   Following the example of masked values elsewhere in the application, it would seems better to use a static-length string.



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org