AMBARI-25043. Make sure we mask password properties when fetching sensitive Ambari configuration via the API (just like we do it for service configs)#2763
Merged
Conversation
…itive ambari configuration thru the API (just like we do it for service configs)
|
Refer to this link for build results (access rights to CI server needed): |
zeroflag
approved these changes
Jan 14, 2019
Contributor
|
there are some typos in the PR title |
ghost
approved these changes
Jan 14, 2019
| } | ||
| final Map<String, String> maskedMap = new HashMap<>(); | ||
| for (Map.Entry<String, String> property : propertyMap.entrySet()) { | ||
| String value = property.getKey().toLowerCase().contains(PASSWORD_TEXT) || property.getKey().toLowerCase().contains(PASSWD_TEXT) ? secretPrefix |
There was a problem hiding this comment.
We may move property.getKey().toLowerCase() to separate variable to restrict the overall string length
Contributor
Author
There was a problem hiding this comment.
a new private method is added
…perty is password or not (therefore it should be masked)
Contributor
Author
fixed; thanks |
|
Refer to this link for build results (access rights to CI server needed): |
vishalsuvagia
pushed a commit
to vishalsuvagia/ambari
that referenced
this pull request
Feb 26, 2019
…sitive Ambari configuration via the API (just like we do it for service configs) (apache#2763)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Like I indicated in #2742 the API returned the encrypted form instead of a secret reference (this is what we do for service configs). From now on we are in synch with service configurations.
How was this patch tested?
Running JUnit tests in
ambari-server:Additionally I executed some E2E tests and found that passwords are masked by
SECRET: