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

OAuth Slack Token Logged In Clear #844

Closed
christophercutajar opened this issue Nov 9, 2020 · 12 comments · Fixed by #1215
Closed

OAuth Slack Token Logged In Clear #844

christophercutajar opened this issue Nov 9, 2020 · 12 comments · Fixed by #1215

Comments

@christophercutajar
Copy link

Describe the bug

While using Argo Event which leverage slack-go/slack for Slack triggers, it was noticed that the OAuth Slack token is logged in the clear. Specifically,

slack/chat.go

Line 217 in 686c209

api.Debugf("Sending request: %s", string(reqBody))
is logging the whole API request resulting in also logging a clear version of the OAuth slack token in the log files. The following is an example:

sensor-qrlrb-58d497d595-q9dmh main 2020-11-09T10:11:50.147597554Z slack-go/slack2020/11/09 10:11:50 chat.go:217: Sending request: channel=random&text=webhook+triggered%21&token=xoxb-xxxx-xxx-xxx

Expected behavior

OAuth Slack token not never be logged in the clear in the log files.

Argo Events related issue: argoproj/argo-events#944

@kanata2
Copy link
Member

kanata2 commented Nov 10, 2020

Thanks for reporting.
As you said in argoproj/argo-events#944, api.Debugf writes only if debug mode is enabled.
So I think it's not a bug 🤔
What do you think?

@christophercutajar
Copy link
Author

For the Argo part, I agree with you, the api.Debugf should be false.

In general, my personal opinion is that I don't think such token should be logged in the log files even in debug mode.

@kanata2
Copy link
Member

kanata2 commented Nov 10, 2020

Okay, it seems good to me. Please send a PR?

@christophercutajar
Copy link
Author

@kanata2 will be able to submit a PR in the coming 2 days.

@kanata2
Copy link
Member

kanata2 commented Nov 11, 2020

Thanks!

@kanata2 kanata2 added the feedback given When a review has been conducted and awaiting the response from the comitter(s) label Nov 24, 2020
@kanata2
Copy link
Member

kanata2 commented Apr 18, 2021

@christophercutajar I'll close it once, but feel free to re-open it or send us a pull request if you want!

@kanata2 kanata2 closed this as completed Apr 18, 2021
@briemarie
Copy link

@kanata2 We're seeing the same behavior of the token being printed out into our logs. We've updated to the latest version as of today v0.11.2 but still getting the printout. We have these debug logs being stored in dashboards so this is a major problem. Has it been fixed? It is never ideal to have tokens printed in any logs, debug or dev or whatever.

@christophercutajar
Copy link
Author

@kanata2 my apologies I wasn't able to create a PR for this. Can you re-open the ticket please as not I'm able to work on this.

@briemarie this wasn't solved from my end :(

@briemarie
Copy link

@christophercutajar and @kanata2 I opened a PR on a fork for you to review. Not sure if this is the kind of approach that is best or if the token should instead not be passed into the method calls, but I think this is a good approach since it is useful to know if a token was supplied or if it was empty.
#1102

@kanata2 kanata2 added needs investigation and removed feedback given When a review has been conducted and awaiting the response from the comitter(s) labels Aug 25, 2022
@kanata2
Copy link
Member

kanata2 commented Aug 25, 2022

Thanks @briemarie! I'll confirm later.

@qwerty1q2w
Copy link

Hi! +1 The same problems. Token in logs.

@daabr
Copy link
Contributor

daabr commented Jul 14, 2023

I sent now a proposed simpler fix: #1215

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

Successfully merging a pull request may close this issue.

5 participants