-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
snakeyaml cve fix #24099
base: master
Are you sure you want to change the base?
snakeyaml cve fix #24099
Conversation
522f10d
to
42b67e8
Compare
Presto Cassandra Tests were failing because the cassandra-server version 2.1.16-1 using sankeyaml 1.x as tranistiive dependency and if we update the version it will cause some methodNotFound Error. Inorder to overcome this we removed the cassandra-server from presto and cherrypicked the dockerised cassandra in tests as done in Trino . This approach will resolve the issue. |
presto-cassandra/src/test/java/com/facebook/presto/cassandra/CassandraQueryRunner.java
Show resolved
Hide resolved
@@ -94,6 +93,8 @@ public class TestCassandraConnector | |||
ImmutableSet.of(), | |||
Optional.empty(), | |||
ImmutableMap.of()); | |||
|
|||
private CassandraServer server; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this private member to the private section below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
@@ -94,10 +94,10 @@ partitioner: org.apache.cassandra.dht.Murmur3Partitioner | |||
|
|||
# directories where Cassandra should store data on disk. | |||
data_file_directories: | |||
- ${data_directory}/data | |||
- /var/lib/cassandra/data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would happen if /var/lib/cassandra does not exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the path in Cassandra container and when we start the Cassandra by default will write its data files there.
@@ -123,27 +114,19 @@ private static String prepareCassandraYaml() | |||
return yamlLocation.toAbsolutePath().toString(); | |||
} | |||
|
|||
public static synchronized CassandraSession getSession() | |||
public CassandraSession getSession() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For line 109:
Since you removed data_directory from cu-cassandra.yaml, this is no longer needed. However we need to make sure the path you specified always exist and won't cause error on different platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I have removed the line. Also the path is inside cassandra docker container and it will be independent of the platforms, so I believe this won't cause issues. I have updated the cherrypick id in the description of the PR.
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this bring used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dependencyManagement section is to fix the Require upper bound dependencies error for slf4j while building the cassandra module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain a little bit about why the error happens if this one was not added? Is org.testcontainers dependent on slf4j or something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes @yingsu00 .
slf4j comes as a transitive dependency in org.testcontainers. If we do not add this dependencymanagement tag
the following error will come.
Rule 0: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message:
Failed while enforcing RequireUpperBoundDeps.
.....
.....
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M2:enforce (default) on project presto-cassandra: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
Inorder to fix this I have added the slf4j version as dependencyManagement tag.
229bdf6
to
0842929
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the commit message, there should be an empty line after the commit tile.
e7f0e93
to
568312e
Compare
@yingsu00 Updated the commit message.Please verify |
snakeyaml 1.x version causing mend scan CVEs. Cherry-pick of trinodb/trino#2377 Co-authored-by: Yuya Ebihara <[email protected]>
568312e
to
fcfb964
Compare
Description
Upgrade snakeyaml version to 2.0
Presto Cassandra Tests were failing because the cassandra-server version 2.1.16-1 using sankeyaml 1.x as tranistiive dependency and if we update the version it will cause some methodNotFound Error. Inorder to overcome this we removed the cassandra-server from presto and cherrypicked the dockerised cassandra in tests as done in Use dockerized Cassandra in tests trinodb/trino#2377 . This approach will resolve the issue.
Motivation and Context
CVE-2022-1471
CVE-2022-25857
CVE-2017-18640
CVE-2022-38752
CVE-2022-38751
CVE-2022-38750
CVE-2022-38749
CVE-2022-41854
Impact
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.