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

KNOX-2578 - TokenResource logging token UUIDs #434

Merged
merged 1 commit into from Apr 14, 2021

Conversation

pzampino
Copy link
Contributor

What changes were proposed in this pull request?

Replace the logging of Knox token UUIDs in TokenResource with masked representations which are safe to present in logs.

How was this patch tested?

mvn -Ppackage,release clean install

  1. Installed the gateway and enabled DEBUG logging.
  2. Deployed the KNOXTOKEN service with server-managed state enabled.
  3. Deployed a topology with the JWTProvider (server-managed state enabled) and WEBHDFS.
  4. Requested a token.
  5. curl -ivku Token:$TOKEN "https://localhost:8443/gateway/pz-demo/webhdfs/v1/?op=LISTSTATUS"
  6. curl -ivku Passcode:$PASSCODE "https://localhost:8443/gateway/pz-demo/webhdfs/v1/tmp?op=LISTSTATUS"
  7. Performed the same with invalid token/passcode (to verify UnknownTokenException contents).
  8. Grepped the logs for (\S){8}-(\S){4}-(\S){4}-(\S){4}-(\S){12} - confirmed no matches
  9. Grepped the logs for (\S){8}.{3}(\S){12} - confirmed matches

Copy link
Contributor

@smolnar82 smolnar82 left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks for the detailed testing information.
I also went thru on that class locally and it seems these were the only remaining logs.

Copy link
Contributor

@moresandeep moresandeep left a comment

Choose a reason for hiding this comment

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

Looks good!

@pzampino pzampino merged commit fcac9b2 into apache:master Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants