Github user alopresto commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1302#discussion_r96319129
  
    --- 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 don't think the owner of the file is set anywhere. By default, if Java 
creates a file it inherits the currently-running process as the owner. We can 
do that with [`setOwner`](http://stackoverflow.com/a/28829177/70465) -- 
[example of how to set the permissions and owner 
safely](http://stackoverflow.com/a/32165319/70465). 


---
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.
---

Reply via email to