Added masking

This commit is contained in:
2024-08-15 21:48:41 +02:00
parent 7e41f8108d
commit 5f26cb9180
11 changed files with 344 additions and 32 deletions

View File

@@ -267,6 +267,43 @@ namespace EonaCat.Logger.Advanced
}
```
**Code for enabling keyword masking (default: false):**
```csharp
Logger.LoggerSettings.UseMask = true;
```
Sensitive information will be replaced with ****MASKED****
You can add additional masking keywords using the MaskedKeywords property on the LoggerSettings object
You can also override the MaskSensitiveInformation method of the batchLoggingProvider to add your own masking
Default maskings (when the masking is enabled):
IP addresses
MAC addresses
Emails
Passwords
Credit card numbers
Social security numbers (SSN) and BSN (Dutch Citizen Service Number)
API keys/tokens
Phone numbers (generic and Dutch specific)
Dates of birth (DOB) or other date formats
IBAN/Bank account numbers (generic and Dutch specific)
JWT tokens
URLs with sensitive query strings
License keys
Public and private keys (e.g., PEM format)
Dutch KVK number (8 or 12 digits)
Dutch BTW-nummer (VAT number)
Dutch driving license number (10-12 characters)
Dutch health insurance number (Zorgnummer)
Other Dutch Bank Account numbers (9-10 digits)
Dutch Passport Numbers (9 alphanumeric characters
Dutch Identification Document Numbers (varying formats)
Custom keywords specified in LoggerSettings
**Code for enabling GrayLog in the above *advanced* logger class:**
```csharp