Github user skrewz commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1302#discussion_r97520807
--- 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 --
I went with `setReadable()`/`setWritable()` because of them not tying into
POSIX more than necessary. But I guess we're relying on POSIX anyway. And at
either rate: checking (and erroring out on) the return values indeed is an
omission.
---
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.
---