[
https://issues.apache.org/jira/browse/HADOOP-12942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15227089#comment-15227089
]
Larry McCay commented on HADOOP-12942:
--------------------------------------
Hi [~yoderme] - Sorry for the delay in review. I am really underwater with
other things. I have taken a quick look at this and think that it is looking a
lot better.
Comments:
1. WARN messages (without strict flag): read too much like ERRORs. It should be
talking about the fact that a unique password could be used by provisioning it
in one of the following ways instead of it was expected to be found here or
there. It is perfectly legitimate to use the static/hardcoded password. I think
that this can be done easily with minor changes to the language.
2. There is a bit more language that is too strongly leaning toward ERROR. For
instance, there are cases where it is being communicated that a provider
*requires* a password and none is given. Interesting word play aside, there is
one given it happens to be the default one. Basically, I would like to see the
semantics of the -strict flag as indicating a desire for a unique or custom
password to be used and the lack of the -strict flag as accepting the default
password.
3. It would also be good to let the user know that when a custom password is
being used that it must be available to the runtime consumers of it as well.
The trick is communicating all of this without spitting out a book.
4. I'm not sure that the hardcoded password needs to be emitted on the command
line in order to satisfy "obviousness". I would rather see it be referred to as
the default password. The default password can easily be documented in the
command or credential provider docs so that it can be found, when needed.
5. I think we should take this opportunity to revisit the 700 file permissions
and change it to 600 - unless there is some reason that 700 is needed.
That's as deep as I could dig in today. There are a couple things that I would
like to dig deeper into like the consolidation of some caught keystore
exceptions and minor loss of context. I can't tell if some refactoring made the
previous exceptions not possible anymore or what.
> 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)