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

CNDB-11076: bump SLF4J version to 2.0.9; bump logback version to 1.4.14 to get rid of security holes #1515

Merged
merged 7 commits into from
Jan 23, 2025

Conversation

jakubzytka
Copy link

@jakubzytka jakubzytka commented Jan 17, 2025

What is the issue

Old slf4j and logback are suffering from known security vulnerabilities.

What does this PR fix and why was it fixed

This change upgrades the dependencies to versions with fixed vulnerabilities.

Checklist before you submit for review

  • Make sure there is a PR in the CNDB project updating the Converged Cassandra version
  • Use NoSpamLogger for log lines that may appear frequently in the logs
  • Verify test results on Butler
  • Test coverage for new/modified code is > 80%
  • Proper code formatting
  • Proper title for each commit staring with the project-issue number, like CNDB-1234
  • Each commit has a meaningful description
  • Each commit is not very long and contains related changes
  • Renames, moves and reformatting are in distinct commits

@jakubzytka jakubzytka force-pushed the cndb-11076-update-slf4j-and-logback branch from 8ea5c96 to 6e13349 Compare January 17, 2025 13:32
new ObjectName("ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator"),
JMXConfiguratorMBean.class);
jmxConfiguratorMBean.reloadDefaultConfiguration();
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
Copy link
Author

Choose a reason for hiding this comment

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

that's on basis of:
qos-ch/logback@fa3de69

we'll see how the CI is gonna look like
I'll do some manual test too.

Copy link
Author

Choose a reason for hiding this comment

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

added a unit test that shows this works

Copy link
Collaborator

Choose a reason for hiding this comment

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

did the previous code register an MBean? does it do that now as well?

Copy link
Author

Choose a reason for hiding this comment

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

Old logback had an mbean.
The new one doesn't have it.
We are no longer using it.
I don't think that mbeans registered by 3rd party libraries are part of the Cassandra interface

@@ -20,7 +20,7 @@
<define name="instance_id" class="org.apache.cassandra.distributed.impl.InstanceIDDefiner" />

<!-- Shutdown hook ensures that async appender flushes -->
<shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook"/>
<shutdownHook class="ch.qos.logback.core.hook.DefaultShutdownHook"/>
Copy link
Author

Choose a reason for hiding this comment

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

renamed in logback in:
qos-ch/logback@4d705d9

@@ -1814,9 +1815,16 @@ public void testEmptyListAndNullInitcond() throws Throwable
public void testLogbackReload() throws Throwable
{
// see https://issues.apache.org/jira/browse/CASSANDRA-11033
Logger l = LoggerFactory.getLogger(AggregationTest.class);
Copy link
Author

Choose a reason for hiding this comment

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

the test didn't work previously due to ReconfigureOnChangeTask being used instead of filters.

I changed it to run the reconfigure task as intended. let's see what happens....

@@ -18,7 +18,7 @@
*/
package org.apache.cassandra.utils;

import org.apache.log4j.Logger;
import org.slf4j.LoggerFactory;
Copy link
Author

Choose a reason for hiding this comment

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

I removed all log4j.
that's the only place that needed a change.

@jakubzytka jakubzytka force-pushed the cndb-11076-update-slf4j-and-logback branch from 6e13349 to aad4041 Compare January 20, 2025 16:07
@@ -34,7 +34,7 @@

<appender name="INSTANCESTDERR" target="System.err" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%-5level %date{HH:mm:ss,SSS} %msg%n</pattern>
<pattern>%-5level %date{"HH:mm:ss,SSS"} %msg%n</pattern>
Copy link
Author

Choose a reason for hiding this comment

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

the original one is an invalid pattern, probably since logback 1.3
https://logback.qos.ch/manual/layouts.html#date

@jakubzytka jakubzytka requested a review from a team January 21, 2025 14:39
build.xml Outdated Show resolved Hide resolved
@jakubzytka jakubzytka force-pushed the cndb-11076-update-slf4j-and-logback branch from e3f54a8 to 61995d1 Compare January 23, 2025 13:16
@cassci-bot
Copy link

❌ Build ds-cassandra-pr-gate/PR-1515 rejected by Butler


1 new test failure(s) in 8 builds
See build details here


Found 1 new test failures

Test Explanation Branch history Upstream history
...=set,wide=true,scenario=SSTABLE_QUERY] regression 🔴🔵🔵🔵🔵🔵🔵 🔵🔵🔵🔵🔵🔵🔵

Found 43 known test failures

@jakubzytka jakubzytka merged commit 9f2541a into main Jan 23, 2025
464 of 475 checks passed
@jakubzytka jakubzytka deleted the cndb-11076-update-slf4j-and-logback branch January 23, 2025 16:37
djatnieks pushed a commit that referenced this pull request Jan 29, 2025
djatnieks pushed a commit that referenced this pull request Jan 29, 2025
djatnieks pushed a commit that referenced this pull request Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants