dotCMS / dotCMS/core

Centralize sensitive-config obfuscation pattern into a shared utility

Open
#36,923 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Team : Platform Type : Task
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

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).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the obfuscation statics in JVMInfoResource, then trace their callers in SystemTableImpl.set() and ConfigurationResource.isOnBlackList(). Introduce the shared utility described in the issue and update those callers while preserving JVMInfoResource's public deprecated delegates. Done means the existing patterns, override behavior, and masking format remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, security
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.