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

Logged secrets when :client-id is nil #434

Closed
NoahTheDuke opened this issue Aug 30, 2023 · 2 comments
Closed

Logged secrets when :client-id is nil #434

NoahTheDuke opened this issue Aug 30, 2023 · 2 comments

Comments

@NoahTheDuke
Copy link

Hey Peter!

We use Integrant to do state management and use middleware to attach the subsystems to each request: (-> req (assoc :system/db (:db system)) ...). Occasionally, there's a faulty connection (hard to tell exactly why or how, we're still diving into a related issue) and the :client-id is nil, which trips the line below. This logs the gigantic request to our logs, which includes things like production secrets that are stored in memory only.

Would it be possible to add a flag or some configuration to allow us to avoid logging in this case? We're already dealing with the thrown exception and can log a redacted form of the request as desired.

(timbre/errorf (str err-msg ": %s") ring-req) ; Careful re: % in req

@ptaoussanis ptaoussanis self-assigned this Aug 30, 2023
ptaoussanis added a commit that referenced this issue Aug 30, 2023
Motivations for change:

  1. Full ring req is an unnecessary amount of info, and may
     produce a lot of log noise.

  2. Sensitive info can be (and often is) in ring requests.

  3. Users can anyway catch the exception which includes the
     request if they really need it.

Thanks to @NoahTheDuke for the report!
@ptaoussanis
Copy link
Member

@NoahTheDuke Hi Noah!

Thanks for the clear description of the problem, that was very helpful 🙏

I definitely consider this a bug, there's no need to print the full Ring request here - and the risk is better avoided.

I've just pushed v1.19.2 to Clojars that removes the logging of Ring requests on this error.

Sorry about the trouble!

Cheers :-)

@NoahTheDuke
Copy link
Author

Damn, that's so quick! Thank you!

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

No branches or pull requests

2 participants