Mitigate Log4j in SSIS jars and list Log4j jars
Rename the Log4j 1.2 jars of the SQL Server 2019 SSIS extensions and list the Log4j jars found on the drives.
SQL Server Integration Services installs ship Log4j 1.2 jars in its common extensions folder. A vulnerability scan can report them. The steps below rename the two jars so they are no longer loaded, then list the Log4j jars found on the local drives with their versions.
Rename the two jars (SQL Server 2019 paths)
Rename-Item "C:\Program Files\Microsoft SQL Server\150\DTS\Extensions\Common\Jars\log4j-1.2.17.jar" "C:\Program Files\Microsoft SQL Server\150\DTS\Extensions\Common\Jars\log4j-1.2.17.jar.mitigation"
Rename-Item "C:\Program Files\Microsoft SQL Server\150\DTS\Extensions\Common\Jars\slf4j-log4j12-1.7.5.jar" "C:\Program Files\Microsoft SQL Server\150\DTS\Extensions\Common\Jars\slf4j-log4j12-1.7.5.jar.mitigation"
List the Log4j jars on all drives
foreach ($drive in Get-PSDrive -PSProvider FileSystem) {
"# Browsing $($drive.Root)"
foreach ($jar in Get-ChildItem -Path $drive.Root -File -ErrorAction SilentlyContinue -Force -Recurse -Filter '*log4j*.jar') {
if ($jar.Name -match '\d[\d.]*\d') {
"# $($jar.FullName)"
"NVD_APPLICATION:cpe:2.3:a:apache:log4j:$($Matches[0]):*:*:*:*:*:*:*"
}
}
""
}
Notes
- The paths are those of a SQL Server 2019 instance (folder
150). Adapt the version folder to your instance. - The scan walks every file system drive recursively and can take a long time on large servers.
- The version comes from the first match of the file name pattern. The output lines use the NVD application CPE format that scanners read.
- To undo the mitigation, rename the files back by removing the
.mitigationsuffix. Packages that use these extensions may fail while the jars are renamed; test them after the change. - The source note also contained the configuration and backup procedure of a monitoring product, with hosts and credentials. It is not part of this article.
- The source wrote
$($Matches.0), which is not a valid match reference. It was corrected to$($Matches[0]).