Centralize sensitive-config obfuscation pattern into a shared utility
Nobody has claimed this yet.
- 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()callsJVMInfoResource.obfuscateIfNeeded()for security logging — business layer depending on a REST classConfigurationResource.isOnBlackList()readsJVMInfoResource.obfuscatePatterndirectly
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.ObfuscationUtilowning the default pattern, the config-driven custom pattern,shouldObfuscate(),matchesCustomPattern(),obfuscateIfNeeded()andobfuscate() JVMInfoResourcekeeps its public members as thin@Deprecateddelegates (they arepublic staticand may be referenced by plugins)SystemTableImplandConfigurationResourceswitch to the utility
No behavior change — same patterns, same masking format.
Related: #36919 (config overrides not obfuscated).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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