forked from OpenShiftDemos/sonarqube-openshift-docker
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mitigation documented here; https://logging.apache.org/log4j/2.x/security.html Signed-off-by: Wade Barnes <[email protected]>
- Loading branch information
1 parent
6b4565d
commit 763bdcd
Showing
3 changed files
with
19 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM sonarqube:8-community | ||
FROM sonarqube:8.2-community | ||
|
||
MAINTAINER Erik Jacobs <[email protected]> | ||
MAINTAINER Siamak Sadeghianfar <[email protected]> | ||
|
@@ -21,24 +21,32 @@ LABEL summary="$SUMMARY" \ | |
# Define Plug-in Versions | ||
ARG SONAR_ZAP_PLUGIN_VERSION=1.2.0 | ||
ENV SONARQUBE_PLUGIN_DIR="$SONARQUBE_HOME/extensions/plugins" | ||
|
||
# Switch to root for package installs | ||
USER 0 | ||
RUN apt-get update && \ | ||
apt-get install -y curl zip | ||
|
||
# =============================================================================================== | ||
# Mitigation for CVE-2021-44228 | ||
# Mitigation for CVE-2021-44228 and CVE-2021-45046 | ||
# - Set LOG4J_FORMAT_MSG_NO_LOOKUPS=true | ||
# - Remove JndiLookup.class from the classpath. | ||
# | ||
# References: | ||
# - https://logging.apache.org/log4j/2.x/security.html | ||
# | ||
# Search for jars containing JndiLookup.class: | ||
# - find / -name log4j-core*.jar -exec unzip -vl {} \; 2>/dev/null | grep JndiLookup.class | ||
# ----------------------------------------------------------------------------------------------- | ||
ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true | ||
RUN find / -name log4j-core*.jar -exec zip -q -d {} org/apache/logging/log4j/core/lookup/JndiLookup.class \; 2>/dev/null | ||
# =============================================================================================== | ||
|
||
# Switch to root for package installs | ||
USER 0 | ||
|
||
# ================================================================================================================================================================================ | ||
# Bundle Plug-in(s) | ||
# -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
|
||
# sonar-zap-plugin - https://github.com/Coveros/zap-sonar-plugin | ||
RUN apk add curl | ||
RUN set -x \ | ||
&& cd "$SONARQUBE_PLUGIN_DIR" \ | ||
&& curl -o "sonar-zap-plugin-$SONAR_ZAP_PLUGIN_VERSION.jar" -fsSL "https://github.com/Coveros/zap-sonar-plugin/releases/download/sonar-zap-plugin-$SONAR_ZAP_PLUGIN_VERSION/sonar-zap-plugin-$SONAR_ZAP_PLUGIN_VERSION.jar" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters