nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [nifi] natural commented on a change in pull request #3672: NIFI-6363 Additional Sensitive Property Providers
Date Wed, 04 Sep 2019 16:54:40 GMT
natural commented on a change in pull request #3672: NIFI-6363 Additional Sensitive Property

 File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/src/main/java/org/apache/nifi/properties/sensitive/gcp/kms/
 @@ -0,0 +1,187 @@
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import org.apache.commons.lang3.StringUtils;
+import org.bouncycastle.util.encoders.Base64;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.nio.charset.StandardCharsets;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+ * This provider uses the GCP SDK to interact with the GCP KMS.  Values are encoded/decoded
base64, using the
+ * standard encoders from bouncycastle.
+ */
+public class GCPKMSSensitivePropertyProvider implements SensitivePropertyProvider {
+    private static final Logger logger = LoggerFactory.getLogger(GCPKMSSensitivePropertyProvider.class);
+    private static final String IMPLEMENTATION_NAME = "GCP KMS Sensitive Property Provider";
+    private static final String MATERIAL_PREFIX = "gcp";
+    private static final String MATERIAL_KEY_TYPE = "kms";
+    private static final String MATERIAL_SEPARATOR = "/";
+    private String keyId;
+    private String projectId;
+    private String locationId;
+    private String keyRingId;
+    private String cryptoKeyId;
+    private final String resource;
+    private final KeyManagementServiceClient client;
+    public GCPKMSSensitivePropertyProvider(String keyId) {
+        if (StringUtils.isBlank(System.getenv("GOOGLE_APPLICATION_CREDENTIALS"))) {
 Review comment:
   I'm reluctant to change this behavior because it matches the recommendations (
   Also, these SPP classes need their configuration to exist outside of nifi (in system props,
environment vars, etc) so I'm not sure if we can prevent bad things from happening in these
   For now I think we're going to resolve this via documentation.
   Thanks again for the feedback.  If I've missed something or if you feel strongly about
this, please let me know.

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.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

View raw message