Serilog.Enrichers.Sensitive icon indicating copy to clipboard operation
Serilog.Enrichers.Sensitive copied to clipboard

Exceptions are not masked

Open siewers opened this issue 1 year ago • 16 comments

This is not something that can be easily fixed in an enricher, but would require changes to the sinks being used. Exceptions are immutable but might contain sensitive data anywhere in the message or stack trace. It might be possible to recursively mask exceptions using reflection, but it doesn't sound like a good or safe solution. What I ended up doing was to simply rewrite the sinks I use to have them mask the serialized LogEvents.

As an example, a database constraint might contain a value, e.g. an email address, which, when violated, isn't handled by this enricher.

Any ideas?

siewers avatar Sep 20 '22 06:09 siewers