<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: NiFi - How to store a password and pass it to flowfile content in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NiFi-How-to-store-a-password-and-pass-it-to-flowfile-content/m-p/374651#M242076</link>
    <description>&lt;P&gt;You should be able to create a custom scripted processor and define an attribute that's sensitive so once you set it...it won't be visible. You might be able to handle your whole process inside the script so the password never gets written out. I've written several in Groovy. An alternative option is to leverage something like Vault (&lt;A href="https://www.vaultproject.io/" target="_blank"&gt;Vault by HashiCorp (vaultproject.io)&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;PropertyDescriptor&lt;/SPAN&gt;&lt;SPAN&gt; OAUTH_TOKEN &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;PropertyDescriptor.Builder&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .name(&lt;/SPAN&gt;&lt;SPAN&gt;"oAuth Token"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .displayName(&lt;/SPAN&gt;&lt;SPAN&gt;"oAuth Token"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .description(&lt;/SPAN&gt;&lt;SPAN&gt;"oAuth Token"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .required(&lt;/SPAN&gt;&lt;SPAN&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .sensitive(&lt;/SPAN&gt;&lt;SPAN&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .addValidator(&lt;/SPAN&gt;&lt;SPAN&gt;StandardValidators&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;NON_EMPTY_VALIDATOR)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .build()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Sat, 29 Jul 2023 18:16:32 GMT</pubDate>
    <dc:creator>joseomjr</dc:creator>
    <dc:date>2023-07-29T18:16:32Z</dc:date>
    <item>
      <title>NiFi - How to store a password and pass it to flowfile content</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-How-to-store-a-password-and-pass-it-to-flowfile-content/m-p/374017#M241855</link>
      <description>&lt;P&gt;I've developed a flow that depends on importing an Oracle database dump via data pump (i.e., the impdp command). To run this command, you have to pass in the username and password as part of the parameters of the impdp command to connect to the Oracle database. In early development, I simply put the password in a non-sensitive parameter, and at the appropriate time, I'm using a ReplaceText processor to wipe out the current contents of the flowfile and write in the contents of the shell script used to run the impdp command. Of course, the text I'm writing in to the flowfile includes #{oracle_pw}. I then PutFile to write the script to disk and ExecuteStreamCommand to run the script. It works like a charm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now that development is over and we're making plans to move this flow into production, I need a way to make this password parameter sensitive and still be able to pass it in to the script. I've given this a lot of thought and done some research, but it seems like I might need to reach beyond the confines of NiFi to make this happen. One thought was to ensure the OS account NiFi is using already has all the Oracle stuff in its path, and then instead of creating and running a script, pass the impdp command directly via ExecuteStreamCommand, but again, non-sensitive properties (i.e., command.argument.1, command.argument.2, etc.) cannot contain sensitive parameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate any help in brainstorming how to accomplish this. Here are the basic contents of the script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#!/bin/bash&lt;/P&gt;&lt;P&gt;eval "$(grep 'ORACLE_BASE=' /home/oracle/.bash_profile)"&lt;/P&gt;&lt;P&gt;eval "$(grep 'ORACLE_HOME=' /home/oracle/.bash_profile)"&lt;/P&gt;&lt;P&gt;PATH=$PATH:$ORACLE_HOME/bin&lt;/P&gt;&lt;P&gt;export ORACLE_BASE ORACLE_HOME PATH&lt;/P&gt;&lt;P&gt;impdp oracleuser/#{oracle_pw}@//oracleserver/oracledatabase more parameters, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 11:16:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-How-to-store-a-password-and-pass-it-to-flowfile-content/m-p/374017#M241855</guid>
      <dc:creator>noncitizen</dc:creator>
      <dc:date>2023-07-18T11:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi - How to store a password and pass it to flowfile content</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-How-to-store-a-password-and-pass-it-to-flowfile-content/m-p/374651#M242076</link>
      <description>&lt;P&gt;You should be able to create a custom scripted processor and define an attribute that's sensitive so once you set it...it won't be visible. You might be able to handle your whole process inside the script so the password never gets written out. I've written several in Groovy. An alternative option is to leverage something like Vault (&lt;A href="https://www.vaultproject.io/" target="_blank"&gt;Vault by HashiCorp (vaultproject.io)&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;PropertyDescriptor&lt;/SPAN&gt;&lt;SPAN&gt; OAUTH_TOKEN &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;PropertyDescriptor.Builder&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .name(&lt;/SPAN&gt;&lt;SPAN&gt;"oAuth Token"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .displayName(&lt;/SPAN&gt;&lt;SPAN&gt;"oAuth Token"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .description(&lt;/SPAN&gt;&lt;SPAN&gt;"oAuth Token"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .required(&lt;/SPAN&gt;&lt;SPAN&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .sensitive(&lt;/SPAN&gt;&lt;SPAN&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .addValidator(&lt;/SPAN&gt;&lt;SPAN&gt;StandardValidators&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;NON_EMPTY_VALIDATOR)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .build()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 29 Jul 2023 18:16:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-How-to-store-a-password-and-pass-it-to-flowfile-content/m-p/374651#M242076</guid>
      <dc:creator>joseomjr</dc:creator>
      <dc:date>2023-07-29T18:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi - How to store a password and pass it to flowfile content</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-How-to-store-a-password-and-pass-it-to-flowfile-content/m-p/374740#M242116</link>
      <description>&lt;P&gt;Thanks for the suggestions. I ended up moving everything to stored procedures in the database, which are run under the existing context (service), so no need for a sensitive parameter.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 12:34:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-How-to-store-a-password-and-pass-it-to-flowfile-content/m-p/374740#M242116</guid>
      <dc:creator>noncitizen</dc:creator>
      <dc:date>2023-07-31T12:34:07Z</dc:date>
    </item>
  </channel>
</rss>

