Github user alopresto commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1302#discussion_r96318661
--- Diff:
nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java ---
@@ -1027,19 +1028,24 @@ public boolean accept(final File dir, final String
filename) {
cmd.add("-Dorg.apache.nifi.bootstrap.config.log.dir=" +
nifiLogDir);
cmd.add("org.apache.nifi.NiFi");
if (props.containsKey(NIFI_BOOTSTRAP_SENSITIVE_KEY) &&
!StringUtils.isBlank(props.get(NIFI_BOOTSTRAP_SENSITIVE_KEY))) {
- cmd.add("-k " + props.get(NIFI_BOOTSTRAP_SENSITIVE_KEY));
+ File password_file = new File(confDir, "sensitive.key");
+
+ // Restrict permissions:
+ password_file.setReadable(false,false);
--- End diff --
May also want to use
[`setPosixFilePermissions`](https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#setPosixFilePermissions(java.nio.file.Path,%20java.util.Set))
which is a little more intuitive for someone reading later.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---