Skip to content

Instantly share code, notes, and snippets.

@alopresto
Created August 25, 2017 19:28
Show Gist options
  • Save alopresto/28e748358455e93bfc774556ba820b6e to your computer and use it in GitHub Desktop.
Save alopresto/28e748358455e93bfc774556ba820b6e to your computer and use it in GitHub Desktop.
Apache NiFi flow which encrypts and decrypts arbitrary text.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flowController encoding-version="1.1">
<maxTimerDrivenThreadCount>10</maxTimerDrivenThreadCount>
<maxEventDrivenThreadCount>5</maxEventDrivenThreadCount>
<rootGroup>
<id>0aeb4b5d-015e-1000-5a72-af7f84fd3776</id>
<name>NiFi Flow</name>
<position x="0.0" y="0.0"/>
<comment/>
<processor>
<id>015e1003-7300-166c-e2d3-6aded7d27922</id>
<name>LogAttribute</name>
<position x="1019.4999694824219" y="723.0"/>
<styles/>
<comment/>
<class>org.apache.nifi.processors.standard.LogAttribute</class>
<bundle>
<group>org.apache.nifi</group>
<artifact>nifi-standard-nar</artifact>
<version>1.4.0-SNAPSHOT</version>
</bundle>
<maxConcurrentTasks>1</maxConcurrentTasks>
<schedulingPeriod>0 sec</schedulingPeriod>
<penalizationPeriod>30 sec</penalizationPeriod>
<yieldPeriod>1 sec</yieldPeriod>
<bulletinLevel>WARN</bulletinLevel>
<lossTolerant>false</lossTolerant>
<scheduledState>STOPPED</scheduledState>
<schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
<executionNode>ALL</executionNode>
<runDurationNanos>0</runDurationNanos>
<property>
<name>Log Level</name>
<value>info</value>
</property>
<property>
<name>Log Payload</name>
<value>true</value>
</property>
<property>
<name>Attributes to Log</name>
</property>
<property>
<name>attributes-to-log-regex</name>
<value>.*</value>
</property>
<property>
<name>Attributes to Ignore</name>
</property>
<property>
<name>attributes-to-ignore-regex</name>
</property>
<property>
<name>Log prefix</name>
</property>
<property>
<name>character-set</name>
<value>UTF-8</value>
</property>
<autoTerminatedRelationship>success</autoTerminatedRelationship>
</processor>
<processor>
<id>0aec07a7-015e-1000-24fa-2595a84fdfa3</id>
<name>GenerateFlowFile</name>
<position x="1019.4999694824219" y="-61.39999198913574"/>
<styles/>
<comment/>
<class>org.apache.nifi.processors.standard.GenerateFlowFile</class>
<bundle>
<group>org.apache.nifi</group>
<artifact>nifi-standard-nar</artifact>
<version>1.4.0-SNAPSHOT</version>
</bundle>
<maxConcurrentTasks>1</maxConcurrentTasks>
<schedulingPeriod>1 sec</schedulingPeriod>
<penalizationPeriod>30 sec</penalizationPeriod>
<yieldPeriod>1 sec</yieldPeriod>
<bulletinLevel>WARN</bulletinLevel>
<lossTolerant>false</lossTolerant>
<scheduledState>STOPPED</scheduledState>
<schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
<executionNode>ALL</executionNode>
<runDurationNanos>0</runDurationNanos>
<property>
<name>File Size</name>
<value>0B</value>
</property>
<property>
<name>Batch Size</name>
<value>1</value>
</property>
<property>
<name>Data Format</name>
<value>Text</value>
</property>
<property>
<name>Unique FlowFiles</name>
<value>false</value>
</property>
<property>
<name>generate-ff-custom-text</name>
<value>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;soap:Body&gt;
&lt;Response xmlns=""&gt;
&lt;Result&gt;
&lt;ResponseStatus&gt;false&lt;/ResponseStatus&gt;
&lt;Error&gt;
&lt;ErrorCode&gt;-7&lt;/ErrorCode&gt;
&lt;ErrorDescription&gt;not foudn&lt;/ErrorDescription&gt;
&lt;/Error&gt;
&lt;/Result&gt;
&lt;/Response&gt;
&lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;</value>
</property>
</processor>
<processor>
<id>015e1000-7300-166c-104d-eafd14c6fbcc</id>
<name>DecryptContent</name>
<position x="1019.4999694824219" y="544.0"/>
<styles/>
<comment/>
<class>org.apache.nifi.processors.standard.EncryptContent</class>
<bundle>
<group>org.apache.nifi</group>
<artifact>nifi-standard-nar</artifact>
<version>1.4.0-SNAPSHOT</version>
</bundle>
<maxConcurrentTasks>1</maxConcurrentTasks>
<schedulingPeriod>0 sec</schedulingPeriod>
<penalizationPeriod>30 sec</penalizationPeriod>
<yieldPeriod>1 sec</yieldPeriod>
<bulletinLevel>WARN</bulletinLevel>
<lossTolerant>false</lossTolerant>
<scheduledState>STOPPED</scheduledState>
<schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
<executionNode>ALL</executionNode>
<runDurationNanos>0</runDurationNanos>
<property>
<name>Mode</name>
<value>Decrypt</value>
</property>
<property>
<name>key-derivation-function</name>
<value>NONE</value>
</property>
<property>
<name>Encryption Algorithm</name>
<value>AES_GCM</value>
</property>
<property>
<name>allow-weak-crypto</name>
<value>not-allowed</value>
</property>
<property>
<name>Password</name>
<value>enc{f789824a699f063dfc36542dbc198126a652d40847a9986324382e680e0f92b5bf36edc1778407db7afd78ba72e62ad9}</value>
</property>
<property>
<name>raw-key-hex</name>
<value>enc{6ae770a2aeed36cf9a340e283eba0a7d8931c8698f718372966709a86157583b0b513091be4946659340e2b879b7ac2997685648375eb0728a3018a0a58aba95}</value>
</property>
<property>
<name>public-keyring-file</name>
</property>
<property>
<name>public-key-user-id</name>
</property>
<property>
<name>private-keyring-file</name>
</property>
<property>
<name>private-keyring-passphrase</name>
</property>
<autoTerminatedRelationship>failure</autoTerminatedRelationship>
</processor>
<processor>
<id>166c7300-015e-1000-7188-be91de2d597f</id>
<name>EncryptContent</name>
<position x="1019.4999694824219" y="172.0"/>
<styles/>
<comment/>
<class>org.apache.nifi.processors.standard.EncryptContent</class>
<bundle>
<group>org.apache.nifi</group>
<artifact>nifi-standard-nar</artifact>
<version>1.4.0-SNAPSHOT</version>
</bundle>
<maxConcurrentTasks>1</maxConcurrentTasks>
<schedulingPeriod>0 sec</schedulingPeriod>
<penalizationPeriod>30 sec</penalizationPeriod>
<yieldPeriod>1 sec</yieldPeriod>
<bulletinLevel>WARN</bulletinLevel>
<lossTolerant>false</lossTolerant>
<scheduledState>STOPPED</scheduledState>
<schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
<executionNode>ALL</executionNode>
<runDurationNanos>0</runDurationNanos>
<property>
<name>Mode</name>
<value>Encrypt</value>
</property>
<property>
<name>key-derivation-function</name>
<value>NONE</value>
</property>
<property>
<name>Encryption Algorithm</name>
<value>AES_GCM</value>
</property>
<property>
<name>allow-weak-crypto</name>
<value>not-allowed</value>
</property>
<property>
<name>Password</name>
<value>enc{6b2877ec35511759296a17c4c4da8292d856762a7e0719d28225e76f6b4fb9773f03f7062822189bdae0e4c2f22724e5}</value>
</property>
<property>
<name>raw-key-hex</name>
<value>enc{783ce602859c82d99094f9d942811896f49566bbd8404afecb45724316b7b4995fed013dfaf9681a38a39c062ec2f30356a88e68b80b071005817650b93e6c0c}</value>
</property>
<property>
<name>public-keyring-file</name>
</property>
<property>
<name>public-key-user-id</name>
</property>
<property>
<name>private-keyring-file</name>
</property>
<property>
<name>private-keyring-passphrase</name>
</property>
<autoTerminatedRelationship>failure</autoTerminatedRelationship>
</processor>
<processor>
<id>015e1000-3fce-1aec-4ed8-3f787a834b8c</id>
<name>LogAttribute</name>
<position x="1019.4999694824219" y="367.0"/>
<styles/>
<comment/>
<class>org.apache.nifi.processors.standard.LogAttribute</class>
<bundle>
<group>org.apache.nifi</group>
<artifact>nifi-standard-nar</artifact>
<version>1.4.0-SNAPSHOT</version>
</bundle>
<maxConcurrentTasks>1</maxConcurrentTasks>
<schedulingPeriod>0 sec</schedulingPeriod>
<penalizationPeriod>30 sec</penalizationPeriod>
<yieldPeriod>1 sec</yieldPeriod>
<bulletinLevel>WARN</bulletinLevel>
<lossTolerant>false</lossTolerant>
<scheduledState>STOPPED</scheduledState>
<schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
<executionNode>ALL</executionNode>
<runDurationNanos>0</runDurationNanos>
<property>
<name>Log Level</name>
<value>info</value>
</property>
<property>
<name>Log Payload</name>
<value>true</value>
</property>
<property>
<name>Attributes to Log</name>
</property>
<property>
<name>attributes-to-log-regex</name>
<value>.*</value>
</property>
<property>
<name>Attributes to Ignore</name>
</property>
<property>
<name>attributes-to-ignore-regex</name>
</property>
<property>
<name>Log prefix</name>
</property>
<property>
<name>character-set</name>
<value>UTF-8</value>
</property>
</processor>
<connection>
<id>015e1001-7300-166c-1d05-cd60795ffd39</id>
<name/>
<bendPoints/>
<labelIndex>1</labelIndex>
<zIndex>0</zIndex>
<sourceId>015e1000-3fce-1aec-4ed8-3f787a834b8c</sourceId>
<sourceGroupId>0aeb4b5d-015e-1000-5a72-af7f84fd3776</sourceGroupId>
<sourceType>PROCESSOR</sourceType>
<destinationId>015e1000-7300-166c-104d-eafd14c6fbcc</destinationId>
<destinationGroupId>0aeb4b5d-015e-1000-5a72-af7f84fd3776</destinationGroupId>
<destinationType>PROCESSOR</destinationType>
<relationship>success</relationship>
<maxWorkQueueSize>10000</maxWorkQueueSize>
<maxWorkQueueDataSize>1 GB</maxWorkQueueDataSize>
<flowFileExpiration>0 sec</flowFileExpiration>
</connection>
<connection>
<id>015e1004-7300-166c-cb40-95c6a231c1b4</id>
<name/>
<bendPoints/>
<labelIndex>1</labelIndex>
<zIndex>0</zIndex>
<sourceId>015e1000-7300-166c-104d-eafd14c6fbcc</sourceId>
<sourceGroupId>0aeb4b5d-015e-1000-5a72-af7f84fd3776</sourceGroupId>
<sourceType>PROCESSOR</sourceType>
<destinationId>015e1003-7300-166c-e2d3-6aded7d27922</destinationId>
<destinationGroupId>0aeb4b5d-015e-1000-5a72-af7f84fd3776</destinationGroupId>
<destinationType>PROCESSOR</destinationType>
<relationship>success</relationship>
<maxWorkQueueSize>10000</maxWorkQueueSize>
<maxWorkQueueDataSize>1 GB</maxWorkQueueDataSize>
<flowFileExpiration>0 sec</flowFileExpiration>
</connection>
<connection>
<id>166c95bd-015e-1000-1055-d6d0b7308671</id>
<name/>
<bendPoints/>
<labelIndex>1</labelIndex>
<zIndex>0</zIndex>
<sourceId>0aec07a7-015e-1000-24fa-2595a84fdfa3</sourceId>
<sourceGroupId>0aeb4b5d-015e-1000-5a72-af7f84fd3776</sourceGroupId>
<sourceType>PROCESSOR</sourceType>
<destinationId>166c7300-015e-1000-7188-be91de2d597f</destinationId>
<destinationGroupId>0aeb4b5d-015e-1000-5a72-af7f84fd3776</destinationGroupId>
<destinationType>PROCESSOR</destinationType>
<relationship>success</relationship>
<maxWorkQueueSize>10000</maxWorkQueueSize>
<maxWorkQueueDataSize>1 GB</maxWorkQueueDataSize>
<flowFileExpiration>0 sec</flowFileExpiration>
</connection>
<connection>
<id>015e1001-3fce-1aec-b6fb-ac03aba251d2</id>
<name/>
<bendPoints/>
<labelIndex>1</labelIndex>
<zIndex>0</zIndex>
<sourceId>166c7300-015e-1000-7188-be91de2d597f</sourceId>
<sourceGroupId>0aeb4b5d-015e-1000-5a72-af7f84fd3776</sourceGroupId>
<sourceType>PROCESSOR</sourceType>
<destinationId>015e1000-3fce-1aec-4ed8-3f787a834b8c</destinationId>
<destinationGroupId>0aeb4b5d-015e-1000-5a72-af7f84fd3776</destinationGroupId>
<destinationType>PROCESSOR</destinationType>
<relationship>success</relationship>
<maxWorkQueueSize>10000</maxWorkQueueSize>
<maxWorkQueueDataSize>1 GB</maxWorkQueueDataSize>
<flowFileExpiration>0 sec</flowFileExpiration>
</connection>
</rootGroup>
<controllerServices/>
<reportingTasks/>
</flowController>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment