• Stars
    star
    138
  • Rank 264,508 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 3 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Log4jDetect

WhiteSource Log4j Detect is a free CLI tool that quickly scans your projects to find vulnerable Log4j versions containing the following known CVEs:

  • CVE-2021-45046
  • CVE-2021-44228
  • CVE-2021-4104
  • CVE-2021-45105
  • CVE-2021-44832
  • CVE-2020-9488
  • CVE-2020-9493
  • CVE-2022-23302
  • CVE-2022-23305
  • CVE-2022-23307

It provides the exact path to direct and indirect dependencies, along with the fixed version for speedy remediation.

The supported packages managers are:

  • gradle
  • maven
  • bundler

In addition, the tool will search for vulnerable files with the .jar,.gem extensions.

Prerequisites:

  • Download the log4j-detect binary based on your OS platform (see installation steps below)

NOTE

  1. For mac users, if the following message appears: "log4j-detect can't be opened because Apple cannot check it for malicious software", please follow the steps described here

  2. The relevant binaries must be installed for the scan to work, i.e:

    • gradle if the scanned project is a gradle project (contains a settings.gradle or a build.gradle file)
    • mvn if the scanned project is a maven project (contains a pom.xml file)
    • ruby/jruby and gem/jgem if the scanned project is a bundler project (contains a Gemfile.lock/gems.locked file)
  3. Building the projects before scanning will improve scan time and reduce potential scan errors

    • maven projects must be built prior to scanning, e.g. with the following command:

      mvn install
    • bundler projects must be built prior to scanning, e.g. with the following command:

      jbundler install
    • It is not necessary to run gradle build prior to scanning a gradle project, but that will greatly decrease the scan time


Usage

In order to scan your project, simply run the following command:

log4j-detect scan -d PROJECT_DIR

The folder can include source code that uses supported package managers in the project, as well binaries with the supported extensions mentioned above. It may error if it's run in a location which has protected folders it cannot access, such as Windows system folders.

Installation

Linux

ARCH=amd64 # or ARCH=arm64
wget "https://github.com/whitesource/log4j-detect-distribution/releases/latest/download/log4j-detect-1.5.0-linux-$ARCH.tar.gz"
tar -xzvf log4j-detect-1.5.0-linux-$ARCH.tar.gz
chmod +x log4j-detect
./log4j-detect -h

Mac

ARCH=amd64 # or ARCH=arm64 
wget "https://github.com/whitesource/log4j-detect-distribution/releases/latest/download/log4j-detect-1.5.0-darwin-$ARCH.tar.gz"
tar -xzvf log4j-detect-1.5.0-darwin-$ARCH.tar.gz
chmod +x log4j-detect
./log4j-detect -h

Windows

Invoke-WebRequest -Uri "https://github.com/whitesource/log4j-detect-distribution/releases/latest/download/log4j-detect-1.5.0-windows-amd64.zip" -OutFile "log4j-detect.zip"
Expand-Archive -LiteralPath 'log4j-detect.zip'
cd log4j-detect
.\log4j-detect.exe -h

More Repositories

1

renovate-on-prem

WhiteSource Renovate On-Premises Documentation & Examples
Mustache
88
star
2

merge-confidence

The home of Mend's Merge Confidence feature, for Renovate and Mend Remediate
66
star
3

GitHubPackagesSecurityAction

Mend security scan action for Github package registry
JavaScript
64
star
4

agents

White Source external update agents
Java
49
star
5

unified-agent-distribution

Dockerfile
49
star
6

spring4shell-detect

Go
21
star
7

log4j-remediations

A Renovate preset for remediating transitive vulnerabilities of log4j
9
star
8

CureKit

A repository containing code security remediation solutions used by WhiteSource Cure
Java
8
star
9

fs-agent

File system agent for integration with WhiteSource service
Java
6
star
10

whitesource_orb

4
star
11

teamcity-plugin

White Source plugin for JetBrains TeamCity
Java
4
star
12

tfs-plugin

WhiteSource Plugin for TFS
JavaScript
3
star
13

pecoff4j-maven

Mavenized version of pecoff4j
Java
2
star
14

whitesource-bamboo-agent

White Source external update agent for Atlassian Bamboo.
Java
2
star
15

docker-agent

Command line application for Docker container integration with WhiteSource
Java
2
star
16

wss-serverless-plugin

whitesource serverless plugin
JavaScript
1
star
17

fs-agent-distribution

Shell
1
star
18

python-plugin

White Source Plugin for Python SetupTools
Python
1
star
19

wss-codefresh-integration

WhiteSource code fresh integration
Shell
1
star
20

wss-vc-circleci-integration

WhiteSource vulnerability checker integartion for circleci
1
star
21

cat-core

Comments Analysis Tool. A semi-fork of Apache Creadur Rat Core module, intended for analyzing file comments for license analysis.
Java
1
star