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

Add a redactor mechanism to prevent leaks of credentials and confiden… #788

Closed
wants to merge 1 commit into from

Conversation

JLugagne
Copy link

@JLugagne JLugagne commented Jul 16, 2018

I think It would be nice to have a redactor mechanism to hide credentials and confidentials data to prevent any leaks or compromising data in logs.

Here is a proposition to do it, I'm not sure it fit very well the architecture (as it is at the end of the process on the serialized data) but seems to be working.

I know I could have done it by overriding the JSONFormatter and TextFormatter but as it should be a standard feature (IMHO) I wanted to have it as is.

@dgsb
Copy link
Collaborator

dgsb commented Jul 20, 2018

We already have the system of hooks for implementing modification of the content of a log entry. I don't think we need another registration for a function pointer to alter the content of a log.

@dgsb
Copy link
Collaborator

dgsb commented Jul 30, 2018

@JLugagne just getting back to you. Did you succeed to implement your feature with hooks ?

@JLugagne
Copy link
Author

Thank you @dgsb for getting back, I didn't tried the hook yet but I did succeed by doing my RedactorFormatter based on JSONFormatter, it is working fine, I will try hooks later.

mkenney added a commit to bdlm/log that referenced this pull request Aug 12, 2018
* sirupsen/logrus/pull/664
* sirupsen/logrus/pull/647
* sirupsen/logrus/pull/687
* sirupsen/logrus/pull/685
* sirupsen/logrus/pull/788 (existed previously)

This also
* updates the string escape logic, all values are now JSON escaped
* fixes an issue with internal properties being included in JSON format
* adds new fields to unit tests (`data` and `caller`)
* minor cleanup of text templates
@dgsb
Copy link
Collaborator

dgsb commented Aug 26, 2018

We already have the needed logic in logrus to implement this.

@dgsb dgsb closed this Aug 26, 2018
ivucica pushed a commit to ivucica/bdlm-log that referenced this pull request Sep 28, 2020
* sirupsen/logrus/pull/664
* sirupsen/logrus/pull/647
* sirupsen/logrus/pull/687
* sirupsen/logrus/pull/685
* sirupsen/logrus/pull/788 (existed previously)

This also
* updates the string escape logic, all values are now JSON escaped
* fixes an issue with internal properties being included in JSON format
* adds new fields to unit tests (`data` and `caller`)
* minor cleanup of text templates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants