-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Require Explicitly initialize Email regex mask operator #9
Comments
as an aside, maybe we can also add |
You can configure the enricher to only mask a specific property and ignore the rest like so: new LoggerConfiguration()
.Enrich
.WithSensitiveDataMasking(
options =>
{
options.MaskingOperators.Clear();
options.MaskProperties.AddRange([ "Secrets"; "Password" ]);
}); That will remove all the default masking operators and always mask the Secrets and Password properties. I don’t have a computer handy here to test so while I think this works it might not 😉 |
Good suggestion 👍 |
I've decided to not change the behavior of the configuration just yet as that would break usage if you already have implemented the package in your app. Suddenly the masking would not be active anymore and that's a surprise I don't want to spring on users. In the meantime, if you don't want the default masking operators (or basically, good practice anyway) you should indicate the list of masking operators that are relevant to your application like so: new LoggerConfiguration()
.Enrich
.WithSensitiveDataMasking(
options =>
{
options.MaskingOperators = new List<IMaskingOperator>
{
new EmailAddressMaskingOperator(),
new IbanMaskingOperator()
// etc etc
};
}); I've updated the README to reflect this. In the meantime I've also added a |
I do not intend to mask emails in my logs, only using
MaskProperties
, but this enricher masks emails by default. I also don't have an option to opt-out of this operator either.The issue im having is I have a property that can sometimes be a valid email address but its not required to be. Its simply a human-readable identifier. In the cases that it is an email address, this enricher is masking that value
The text was updated successfully, but these errors were encountered: