From 54f411ad98de5f95c7192e55f0685064fe471e93 Mon Sep 17 00:00:00 2001 From: Marc Hermans Date: Fri, 10 Dec 2021 13:13:11 +0100 Subject: [PATCH] [1.14.x] [CVE-2021-44228]: Update Log4J to fix the security issue inside it. (#8272) --- Jenkinsfile | 30 +++++++++++++++------------- build.gradle | 5 +++-- src/fmllauncher/resources/log4j2.xml | 16 +++++++-------- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1006260378..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,15 +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 { - sh './gradlew ${GRADLE_ARGS} :forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}' - sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.forge/${MYVERSION}' + 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 + } } } 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 @@ -83,7 +85,9 @@ pipeline { CROWDIN = credentials('forge-crowdin') } steps { - sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}' + withGradle { + sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}' + } } } } @@ -91,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 2e13fc0488..c3632c5acc 100644 --- a/build.gradle +++ b/build.gradle @@ -418,8 +418,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.2.+' 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 2f417be965..9f7812dd62 100644 --- a/src/fmllauncher/resources/log4j2.xml +++ b/src/fmllauncher/resources/log4j2.xml @@ -20,24 +20,24 @@ - + - - + + - + - - + + - + @@ -45,7 +45,7 @@ - +