From 05cb868bb2d30412f97dd925e8452e3632efc541 Mon Sep 17 00:00:00 2001 From: Marc Hermans Date: Fri, 10 Dec 2021 13:26:02 +0100 Subject: [PATCH] [CVE-2021-44228]: Update Log4J to fix the security issue inside it. (#8273) --- Jenkinsfile | 33 +++++++++++----------------- build.gradle | 5 +++-- src/fmllauncher/resources/log4j2.xml | 16 +++++++------- 3 files changed, 24 insertions(+), 30 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dc09c6aa4a..a054f3faf5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,8 +6,8 @@ pipeline { } agent { docker { - image 'gradlewrapper:latest' - args '-v gradlecache:/gradlecache' + image 'gradle:jdk8' + args '-v forgegc:/home/gradle/.gradle/' } } environment { @@ -18,11 +18,6 @@ pipeline { } stages { - stage('fetch') { - steps { - checkout scm - } - } stage('notify_start') { when { not { @@ -64,20 +59,22 @@ pipeline { } } environment { - FORGE_MAVEN = credentials('forge-maven-forge-user') CROWDIN = credentials('forge-crowdin') KEYSTORE = credentials('forge-jenkins-keystore-old') KEYSTORE_KEYPASS = credentials('forge-jenkins-keystore-old-keypass') KEYSTORE_STOREPASS = credentials('forge-jenkins-keystore-old-keypass') } steps { - cache(maxCacheSize: 250/*MB*/, caches: [ - [$class: 'ArbitraryFileCache', excludes: '', includes: 'output.txt', path: '${WORKSPACE}/projects/forge/build/extractRangeMap/'] //Cache the rangemap to help speed up builds - ]){ - sh './gradlew ${GRADLE_ARGS} :forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}' + withCredentials([usernamePassword(credentialsId: 'maven-forge-user', usernameVariable: 'MAVEN_USER', passwordVariable: 'MAVEN_PASSWORD')]) { + withGradle { + sh './gradlew ${GRADLE_ARGS} :forge:publish -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}' + } + } + } + post { + success { + build job: 'filegenerator', parameters: [string(name: 'COMMAND', value: "promote net.minecraftforge:forge ${env.MYVERSION} latest")], propagate: false, wait: false } - //We're not testing anymore so don't use the test group - sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.forge/${MYVERSION}' } } stage('test_publish_pr') { //Publish to local repo to test full process, but don't include credentials so it can't sign/publish to maven @@ -88,9 +85,7 @@ pipeline { CROWDIN = credentials('forge-crowdin') } steps { - cache(maxCacheSize: 250/*MB*/, caches: [ - [$class: 'ArbitraryFileCache', excludes: '', includes: 'output.txt', path: '${WORKSPACE}/projects/forge/build/extractRangeMap/'] //Cache the rangemap to help speed up builds - ]){ + withGradle { sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}' } } @@ -100,9 +95,7 @@ pipeline { always { script { archiveArtifacts artifacts: 'projects/forge/build/libs/**/*.*', fingerprint: true, onlyIfSuccessful: true, allowEmptyArchive: true - //junit 'build/test-results/*/*.xml' - //jacoco sourcePattern: '**/src/*/java' - + if (env.CHANGE_ID == null) { // This is unset for non-PRs discordSend( title: "${DISCORD_PREFIX} Finished ${currentBuild.currentResult}", diff --git a/build.gradle b/build.gradle index 4cb799c503..f4eda3dd79 100644 --- a/build.gradle +++ b/build.gradle @@ -339,8 +339,9 @@ project(':forge') { installer 'org.apache.maven:maven-artifact:3.6.0' installer 'net.jodah:typetools:0.6.0' installer 'java3d:vecmath:1.5.2' - installer 'org.apache.logging.log4j:log4j-api:2.11.2' - installer 'org.apache.logging.log4j:log4j-core:2.11.2' + installer 'org.apache.logging.log4j:log4j-api:2.15.0' //TODO: Unpin in 1.18.1 or when Mojang bumps the Log4J version + installer 'org.apache.logging.log4j:log4j-core:2.15.0' //TODO: Unpin in 1.18.1 or when Mojang bumps the Log4J version + installer 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' //TODO: Unpin in 1.18.1 or when Mojang bumps the Log4J version installer 'net.minecrell:terminalconsoleappender:1.1.+' installer 'net.sf.jopt-simple:jopt-simple:5.0.4' fmllauncherImplementation 'com.google.guava:guava:21.0' diff --git a/src/fmllauncher/resources/log4j2.xml b/src/fmllauncher/resources/log4j2.xml index 29eb491b0f..c896696987 100644 --- a/src/fmllauncher/resources/log4j2.xml +++ b/src/fmllauncher/resources/log4j2.xml @@ -20,31 +20,31 @@ - + - - + + - + - - + + - + - +