[ 
https://issues.apache.org/jira/browse/HADOOP-12942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15228816#comment-15228816
 ] 

Larry McCay commented on HADOOP-12942:
--------------------------------------

This statement is a good place start:

bq. Or to come at this a different way - I can think of no other secure system 
involving a password where the use of a default hardcoded password is common.

This actually is done in a number of systems that I have seen. Calling this a 
secure mechanism is would be too strong even with your proposed change. We are 
talking about levels of protection.

What the keystore based providers are doing is making the clear text password 
in a file permissions protected file a bit better. Both mechanisms require file 
permissions to be thwarted in order to get to the file. However, the clear text 
password in a file can then easily be gotten to with standard tools. There are 
no standard tools that can be used to get to the password in a keystore. 
Keytool doesn't even allow you to read a secret stored this way - whether you 
have the password or not. Not that you can't write a tool to get to it but it 
is still better than the clear text password in a file. Claiming that the 
protection of the keystore with a clear text password in a file or environment 
variable makes it a secure system is a stretch.

The other benefit of the credential provider API is that it provides an 
abstraction and API to easily migrate to a better provider when it comes online.

Warning that the default password is being used is sufficient when the -strict 
flag is absent. The language should make it clear that they have accepted the 
default password but not make it seem like they have done something wrong. 
Dumping the default password into the command line seems a little too public to 
me. What do you think about pointing them to documentation to find out more 
about the default password? We will need to put docs together for this anyway 
and we can pull what I have in trunk and branch-2 in with new language for the 
password protection of the keystore providers.

bq. Please note that when this provider is used in the future, the password 
must also be available to it in the same manner.

I fear that "in the future" is too vague. It reads like a temporal thing 
instead of an "all consumers" thing. It needs to be clear that any clients or 
jobs that require this password have access to the file and the password. I 
think that it only needs to be presented as part of the ERROR language as well. 
If they are accepting the use of the default password then other consumers will 
not have a problem.

This is actually the trickiest part of having the non-default password and will 
be the root cause of lots of support calls/tickets. This is why I am reluctant 
make the use of the default password seem like an error.

I am looking to provide a patch that will move the secrets required by a job 
into the Credentials file during job setup and will make this a moot point 
eventually. Once we have that in place, the only parties that need access to 
the keystores are the ones setting up environments for jobs/applications.

> hadoop credential commands non-obviously use password of "none"
> ---------------------------------------------------------------
>
>                 Key: HADOOP-12942
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12942
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security
>            Reporter: Mike Yoder
>            Assignee: Mike Yoder
>         Attachments: HADOOP-12942.001.patch, HADOOP-12942.002.patch
>
>
> The "hadoop credential create" command, when using a jceks provider, defaults 
> to using the value of "none" for the password that protects the jceks file.  
> This is not obvious in the command or in documentation - to users or to other 
> hadoop developers - and leads to jceks files that essentially are not 
> protected.
> In this example, I'm adding a credential entry with name of "foo" and a value 
> specified by the password entered:
> {noformat}
> # hadoop credential create foo -provider localjceks://file/bar.jceks
> Enter password: 
> Enter password again: 
> foo has been successfully created.
> org.apache.hadoop.security.alias.LocalJavaKeyStoreProvider has been updated.
> {noformat}
> However, the password that protects the file bar.jceks is "none", and there 
> is no obvious way to change that. The practical way of supplying the password 
> at this time is something akin to
> {noformat}
> HADOOP_CREDSTORE_PASSWORD=credpass hadoop credential create --provider ...
> {noformat}
> That is, stuffing HADOOP_CREDSTORE_PASSWORD into the environment of the 
> command. 
> This is more than a documentation issue. I believe that the password ought to 
> be _required_.  We have three implementations at this point, the two 
> JavaKeystore ones and the UserCredential. The latter is "transient" which 
> does not make sense to use in this context. The former need some sort of 
> password, and it's relatively easy to envision that any non-transient 
> implementation would need a mechanism by which to protect the store that it's 
> creating.  
> The implementation gets interesting because the password in the 
> AbstractJavaKeyStoreProvider is determined in the constructor, and changing 
> it after the fact would get messy. So this probably means that the 
> CredentialProviderFactory should have another factory method like the first 
> that additionally takes the password, and an additional constructor exist in 
> all the implementations that takes the password. 
> Then we just ask for the password in getCredentialProvider() and that gets 
> passed down to via the factory to the implementation. The code does have 
> logic in the factory to try multiple providers, but I don't really see how 
> multiple providers would be rationaly be used in the command shell context.
> This issue was brought to light when a user stored credentials for a Sqoop 
> action in Oozie; upon trying to figure out where the password was coming from 
> we discovered it to be the default value of "none".



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to