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

Move off of dangerous log4j dependency #7

Merged
merged 2 commits into from
Dec 13, 2023
Merged

Conversation

casewalker
Copy link
Collaborator

@casewalker casewalker commented Nov 27, 2023

The dependency that came from Serverless's Java Lambda template (com.amazonaws:aws-lambda-java-log4j:1.0.1) is so old, it is still subject to log4j bugs! See vulnerabilities here. And it is also the newest version of this dependency, having been released in 2020.

This change removes that dependency and follows guidance from AWS docs here to get logging setup correctly with other dependencies.

@@ -31,6 +34,7 @@ dependencies {
}

test {
jvmArgs "-Xshare:off"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Slightly unrelated change, just removing a dumb warning when running tests.

@casewalker casewalker requested a review from a team November 28, 2023 05:24
@@ -49,7 +50,7 @@
public class SamlGenerator {

/* Constants */
private static final Logger logger = Logger.getLogger(SamlGenerator.class);
private static final Logger logger = LogManager.getLogger(SamlGenerator.class);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This Logger.getLogger(... -> LogManager.getLogger(... change is part of the upgrade

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Notice above how the imports change from:
org.apache.log4j... to:
org.apache.logging.log4j...

This is a really annoying way they try to be backwards compatible (I guess?) but upgrade their code >.<

Copy link

@mluedke2 mluedke2 left a comment

Choose a reason for hiding this comment

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

that is indeed weird that dependabot didn't say anything... maybe because the fix isn't just a version bump?

@casewalker
Copy link
Collaborator Author

Thanks for the review! I have pushed this change into prod, but I kinda want to leave this open until I get a response from GitHub about Dependabot. Not sure if this link works for others, but my GitHub ticket is here.

@casewalker
Copy link
Collaborator Author

I rebased this review on Main since there were a lot of changes to how dependencies are defined, I am going to use the sticky-accept since none of the other parts of this review changed.

@casewalker casewalker merged commit dfcd98b into main Dec 13, 2023
2 checks passed
@casewalker casewalker deleted the fix-logger-setup branch December 13, 2023 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants