Graylog2 / graylog-s3-lambda

An AWS Lambda function that reads logs from S3 and sends them to Graylog
GNU General Public License v3.0
12 stars 6 forks source link

Update dependencies (including log4j to 2.17.1) #29

Closed danotorrey closed 2 years ago

danotorrey commented 2 years ago

Overview

Update all out-of-date dependencies for graylog-s3-lambda.

Motivation

Log4j-related dependencies were recently updated in #26 and #27. And, since many other dependencies are quite out-of-date, I thought now would be a good opportunity to update them.

Details

Note that the import for S3EventNotification.S3Event in S3EventProcessor had to be updated, because the latest version of aws-lambda-java-events removed AWS SDK dependencies from itself. So, the S3Event class must be imported from the new location com.amazonaws.services.lambda.runtime.events.models.s3 from the aws-lambda-java-events dependency.

See https://github.com/aws/aws-lambda-java-libs/pull/127 for details.

Testing

I performed a test to ensure that the AWS Lambda function still appears to work with the new dependeny versions. Please also test it yourself as part of the PR review process to help ensure it is working correctly. Use mvn clean package to build a testable jar. See the README and RELEASE docs for more details.

Test Plan

Change Logs:

Notes for Reviewers

bernd commented 2 years ago

@danotorrey See: https://github.com/Graylog2/graylog2-server/pull/11814 There is a new Log4j 2 version we might want to upgrade to.

danotorrey commented 2 years ago

Thanks @bernd. Done.

Note: I presume that the aws-lambda and aws-lambda-log4 dependencies will also be updated to the same 2.16.0 log4j version shortly. We'll want to include those too before merging this. I created an issue to get feedback from their team if this will be done.

Update: PR changed back to a draft while we wait for the 2.16.0 aws-lamba dependency updated. Testing on this PR can proceed.

danotorrey commented 2 years ago

The aws-lambda team started working on updating the log4j dependencies to 2.16.0 in https://github.com/aws/aws-lambda-java-libs/pull/290, so I assume that will be released soon. I'll update this PR once again when that is released.

danotorrey commented 2 years ago

The aws-lambda-java-log4j2 dependency has been updated to 1.4.0, which uses log4j 2.16.0.

This PR is ready for review once again.

danotorrey commented 2 years ago

Updates just made to this PR:

danotorrey commented 2 years ago

Tested successfully for me too. Thanks a lot for setting up the test environment @kingzacko1!

danotorrey commented 2 years ago

@bernd @malcyon Do either of you have time to take one final look at the dependency updates before merging this? Asking in case you have more familiarity with what versions are ok for the core product.