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

Upgrade to AWS SDK v2 #272

Merged
merged 4 commits into from
Nov 26, 2024
Merged

Upgrade to AWS SDK v2 #272

merged 4 commits into from
Nov 26, 2024

Conversation

mchv
Copy link
Member

@mchv mchv commented Nov 19, 2024

What does this change?

I recently started to look at AWS FSBP reported issues for one of our AWS account, and enabled AWS Lambda Inspector.
It immediately identifies that lambda provided by security-hq are still embedding vulnerable version of Log4j!

I was surprised by this but found this was due to the dependency to anghammarad-client which is still using the first version of AWS SDK, which depend to vulnerable versions of Log4j.

The associated changes do the following:

  • 89295fa — Migration to the version 2 of the AWS SDK
  • 25f6c4e — Move compatibility to Java 21 (Latest LTS) as SDK upgrade is a breaking change and consumers should be running it or upgrading their runtime as the same time.
  • cfafe5b — Adopt setup-scala Github action

What are the next steps?

Copy link

changeset-bot bot commented Nov 19, 2024

⚠️ No Changeset found

Latest commit: ad7e78c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@adamnfish adamnfish left a comment

Choose a reason for hiding this comment

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

LGTM me, and I've verified it still sends a test message locally.

Thank you for the contribution! I do have one question about setting the -release flag to 21, happy to chat this over with you.

build.sbt Outdated
@@ -17,14 +18,14 @@ inThisBuild(Seq(
"-deprecation",
"-Xfatal-warnings",
"-encoding", "UTF-8",
"-release:11",
"-release:21",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we might want to target a lower version of the JVM because the Anghammarad client library gets published?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd also observe that this means Anghammarad can only be run locally by people running 21+, it gives the error "21 is not a valid choice for -java-output-version" if you're running 17 or 11, both common choices still.
I appreciate we do have a .tool-versions file here, but:

  • I'm not sure how widely used that is, does everyone actually use asdf?
  • the pinned version is currently 7 months out of date, but with no plan (or automation) this will get worse in the future, so we don't necessarily want to hang local development workflows off it

These are outstanding questions that we can sidestep by simple setting a more modest JDK target. Very happy to chat this over!

@@ -4,6 +4,7 @@ import sbtversionpolicy.withsbtrelease.ReleaseVersion
val assemblySettings = Seq(
assembly / assemblyMergeStrategy := {
case path if path.endsWith("module-info.class") => MergeStrategy.last
case PathList("META-INF", "io.netty.versions.properties") => MergeStrategy.first //see https://github.com/sbt/sbt-assembly/issues/362
Copy link
Contributor

Choose a reason for hiding this comment

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

We should switch to native-packager to avoid these problems, but something to look at later. Thank you!

@mchv mchv force-pushed the mc-upgrade-sdk-v2 branch from ee62500 to b6e68a4 Compare November 22, 2024 12:00
@mchv
Copy link
Member Author

mchv commented Nov 22, 2024

After discussion with @adamnfish we agreed on removing 25f6c4e so library users who have not yet upgraded to java 21 can still update without worrying about it.

Copy link
Contributor

@adamnfish adamnfish left a comment

Choose a reason for hiding this comment

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

Thank you, LGTM

@mchv mchv merged commit a982857 into main Nov 26, 2024
3 checks passed
@mchv mchv deleted the mc-upgrade-sdk-v2 branch November 26, 2024 11:23
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