-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
HDFS-16563. Namenode WebUI prints sensitive information on Token expiry #4241
Conversation
@hemanthboyina @Hexiaoqiao Can you please review the PR when you get time? |
thank you @prasad-acit for the PR, looks the test case failures are related, can you have a look once |
@prasad-acit Thanks for involving me here. IMO, the key and sensitive information is DelegationKey/Password for DelegationToken, the output message here does not include this information right? So I don't think it it security issue. Do you mind to more information about this output or stack demo? Thanks. |
looks like there are some big assumptions about the nested stack trace coming back. so please restore that change and see what happens if the issue is that toString leaks a secret, it should be fixed at that level, as it is likely to end up in logs. we don't want any output to expose secrets. |
Thanks @hemanthboyina @Hexiaoqiao @steveloughran for the quick review & feedback.
Yes, there is no password printed in it. But as per our internal security guidelines displaying the complete Token info is also prohibited. So, suppressed the token from being displayed in the browser.
Logging exception or full stack has no issue in this case. We are trying to avoid the token in the browser and keep the message abstract to the end-user. Here additional information is not necessary which can be avoided in the browser. Failed tests corrected, please review the changes. |
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.
It was quite useful to find the root cause of a few token renewal bugs (KMS, YARN.. etc) back in the days. If it doesn't actually expose token secrets, would it make sense to at least log the token id at debug level?
Thanks @jojochuang I have added logs with Token Info. |
Javadoc issues are not related. |
💔 -1 overall
This message was automatically generated. |
LGTM; will leave final vote to @jojochuang |
Thanks @steveloughran for the review. |
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.
I'm happy with this; it's logging at info.
one minor change, just switching to the slf4j {} expansion strings. we should do this for all new log entries, -a lot of the existing stuff is a migration from the restricted commong logging api
err = | ||
"Token has" + identifier.getRealUser() + "expired, current time: " + Time.formatTime(now) | ||
+ " expected renewal time: " + Time.formatTime(info.getRenewDate()); | ||
LOG.info(err + ", Token=" + formatTokenId(identifier)); |
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.
can you use
LOG.info("{}, Token={}", err, formatTokenId(identifier));
throw new InvalidToken("token " + formatTokenId(identifier) | ||
+ " can't be found in cache"); | ||
err = "Token for real user: " + identifier.getRealUser() + ", can't be found in cache"; | ||
LOG.warn(err + ", Token=" + formatTokenId(identifier)); |
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.
can you use
LOG.warn("{}, Token={}", err, formatTokenId(identifier));
💔 -1 overall
This message was automatically generated. |
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.
+1, merging. thanks!
…ry (#4241) Contributed by Renukaprasad C Change-Id: I5cd2cec1dd79917f810207821b3bdf4fe1a5d24c
Thanks @steveloughran |
…ry (apache#4241) Contributed by Renukaprasad C
Description of PR
How was this patch tested?
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?