destructurama / attributed

Use attributes to control how complex types are logged to Serilog.
Apache License 2.0
269 stars 33 forks source link

Provide ability to default records to masked, with override on specific properties #63

Closed dan-drews closed 9 months ago

dan-drews commented 1 year ago

Good morning!

We are working on a project where we deal with a decent amount of sensitive data, and while logs are very useful, there are concerns about us adding new types, and forgetting to Mask a field (or many fields) on it.

It'd be nice if when we initialize Destructurama we could make a property such as MaskUnlessAllowed.

This would implicitly apply LogMasked to every field, unless that field specifically had AllowLog or something along those lines.

If we have the bandwidth to do so, we may take a stab at this on our end and submit a PR for it. Would this feature be accepted if added? If so, any feedback on approach or naming?

Thanks!

sungam3r commented 1 year ago

we could make a property such as MaskUnlessAllowed

Where ?

dan-drews commented 1 year ago

In program.cs

.Destructure.UsingAttributes(DestructureMethod.MaskUnlessAllowed)

sungam3r commented 1 year ago

While theoretically it is possible the main question is how existing attributes should work in that case? Note that UsingAttributes is not about masking values. It is about destructuring objects using specific rules programmed through attributes. Masking is just a one of such rules. This package provides some attributes and some of them do not relate to masking, for example, LogWithNameAttribute. Someone else may have custom attribute too.

github-actions[bot] commented 9 months ago

This issue was marked as stale since it has not been active for a long time

sungam3r commented 9 months ago

Closed due to inactivity.