Skip to content
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

Obfuscate token for lookupACL error #1837

Merged
merged 2 commits into from
Jul 5, 2016

Conversation

calvn
Copy link
Contributor

@calvn calvn commented Mar 15, 2016

Attempt to obfuscate the ACL token if it's long enough as the current log message exposes the entire token. Token lookup can be for an ACL with sufficiently open (and therefore dangerous) policy, such as the master ACL token.

s := id
// Print last 3 chars of the token if long enough, otherwise completly hide it
if len(s) > 3 {
s = fmt.Sprintf("token ending in '%s'", s[len(s)-1:])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be taking just the last one character. Is that intended?

Copy link
Contributor Author

@calvn calvn Jul 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, it's supposed to be len(s)-3. I'll submit the change shortly.

@ryanuber
Copy link
Member

ryanuber commented Jul 5, 2016

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants