Skip to content

HBASE-27118 Add security headers to Thrift/HTTP server - #5864

Merged
anmolnar merged 3 commits into
apache:masterfrom
anmolnar:HBASE-27118
Aug 13, 2024
Merged

HBASE-27118 Add security headers to Thrift/HTTP server#5864
anmolnar merged 3 commits into
apache:masterfrom
anmolnar:HBASE-27118

Conversation

@anmolnar

Copy link
Copy Markdown
Contributor

Line up Thrift server with HTTP and REST by adding HTTP security headers if SSL is enabled.
Includes a new unit test class specific for HTTP+SSL based Thrift server + some refactoring.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 25sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 17sMaven dependency ordering for branch
+1 💚mvninstall2m 56smaster passed
+1 💚compile0m 54smaster passed
+1 💚shadedjars5m 27sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 53smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for patch
+1 💚mvninstall2m 49sthe patch passed
+1 💚compile0m 58sthe patch passed
+1 💚javac0m 58sthe patch passed
+1 💚shadedjars5m 26spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 51sthe patch passed
_ Other Tests _
+1 💚unit0m 49shbase-http in the patch passed.
+1 💚unit6m 28shbase-thrift in the patch passed.
+1 💚unit3m 27shbase-rest in the patch passed.
33m 11s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5864/1/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR#5864
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 928347fcbaf6 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 8a2f3ef
Default JavaEclipse Adoptium-17.0.10+7
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5864/1/testReport/
Max. process+thread count1640 (vs. ulimit of 30000)
modulesC: hbase-http hbase-thrift hbase-rest U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5864/1/console
versionsgit=2.34.1 maven=3.8.6
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 36sDocker mode activated.
-0 ⚠️yetus0m 2sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for branch
+1 💚mvninstall3m 1smaster passed
+1 💚compile1m 2smaster passed
+1 💚shadedjars5m 16sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 2smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 14sMaven dependency ordering for patch
+1 💚mvninstall2m 50sthe patch passed
+1 💚compile1m 1sthe patch passed
+1 💚javac1m 1sthe patch passed
+1 💚shadedjars5m 17spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 1sthe patch passed
_ Other Tests _
+1 💚unit0m 59shbase-http in the patch passed.
+1 💚unit6m 44shbase-thrift in the patch passed.
+1 💚unit3m 31shbase-rest in the patch passed.
34m 10s
SubsystemReport/Notes
DockerClientAPI=1.45 ServerAPI=1.45 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5864/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#5864
Optional Testsjavac javadoc unit shadedjars compile
unameLinux c47bae970cfa 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 8a2f3ef
Default JavaEclipse Adoptium-11.0.17+8
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5864/1/testReport/
Max. process+thread count1678 (vs. ulimit of 30000)
modulesC: hbase-http hbase-thrift hbase-rest U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5864/1/console
versionsgit=2.34.1 maven=3.8.6
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 51sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗mvndep0m 16sMaven dependency ordering for branch
+1 💚mvninstall4m 31smaster passed
+1 💚compile1m 57smaster passed
+1 💚checkstyle0m 59smaster passed
+1 💚spotless0m 52sbranch has no errors when running spotless:check.
+1 💚spotbugs2m 15smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 12sMaven dependency ordering for patch
+1 💚mvninstall3m 59sthe patch passed
+1 💚compile1m 55sthe patch passed
+1 💚javac1m 55sthe patch passed
+1 💚checkstyle1m 6sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚xml0m 2sThe patch has no ill-formed XML file.
+1 💚hadoopcheck6m 16sPatch does not cause any errors with Hadoop 3.3.6.
+1 💚spotless0m 51spatch has no errors when running spotless:check.
+1 💚spotbugs3m 1sthe patch passed
_ Other Tests _
+1 💚asflicense0m 44sThe patch does not generate ASF License warnings.
38m 37s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5864/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#5864
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile xml
unameLinux 14a06661c5cd 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 8a2f3ef
Default JavaEclipse Adoptium-11.0.17+8
Max. process+thread count81 (vs. ulimit of 30000)
modulesC: hbase-http hbase-thrift hbase-rest U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5864/1/console
versionsgit=2.34.1 maven=3.8.6 spotbugs=4.7.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 56sDocker mode activated.
-0 ⚠️yetus0m 2sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 14sMaven dependency ordering for branch
+1 💚mvninstall3m 57smaster passed
+1 💚compile1m 8smaster passed
+1 💚shadedjars6m 54sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 15smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 15sMaven dependency ordering for patch
+1 💚mvninstall3m 19sthe patch passed
+1 💚compile1m 6sthe patch passed
+1 💚javac1m 6sthe patch passed
+1 💚shadedjars6m 18spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 53sthe patch passed
_ Other Tests _
+1 💚unit1m 8shbase-http in the patch passed.
+1 💚unit6m 45shbase-thrift in the patch passed.
+1 💚unit4m 56shbase-rest in the patch passed.
40m 38s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5864/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#5864
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 5989d0f5beb1 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 8a2f3ef
Default JavaTemurin-1.8.0_352-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5864/1/testReport/
Max. process+thread count1638 (vs. ulimit of 30000)
modulesC: hbase-http hbase-thrift hbase-rest U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5864/1/console
versionsgit=2.34.1 maven=3.8.6
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@stotystoty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 LGTM

ServletContextHandler ctxHandler =
new ServletContextHandler(httpServer, "/", ServletContextHandler.SESSIONS);
ctxHandler.addServlet(new ServletHolder(thriftHttpServlet), "/*");
HttpServerUtil.addClickjackingPreventionFilter(ctxHandler, conf, PATH_SPEC_ANY);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit:
You mention in the ticket description that we add this when "HTTP support is enabled".

While I understand that this refers to the HTTP frontend as opposed to the binary, it can still cause misundestandings.

I suggest updating the ticket text to "HTTP/HTTPS support is enabled"

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks, I've updated the ticket.

@Apache9

Copy link
Copy Markdown
Contributor

@anmolnar You can merge this by yourself since you are a committer now.

@anmolnar
anmolnar merged commit 97de291 into apache:masterAug 13, 2024
anmolnar added a commit that referenced this pull request Aug 13, 2024
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Pankaj <pankajkumar@apache.org>
Signed-off-by: Istvan Toth <stoty@apache.org>
anmolnar added a commit to anmolnar/hbase that referenced this pull request Aug 13, 2024
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Pankaj <pankajkumar@apache.org>
Signed-off-by: Istvan Toth <stoty@apache.org>
@anmolnar
anmolnar deleted the HBASE-27118 branch September 19, 2024 19:50
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@anmolnar@Apache-HBase@Apache9@stoty@pankaj72981