Mask secret-looking app environment variable values - #5834
Merged
norman-abramovitz merged 10 commits intoAug 21, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Masks secret-looking values on the app Variables tab so they are only displayed on explicit request:
••••••••with a per-row Show/Hide toggle in the Value cell.VCAP_SERVICESand friends), with a single Show secrets / Hide secrets toggle in the card header.A value is considered sensitive when:
pass|secret|token|private|key|cred(full mask), orscheme://user:pass@host(only the password is redacted, so host/port/path stay readable), or-----BEGIN … PRIVATE KEY-----, any variant) — masked under any variable name. Certificate blocks are public material and stay visible.These are the same heuristics the Service Keys page already uses; they now live in one shared module (
toCredentialField/maskEnvValue), so both surfaces stay in lockstep. As a side effect this change also removes an existing leak: the old Value cell exposed the full raw value in its hovertitletooltip.Also in this PR
env-var-viewdialog component — orphaned by the earlier variable-editor rework, zero references (grep-verified with a positive control).Show value for <name>,Show secrets in All Variables).Testing
SERVER_CRT) both masked on first render.make check gategreen end to end.Deliberate ceilings, recorded in code comments: masking is leaf-based (a
credentialscontainer is recursed, not blanket-masked — matching Service Keys), and PEM detection keys on the armor header, so raw base64/DER key material under an innocuous name is not caught.