nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.17k stars 4.03k forks source link

Allow custom sensitive values to be filtered out by `OC\Log\ExceptionSerializer` #36611

Open summersab opened 1 year ago

summersab commented 1 year ago

How to use GitHub

Is your feature request related to a problem? Please describe. The OC\Log\ExceptionSerializer class provides a mechanism to redact sensitive values from the log with the SENSITIVE_VALUE_PLACEHOLDER constant. However, some apps and integrations use secret values that should also not be written to the log. For example, the JWT of the OnlyOffice app and the certificates of the SSO & SAML Authentication (user_saml) app should never be written to the log and should be redacted.

Describe the solution you'd like There should be a way to add custom values to the ExceptionSerializer or OC\Log classes in order to have them filtered out of the stack trace and error log.

Describe alternatives you've considered I managed to write an app that registers a custom error logger class to the server which overrides and replaces the default logger. However, if errors occur before all apps are loaded, my custom logger will not be available.

Additional context There are a number of considerations to be made to provide this functionality:

I wouldn't mind tackling this project, but given these sorts of challenges, I wanted to have a discussion to see if anyone had suggestions on how best to proceed.

joshtrichards commented 2 months ago

Related: #32804