Skip to content

Commit

Permalink
Create a separate Log4Shell recipe (#153)
Browse files Browse the repository at this point in the history
* Create a separate Log4Shell recipe

As requested on #150 (comment)

* Update log4j.yml

to fix Copilot suggestions.
  • Loading branch information
timtebeek authored Jun 7, 2024
1 parent f7c3277 commit ca0b67a
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/main/resources/META-INF/rewrite/log4j.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,22 @@ recipeList:
newGroupId: org.apache.logging.log4j
newArtifactId: log4j-slf4j-impl
newVersion: 2.x
- org.openrewrite.java.logging.log4j.UpgradeLog4J2DependencyVersion

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.logging.log4j.UpgradeLog4J2DependencyVersion
displayName: Upgrade Log4j 2.x dependency version
description: |
Upgrades the Log4j 2.x dependencies to the latest 2.x version.
Mitigates the [Log4Shell and other Log4j2-related vulnerabilities](https://www.cisa.gov/news-events/cybersecurity-advisories/aa21-356a).
tags:
- logging
- log4j
- log4shell
- security
- CVE-2021-44228
recipeList:
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.apache.logging.log4j
artifactId: '*'
Expand All @@ -125,7 +141,7 @@ recipeList:
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.logging.log4j.CommonsLoggingToLog4j
displayName: Migrate JCL to Log4j 2.x API.
displayName: Migrate JCL to Log4j 2.x API
description: Transforms code written using Apache Commons Logging to use Log4j 2.x API.
tags:
- logging
Expand All @@ -151,7 +167,7 @@ recipeList:
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.logging.log4j.JulToLog4j
displayName: Migrate JUL to Log4j 2.x API.
displayName: Migrate JUL to Log4j 2.x API
description: Transforms code written using `java.util.logging` to use Log4j 2.x API.
tags:
- logging
Expand Down Expand Up @@ -193,7 +209,7 @@ recipeList:
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.logging.log4j.Slf4jToLog4j
displayName: Migrate SLF4J to Log4j 2.x API.
displayName: Migrate SLF4J to Log4j 2.x API
description: Transforms code written using SLF4J to use Log4j 2.x API.
tags:
- logging
Expand Down

0 comments on commit ca0b67a

Please sign in to comment.