Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add telemetry for password field masking#26195

Merged
MarkEWaite merged 3 commits into
jenkinsci:masterfrom
Kevin-CB:masking-telemetry
Jan 31, 2026
Merged

Add telemetry for password field masking#26195
MarkEWaite merged 3 commits into
jenkinsci:masterfrom
Kevin-CB:masking-telemetry

Conversation

@Kevin-CB
Copy link
Copy Markdown
Contributor

@Kevin-CB Kevin-CB commented Jan 26, 2026

Add telemetry to track usage of the password field masking.

Fixes #26194

Testing done

Tested with ExtensionList.lookupSingleton(jenkins.telemetry.impl.PasswordMasking).createContent() while running SECURITY-1809 test (#permissionIsCorrectlyCheckedOnNestedObject) to reach a view using the masking.
Output:

Result: {"components":{"ant":"520.vd082ecfb_16a_9","antisamy-markup-formatter":"173.v680e3a_b_69ff3","apache-httpcomponents-client-4-api":"4.5.14-269.vfa_2321039a_83","asm-api":"9.9-185.va_6c6b_3348b_c3","bootstrap5-api":"5.3.8-895.v4d0d8e47fea_d","bouncycastle-api":"2.30.1.82-277.v70ca_0b_877184","caffeine-api":"3.2.3-194.v31a_b_f7a_b_5a_81","checks-api":"373.vfe7645102093","cloudbees-folder":"6.1073.va_7888eb_dd514","command-launcher":"123.v37cfdc92ef67","commons-lang3-api":"3.20.0-109.ve43756e2d2b_4","commons-text-api":"1.15.0-210.v7480a_da_70b_9e","credentials":"1480.v2246fd131e83","display-url-api":"2.217.va_6b_de84cc74b_","echarts-api":"6.0.0-1165.vd1283a_3e37d4","eddsa-api":"0.3.0.1-29.v67e9a_1c969b_b_","font-awesome-api":"7.1.0-882.v1dfb_771e3278","gradle":"1.24","gson-api":"2.13.2-173.va_a_092315913c","instance-identity":"203.v15e81a_1b_7a_38","ionicons-api":"94.vcc3065403257","jackson2-api":"2.20.1-423.v13951f6b_6532","jakarta-activation-api":"2.1.3-1","jakarta-mail-api":"2.1.3-2","jakarta-xml-bind-api":"4.0.5-3.v3d5b_a_73965b_9","javax-activation-api":"1.2.0-8","javax-mail-api":"1.6.2-11","jaxb":"2.3.9-1","jdk-tool":"83.v417146707a_3d","jenkins-core":"2.548-SNAPSHOT","jquery3-api":"3.7.1-594.vb_3864f326cf0","json-api":"20250107-125.v28b_a_ffa_eb_f01","junit":"1380.v491ff054cd35","mailer":"525.v2458b_d8a_1a_71","matrix-auth":"3.2.9","matrix-project":"870.v9db_fcfc2f45b_","mina-sshd-api-common":"2.16.0-167.va_269f38cc024","mina-sshd-api-core":"2.16.0-167.va_269f38cc024","plugin-util-api":"6.1192.v30fe6e2837ff","prism-api":"1.30.0-630.va_e19d17f83b_0","scm-api":"724.v7d839074eb_5c","script-security":"1385.v7d2d9ec4d909","snakeyaml-api":"2.3-123.v13484c65210a_","sshd":"3.374.v19b_d59ce6610","structs":"362.va_b_695ef4fdf9","trilead-api":"2.284.v1974ea_324382","variant":"70.va_d9f17f859e0","workflow-api":"1398.v67030756d3fb_","workflow-step-api":"710.v3e456cc85233","workflow-support":"1010.vb_b_39488a_9841"},"masking":[{"className":"hudson.model.FreeStyleProject","closestAncestor":"jenkins.security.Security1809Test$PasswordAction","jellyView":"Security1809Test/PasswordAction/index.jelly","count":1}]}

UI description:
image

Screenshots (UI changes only)

Before

After

Proposed changelog entries

  • Add telemetry for password field masking.

Proposed changelog category

/label rfe

Proposed upgrade guidelines

N/A

Submitter checklist

  • The issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples). Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • UI changes do not introduce regressions when enforcing the current default rules of Content Security Policy Plugin. In particular, new or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
  • For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@daniel-beck

Before the changes are marked as ready-for-merge:

Maintainer checklist

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, be a Bug or Improvement, and either the issue or pull request must be labeled as lts-candidate to be considered.

@comment-ops-bot comment-ops-bot Bot added the rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Jan 26, 2026
@Kevin-CB Kevin-CB requested a review from daniel-beck January 26, 2026 11:19
Copy link
Copy Markdown
Member

@daniel-beck daniel-beck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only tells us whether this masking is used, but no additional information. So if we receive these reports, they're not actionable, as long as there's at least a few that hit this (~too many to just declare it unused).

To understand how this feature is used, we need to know the closest class name (which may be none of these types), as well as the view name. Ideally even the Jelly file hierarchy, if that's available, although I guess we'll likely be able to use installed plugins to find it.

Recommended next steps: Check how StaplerDispatches telemetry worked (including the part in Stapler) and whether that can be adapted to this. Alternatively, jelly.trace (but there should be quite some overlap). Looking at how stapler.jelly.trace works might give you an idea how to hook into view composition.

@Kevin-CB Kevin-CB requested a review from daniel-beck January 26, 2026 16:34
@daniel-beck
Copy link
Copy Markdown
Member

Result: {"components":{…,"project-inheritance":"21.04.03",…},"masking":[{"className":"hudson.plugins.project_inheritance.projects.InheritanceProject","closestAncestor":"hudson.plugins.project_inheritance.projects.InheritanceProject","jellyView":"ParametersDefinitionProperty/DescriptorImpl/config.jelly ParametersDefinitionProperty/config-details.jelly PasswordParameterDefinition/ParameterDescriptorImpl/config.jelly","count":1}]}

Nice. (I would not consider this plugin a reason to not simplify our masking code, given existing vulnerabilities…)

Comment thread core/src/main/java/jenkins/telemetry/impl/PasswordMasking.java
Comment thread core/src/main/java/jenkins/telemetry/impl/PasswordMasking.java Outdated
@Kevin-CB Kevin-CB requested a review from daniel-beck January 28, 2026 14:37
Copy link
Copy Markdown
Member

@daniel-beck daniel-beck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work well 👍

@daniel-beck daniel-beck added the squash-merge-me Unclean or useless commit history, should be merged only with squash-merge label Jan 29, 2026
@daniel-beck
Copy link
Copy Markdown
Member

This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback. Please see the merge process documentation for more information about the merge process.

/label ready-for-merge

@comment-ops-bot comment-ops-bot Bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Jan 29, 2026
@MarkEWaite MarkEWaite merged commit 6c50589 into jenkinsci:master Jan 31, 2026
19 checks passed
@Kevin-CB Kevin-CB added the lts-candidate When fixed, this issue should be considered for backporting to the LTS line label Feb 25, 2026
krisstern pushed a commit to krisstern/jenkins that referenced this pull request Mar 3, 2026
* Add telemetry for password field masking

* Collect actionable info

* Always send data and clear collection

(cherry picked from commit 6c50589)
@MarkEWaite MarkEWaite removed the lts-candidate When fixed, this issue should be considered for backporting to the LTS line label Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted squash-merge-me Unclean or useless commit history, should be merged only with squash-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add telemetry for password field masking

4 participants