๐ข Public
Safe to publish. Interest rates on the website, product brochures.
๐ต Internal
For staff only. Low harm if leaked. Org charts, internal procedures.
๐ Confidential
Harm to customers or the business if leaked. Customer names, contact details, balances, contracts.
๐ด Restricted
Serious harm. Card numbers, TFNs, passwords, health or hardship notes, bulk customer extracts.
Names vary (some use "Highly confidential" or "Secret"), but four levels like these are typical.
Personal information (PII)
Under the Privacy Act: information or an opinion about an identified or reasonably identifiable person. Name, email, address, phone, account number, and often device IDs or IP addresses when they can be linked to a person.
Sensitive information
A special Privacy Act category with a higher bar (usually needs consent): health, genetic and biometric data, racial or ethnic origin, religion, political opinions, sexual orientation, criminal record and more. Some data has its own rules too: card numbers (PCI DSS) and TFNs (the TFN Rule).
.NET 10 How to implement it
| Library / API | Package | Use it for |
| Data classification | Microsoft.Extensions.Compliance.Abstractions (DataClassification, DataClassificationAttribute) | Define your own taxonomy (Confidential, Restricted) and tag properties and parameters with it |
| Redaction | Microsoft.Extensions.Compliance.Redaction (AddRedaction, ErasingRedactor, HmacRedactor) | Map each classification to a redactor: erase it, or replace it with a keyed hash |
| Log redaction | Microsoft.Extensions.Telemetry (EnableRedaction) | Classified values in [LoggerMessage] logs are redacted before they reach any log sink |
// Your taxonomy, matching the classification standard
public static class BankData
{
public static string Name => "BankData";
public static DataClassification Confidential => new(Name, nameof(Confidential));
public static DataClassification Restricted => new(Name, nameof(Restricted));
}
public sealed class RestrictedAttribute() : DataClassificationAttribute(BankData.Restricted) { }
// Program.cs: redact classified values in logs
builder.Logging.EnableRedaction();
builder.Services.AddRedaction(r =>
{
r.SetRedactor<ErasingRedactor>(BankData.Restricted); // TFN, card number: removed
r.SetHmacRedactor(builder.Configuration.GetSection("Hmac"),
BankData.Confidential); // stable hash: still joinable
});
public static partial class Log
{
[LoggerMessage(LogLevel.Information, "Loan application received for {Tfn}")]
public static partial void LoanReceived(this ILogger logger, [Restricted] string tfn);
}
Not all data is equal. Classify it once, and the controls follow ๐ท๏ธ
๐ข Public: rates on the website
๐ต Internal: staff procedures
๐ Confidential: customer contact details, balances
๐ด Restricted: card numbers, TFNs, health or hardship notes
The label drives encryption, access, masking, logging and sharing. Two traps: a dataset takes its most sensitive field's level, and combining "harmless" data can make it sensitive.
#DataClassification #Privacy #Security #DataGovernance