Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log4j cleanup on Blazegraph and FITS #332

Merged
merged 7 commits into from
May 13, 2024

Conversation

noahwsmith
Copy link
Contributor

Clean out ancient log4j and replace with patched version.

Clean out ancient log4j and replace with patched version
@noahwsmith noahwsmith changed the title Log4j cleanup on Blazegraph Log4j cleanup on Blazegraph, FITS and Solr May 9, 2024
@noahwsmith
Copy link
Contributor Author

Updated to include cleanup on FITS and Solr as well as Blazegraph. @misilot has offered to test.

@noahwsmith
Copy link
Contributor Author

The built test images are available as:
borndigital/blazegraph:blazegraph-log4j, borndigital/solr:blazegraph-log4j and borndigital/fits:blazegraph-log4j

@noahwsmith noahwsmith changed the title Log4j cleanup on Blazegraph, FITS and Solr Log4j cleanup on Blazegraph and FITS May 9, 2024
@noahwsmith
Copy link
Contributor Author

Backing out of Solr - not necessary https://github.com/apache/solr-docker/blob/main/9.5/Dockerfile
And covered here by the update to Solr 9.x: #313

solr/Dockerfile Outdated Show resolved Hide resolved
@misilot
Copy link
Contributor

misilot commented May 10, 2024

@noahwsmith it looks like it might be still be part of a couple of layers :(

Path : /var/lib/docker/overlay2/bfee10e74d13452ab0bb6c93123be38cea006ec7d705911b6db71d53c4e339c1/diff/opt/tomcat/webapps/bigdata/WEB-INF/lib/log4j-1.2.17.jar
Installed version : 1.2.17

Path : /var/lib/docker/overlay2/e9f42b9942914e758fa4c1e32cd87794de5c3274a1e70a56a5f901d742747176/diff/opt/tomcat/webapps/bigdata/WEB-INF/lib/log4j-1.2.17.jar
Installed version : 1.2.17

--sha256 "${LOG4J_FILE_SHA256}" \
&& \
## Remove the outmoded log4j-* files that come with blazegraph
rm -f "/opt/tomcat/webapps/bigdata/WEB-INF/lib/log4j-1.2.17.jar" && \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line specifically removes /opt/tomcat/webapps/bigdata/WEB-INF/lib/log4j-1.2.17.jar

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@misilot The way this PR works is simply that we scrub that out after it is initially brought in by the Blazegraph install. So it's not surprising to me that the file is in an earlier layer but it is not in the final image.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think Line 11/16 is adding it. The two RUN commands I think need to be combined, so there isn't a layer where the log4j*.jar exists.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea - I'll try that...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, building now. I brought the RM back up to the first RUN...

@misilot
Copy link
Contributor

misilot commented May 13, 2024

Thanks @noahwsmith this PR seems to work great, and we are no longer getting the log4j hits on our scans.

@noahwsmith noahwsmith requested a review from joecorall May 13, 2024 16:15
@noahwsmith
Copy link
Contributor Author

@joecorall How do you feel about this? Any objections to merging?

@joecorall joecorall merged commit 1543708 into Islandora-Devops:main May 13, 2024
Sign up for free to 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.

3 participants