Skip to content

HBASE-28921 Skip bundling hbase-webapps folder in jars - #6368

Merged
NihalJain merged 1 commit into
apache:masterfrom
NihalJain:HBASE-28921
Oct 21, 2024
Merged

HBASE-28921 Skip bundling hbase-webapps folder in jars#6368
NihalJain merged 1 commit into
apache:masterfrom
NihalJain:HBASE-28921

Conversation

@NihalJain

Copy link
Copy Markdown
Contributor

We are bundling all webapp resources in hbase-server, hbase-thrift, hbase-rest and transitively to hbase-shaded-mapreduce jar. This can be an issue, say if any of the Js projects used by hbase are vulnerable, security scan tools like sonatype start flagging the jars too as vulnerable since they contain vulnerable code.

With this JIRA, we want to avoid bundling static webapp resources in our jars.

@NihalJain

Copy link
Copy Markdown
ContributorAuthor

Built hbase locally, untarred and start master, rest and thrift server.

And then verified following:

  • Browse to master, rest and thrift web UIs and ensure no issues in web pages
  • Start hbase shell and do basic sanity
  • Run Thrift demo client from hbase-examples
  • Run basic REST APIs
    Screenshot 2024-10-17 at 6 15 18 PM

Diff of the tarballs against master:
Screenshot 2024-10-17 at 6 08 24 PM

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 38sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗codespell0m 0scodespell was not available.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗mvndep0m 9sMaven dependency ordering for branch
+1 💚mvninstall3m 3smaster passed
+1 💚compile4m 21smaster passed
+1 💚spotless0m 48sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for patch
+1 💚mvninstall2m 56sthe patch passed
+1 💚compile5m 11sthe patch passed
+1 💚javac5m 11sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚xmllint0m 0sNo new issues.
+1 💚hadoopcheck13m 5sPatch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚spotless0m 52spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 31sThe patch does not generate ASF License warnings.
38m 56s
SubsystemReport/Notes
DockerClientAPI=1.47 ServerAPI=1.47 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6368/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#6368
Optional Testsdupname asflicense javac codespell detsecrets xmllint hadoopcheck spotless compile
unameLinux 33038e1321d8 5.4.0-195-generic #215-Ubuntu SMP Fri Aug 2 18:28:05 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 8a073b1
Default JavaEclipse Adoptium-17.0.11+9
Max. process+thread count85 (vs. ulimit of 30000)
modulesC: hbase-server hbase-thrift hbase-rest U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6368/1/console
versionsgit=2.34.1 maven=3.9.8 xmllint=20913
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 14sDocker mode activated.
-0 ⚠️yetus0m 2sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for branch
+1 💚mvninstall3m 4smaster passed
+1 💚compile1m 49smaster passed
+1 💚javadoc1m 20smaster passed
+1 💚shadedjars5m 21sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗mvndep0m 13sMaven dependency ordering for patch
+1 💚mvninstall3m 6sthe patch passed
+1 💚compile1m 47sthe patch passed
+1 💚javac1m 47sthe patch passed
+1 💚javadoc1m 20sthe patch passed
+1 💚shadedjars5m 20spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit217m 30shbase-server in the patch passed.
+1 💚unit7m 9shbase-thrift in the patch passed.
+1 💚unit3m 50shbase-rest in the patch passed.
257m 19s
SubsystemReport/Notes
DockerClientAPI=1.47 ServerAPI=1.47 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6368/1/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR#6368
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 9d01b49f6ef8 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 8a073b1
Default JavaEclipse Adoptium-17.0.11+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6368/1/testReport/
Max. process+thread count5140 (vs. ulimit of 30000)
modulesC: hbase-server hbase-thrift hbase-rest U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6368/1/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@stoty

Copy link
Copy Markdown
Contributor

Are the webapps found in development mode (i.e. when starting HBase from the source directory) ?

@NihalJain

Copy link
Copy Markdown
ContributorAuthor

Are the webapps found in development mode (i.e. when starting HBase from the source directory) ?

Should be available since we have following code at

if [ -d"$HBASE_HOME/hbase-server/target/hbase-webapps" ];then
:

#add if we are in a dev environment
if [ -d "$HBASE_HOME/hbase-server/target/hbase-webapps" ]; then
if [ "$COMMAND" = "thrift" ] ; then
add_to_cp_if_exists "${HBASE_HOME}/hbase-thrift/target"
elif [ "$COMMAND" = "thrift2" ] ; then
add_to_cp_if_exists "${HBASE_HOME}/hbase-thrift/target"
elif [ "$COMMAND" = "rest" ] ; then
add_to_cp_if_exists "${HBASE_HOME}/hbase-rest/target"
else
add_to_cp_if_exists "${HBASE_HOME}/hbase-server/target"
# Needed for GetJavaProperty check below
add_to_cp_if_exists "${HBASE_HOME}/hbase-server/target/classes"
fi
fi

Have never tried launching hbase from source directory. Let me try that as well.

@NihalJain

Copy link
Copy Markdown
ContributorAuthor

Have never tried launching hbase from source directory. Let me try that as well.

Verified starting master, rest and thrift from source directory with this patch. All web UIs work fine.

hbase % pwd /Users/nihaljain/code/os/hbase
hbase % ./bin/hbase-daemon.sh start master
running master, logging to /Users/nihaljain/code/os/hbase/bin/../logs/hbase-nihaljain-master-HOSTNAME.out
hbase % ./bin/hbase-daemon.sh start rest running rest, logging to /Users/nihaljain/code/os/hbase/bin/../logs/hbase-nihaljain-rest-HOSTNAME.out
base % ./bin/hbase-daemon.sh start thrift
running thrift, logging to /Users/nihaljain/code/os/hbase/bin/../logs/hbase-nihaljain-thrift-HOSTNAME.out

@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

@NihalJain

Copy link
Copy Markdown
ContributorAuthor

Thank you @stoty for reviewing. I will merge this to branch-2+ by EOD.

@stoty

Copy link
Copy Markdown
Contributor

Since this is a security imrovement, I would consider merging this to all active branches.

@NihalJain

NihalJain commented Oct 18, 2024

Copy link
Copy Markdown
ContributorAuthor

Since this is a security imrovement, I would consider merging this to all active branches.

Actually, you are right. Will push to all active branches.

@NihalJain
NihalJain merged commit 8366304 into apache:masterOct 21, 2024
NihalJain added a commit to NihalJain/hbase that referenced this pull request Oct 21, 2024
We are bundling all webapp resources in hbase-server, hbase-thrift, hbase-rest and transitively to hbase-shaded-mapreduce jar. This can be an issue, say if any of the Js projects used by hbase are vulnerable, security scan tools like sonatype start flagging the jars too as vulnerable since they contain vulnerable code.
With this JIRA, we skip bundling static webapp resources in our jars.
Signed-off-by: Istvan Toth <stoty@apache.org>
Reviewed-by: Dávid Paksy <paksyd@cloudera.com>
(cherry picked from commit 8366304)
NihalJain added a commit to NihalJain/hbase that referenced this pull request Oct 21, 2024
We are bundling all webapp resources in hbase-server, hbase-thrift, hbase-rest and transitively to hbase-shaded-mapreduce jar. This can be an issue, say if any of the Js projects used by hbase are vulnerable, security scan tools like sonatype start flagging the jars too as vulnerable since they contain vulnerable code.
With this JIRA, we skip bundling static webapp resources in our jars.
Signed-off-by: Istvan Toth <stoty@apache.org>
Reviewed-by: Dávid Paksy <paksyd@cloudera.com>
(cherry picked from commit 8366304)
NihalJain added a commit to NihalJain/hbase that referenced this pull request Oct 21, 2024
We are bundling all webapp resources in hbase-server, hbase-thrift, hbase-rest and transitively to hbase-shaded-mapreduce jar. This can be an issue, say if any of the Js projects used by hbase are vulnerable, security scan tools like sonatype start flagging the jars too as vulnerable since they contain vulnerable code.
With this JIRA, we skip bundling static webapp resources in our jars.
Signed-off-by: Istvan Toth <stoty@apache.org>
Reviewed-by: Dávid Paksy <paksyd@cloudera.com>
(cherry picked from commit 8366304)
NihalJain added a commit to NihalJain/hbase that referenced this pull request Oct 21, 2024
We are bundling all webapp resources in hbase-server, hbase-thrift, hbase-rest and transitively to hbase-shaded-mapreduce jar. This can be an issue, say if any of the Js projects used by hbase are vulnerable, security scan tools like sonatype start flagging the jars too as vulnerable since they contain vulnerable code.
With this JIRA, we skip bundling static webapp resources in our jars.
Signed-off-by: Istvan Toth <stoty@apache.org>
Reviewed-by: Dávid Paksy <paksyd@cloudera.com>
(cherry picked from commit 8366304)
@NihalJain

NihalJain commented Oct 21, 2024

Copy link
Copy Markdown
ContributorAuthor

Hi all, thank you for your reviews, merged to master. Also, raised backport for all active branches.

Hi @chandrasekhar-188k request you to update your email id on your github profile, so that can give you due credit for your reviews during PR merge.

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

@NihalJain@Apache-HBase@stoty@PDavid@chandrasekhar-188k