-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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): |
|
there are some typos in the PR title |
| } | ||
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may move property.getKey().toLowerCase() to separate variable to restrict the overall string length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a new private method is added
…perty is password or not (therefore it should be masked)
fixed; thanks |
|
Refer to this link for build results (access rights to CI server needed): |
…sitive Ambari configuration via the API (just like we do it for service configs) (apache#2763)
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: