Skip to content

Centralize sensitive-config obfuscation pattern into a shared utility #36923

Description

@wezell

Problem

The key-name obfuscation rules for sensitive config (passw|pass|passwd|secret|key|token + the OBFUSCATE_SYSTEM_ENVIRONMENTAL_VARIABLES override) are defined as statics on JVMInfoResource, a JAX-RS resource. Other layers reach into it:

  • SystemTableImpl.set() calls JVMInfoResource.obfuscateIfNeeded() for security logging — business layer depending on a REST class
  • ConfigurationResource.isOnBlackList() reads JVMInfoResource.obfuscatePattern directly

As more surfaces need the same masking (e.g. the config-overrides fix in #36919), the pattern needs one authoritative home.

Fix

  • New com.dotcms.util.ObfuscationUtil owning the default pattern, the config-driven custom pattern, shouldObfuscate(), matchesCustomPattern(), obfuscateIfNeeded() and obfuscate()
  • JVMInfoResource keeps its public members as thin @Deprecated delegates (they are public static and may be referenced by plugins)
  • SystemTableImpl and ConfigurationResource switch to the utility

No behavior change — same patterns, same masking format.

Related: #36919 (config overrides not obfuscated).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions