Skip to content

Feature: mask entire configuration sections as secrets #3544

Description

@thomhurst

Category: feature — Breaking: no

Masking requires [SecretValue] per property on IOptions classes (docs/docs/how-to/secrets.md, Engine/ISecretProvider.cs) or runtime ISecretRegistry.AddSecret. Values pulled in via Key Vault/user-secrets configuration providers are logged unmasked unless every property is attributed — there is no "everything under Secrets: is secret" declaration. (#3113/#3172 fixed masking mechanics, not registration ergonomics.)

Proposal: SecretMaskingOptions.MaskedConfigurationSections = ["Secrets", "ConnectionStrings"] plus builder.MaskConfigurationSection("Secrets") sugar: at startup, enumerate the section's leaf values into the existing ISecretRegistry, which already propagates to CI-native masking. Roughly a 30-line feature on existing infrastructure; makes any generic-host secret provider safe by default. Perf: startup-only enumeration.

Part of #3239 (round 2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low: hygiene and nice-to-haves - wheneverenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions