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

feat: leverage logger to hide sensitive data in ingest logs #2175

Merged
merged 3 commits into from
Nov 29, 2023

Conversation

rbiseck3
Copy link
Contributor

Description

Modify the logger being used by ingest to leverage a new class implemented inheriting logging.Formatter which adds in some middleware to update the message being logged to omit any sensitive content. It does this by dynamically pulled out any valid json from the string being logged and runs that through a hide_sensitive_fields method which updated any values that are considered sensitive. Replaces the original json strings with the json.dumps version of the new dictionary.

@potter-potter
Copy link
Contributor

Very nice. I noticed it left null for the Unstructured api_key when it was missing and then masked it when it was there. Thats great.

@potter-potter
Copy link
Contributor

This is working well and masks all the things that I was finding.

Copy link
Contributor

@potter-potter potter-potter left a comment

Choose a reason for hiding this comment

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

Works great.

@rbiseck3 rbiseck3 added this pull request to the merge queue Nov 29, 2023
Merged via the queue into main with commit 7ad8e88 Nov 29, 2023
46 checks passed
@rbiseck3 rbiseck3 deleted the roman/hide-sensitive-data-ingest-logs-2 branch November 29, 2023 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants