Skip to content

Conversation

@kgeisz
Copy link
Contributor

@kgeisz kgeisz commented Dec 19, 2025

https://issues.apache.org/jira/browse/HBASE-29789

This pull request back-ports HBASE-29761: The HBase UI's Debug Dump is not redacting sensitive information into branch-2. HBASE-29761 fixes an issue where sensitive information, such as passwords, were not being redacted when looking at a server's Debug Dump in the HBase UI. Some small modifications needed to be made in the Java code in order to get this commit to build. The changes included:

MasterDumpServlet.java and RSDumpServlet.java

  • Using StandardCharsets.UTF_8.toString() instead of StandardCharsets.UTF_8

MasterDumpServlet.java

  • Changed if (isShowQueueDump(conf)) to if (isShowQueueDump(master.getConfiguration())) since the conf variable no longer exists in the code (the master branch does not have this if block at all).

TestDebugDumpRedaction.java

  • Using HBaseTestingUtility instead of HBaseTestingUtil
  • Initializing REDACTED_PROPS using Arrays.asList() instead of List.of() and using .collect(Collectors.toList()) instead of .toList().

TestServerHttpUtils.java

  • Using static final String PLAIN_TEXT = "text/plain" instead of static final String PLAIN_TEXT_UTF8 = "text/plain;charset=utf-8".

…redacting sensitive information' to branch-2

Change-Id: Ib3fa2674e9362b038e37df1a32ad35094811a00d
@kgeisz kgeisz force-pushed the HBASE-29789-backport-HBASE-29761-debug-dump-redact-fix-to-branch-2 branch from 796c610 to 23b2817 Compare December 19, 2025 21:22
@kgeisz kgeisz changed the title HBASE-29789: Backport HBASE-29761: The HBase UI's Debug Dump is not redacting sensitive information to branch-2 HBASE-29789: Backport 'HBASE-29761: The HBase UI's Debug Dump is not redacting sensitive information' to branch-2 Dec 19, 2025
@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

Copy link
Contributor

@taklwu taklwu left a comment

Choose a reason for hiding this comment

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

@kgeisz you may need to revisit the patch for branch-2 and branch-2.6

Change-Id: I0f106715de5369fd31a0d1826e4e2e2e56c874e4
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 50s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
_ branch-2 Compile Tests _
+1 💚 mvninstall 3m 41s branch-2 passed
+1 💚 compile 3m 5s branch-2 passed
+1 💚 checkstyle 0m 37s branch-2 passed
+1 💚 spotbugs 1m 42s branch-2 passed
+1 💚 spotless 0m 51s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 6s the patch passed
+1 💚 compile 3m 2s the patch passed
+1 💚 javac 3m 2s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 0m 39s /results-checkstyle-hbase-server.txt hbase-server: The patch generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
+1 💚 spotbugs 1m 43s the patch passed
+1 💚 hadoopcheck 17m 22s Patch does not cause any errors with Hadoop 2.10.2 or 3.3.6 3.4.1.
+1 💚 spotless 0m 45s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 12s The patch does not generate ASF License warnings.
39m 39s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7568/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7568
JIRA Issue HBASE-29789
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux 0e71cee12623 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision branch-2 / a64f906
Default Java Eclipse Adoptium-11.0.23+9
Max. process+thread count 77 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7568/2/console
versions git=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 45s Docker mode activated.
-0 ⚠️ yetus 0m 6s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ branch-2 Compile Tests _
+1 💚 mvninstall 3m 34s branch-2 passed
+1 💚 compile 0m 59s branch-2 passed
+1 💚 javadoc 0m 30s branch-2 passed
+1 💚 shadedjars 6m 34s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 7s the patch passed
+1 💚 compile 0m 59s the patch passed
+1 💚 javac 0m 59s the patch passed
+1 💚 javadoc 0m 27s the patch passed
+1 💚 shadedjars 6m 29s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 208m 31s hbase-server in the patch passed.
236m 58s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7568/2/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #7568
JIRA Issue HBASE-29789
Optional Tests javac javadoc unit compile shadedjars
uname Linux d2077b9eb3e2 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision branch-2 / a64f906
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7568/2/testReport/
Max. process+thread count 3369 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7568/2/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 58s Docker mode activated.
-0 ⚠️ yetus 0m 6s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ branch-2 Compile Tests _
+1 💚 mvninstall 4m 14s branch-2 passed
+1 💚 compile 1m 1s branch-2 passed
+1 💚 javadoc 0m 33s branch-2 passed
+1 💚 shadedjars 8m 36s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 25s the patch passed
+1 💚 compile 0m 52s the patch passed
+1 💚 javac 0m 52s the patch passed
+1 💚 javadoc 0m 26s the patch passed
+1 💚 shadedjars 8m 34s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 256m 50s hbase-server in the patch passed.
291m 5s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7568/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #7568
JIRA Issue HBASE-29789
Optional Tests javac javadoc unit compile shadedjars
uname Linux b4dd5aa7b32b 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision branch-2 / a64f906
Default Java Eclipse Adoptium-11.0.23+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7568/2/testReport/
Max. process+thread count 3163 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7568/2/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 1m 6s Docker mode activated.
-0 ⚠️ yetus 0m 5s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ branch-2 Compile Tests _
+1 💚 mvninstall 3m 48s branch-2 passed
+1 💚 compile 1m 8s branch-2 passed
+1 💚 javadoc 0m 37s branch-2 passed
+1 💚 shadedjars 8m 25s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 51s the patch passed
+1 💚 compile 0m 55s the patch passed
+1 💚 javac 0m 55s the patch passed
+1 💚 javadoc 0m 30s the patch passed
+1 💚 shadedjars 7m 59s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 302m 41s hbase-server in the patch passed.
337m 4s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7568/2/artifact/yetus-jdk8-hadoop2-check/output/Dockerfile
GITHUB PR #7568
JIRA Issue HBASE-29789
Optional Tests javac javadoc unit compile shadedjars
uname Linux 898d604be678 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision branch-2 / a64f906
Default Java Temurin-1.8.0_412-b08
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7568/2/testReport/
Max. process+thread count 3090 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7568/2/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@kgeisz kgeisz requested a review from taklwu December 31, 2025 20:08
@kgeisz
Copy link
Contributor Author

kgeisz commented Dec 31, 2025

@taklwu, thanks for the review. I have fixed the failing unit test here and in PR #7571 for branch-2.6.


URL url = new URL("http://" + hostname + ":" + infoPort + "/regionserver.jsp");
String page = TestServerHttpUtils.getPageContent(url, "text/html;charset=utf-8");
String page = TestServerHttpUtils.getPageContent(url, "text/html");
Copy link
Contributor

Choose a reason for hiding this comment

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

can you further investigate why master branch is working with charset=utf-8 as well as the /master-status in hbase-server/src/test/java/org/apache/hadoop/hbase/master/http/TestMasterStatusPage.java is working ?

if we find 1 or 2 commits are missing, we can first backport this one and fix this charset=utf-8 issue, such we don't branch in any default charset if not set.

Copy link
Contributor

Choose a reason for hiding this comment

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

mmm, I found master and branch-2 introduced this issue in test class since HBASE-29531 , so, it should be safe but please try to reach out to @PDavid and ask him if he knows anything about it.

(master) 7892207#diff-96a2061f96b0d10cb820b1a740abb071f9aa923466bebe9518ad9ec9d4a984f9R164

branch-2 e7be4f3#diff-b9772b8bfa004bfc0da644a9c9bf48f78e7e8a6100b1aa524aa4d7a6e842b64a

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi,
Yes, I noticed when I backported the Jamon to JSP migration patches that somehow the test was failing because of this text/html;charset=utf-8 vs. text/html issue. To be completely honest I'm not sure why this happened. On branch-2 the page was served without charset in content type header and it was quickest to change the test assertion. Maybe the JSP engine / servlet implementation is different? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Many thanks for you all for looking into this. 👍

I think I found the problem. In regionserver.jsp, on line 42 we manually set the content type to "text/html" when not a JSON format parameter was requested:

https://github.com/apache/hbase/blob/branch-2/hbase-server/src/main/resources/hbase-webapps/regionserver/regionserver.jsp#L42

So the fix would be to have:

  if (RSStatusConstants.FORMAT_JSON.equals(format)) {
    response.setContentType("application/json");
  } else {
    response.setContentType("text/html;charset=UTF-8");
  }

I'm not exactly sure why this test did not fail on master and branch-3, I'll have to investigate that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can fix this under separate PR-s or shall we include the fix in this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

let's have it in a separate PR that helps to limit the scope to backport

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, thanks, I'll open separate PR-s for this fix then. 👍

@PDavid PDavid added the backport This PR is a back port of some issue or issues already committed to master label Jan 5, 2026
Copy link
Contributor

@PDavid PDavid left a comment

Choose a reason for hiding this comment

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

Many thanks! 👍

@taklwu taklwu merged commit 7ec973d into apache:branch-2 Jan 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a back port of some issue or issues already committed to master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants