GithubHelp home page GithubHelp logo

log4j-detect-distribution's Introduction

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

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

Installation

Linux

ARCH=amd64 # or ARCH=arm64
wget "https://github.com/whitesource/log4j-detect-distribution/releases/latest/download/log4j-detect-1.4.0-linux-$ARCH.tar.gz"
tar -xzvf log4j-detect-1.4.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.4.0-darwin-$ARCH.tar.gz"
tar -xzvf log4j-detect-1.4.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.4.0-windows-amd64.zip" -OutFile "log4j-detect.zip"
Expand-Archive -LiteralPath 'log4j-detect.zip'
cd log4j-detect
.\log4j-detect.exe -h

log4j-detect-distribution's People

Contributors

annarozin avatar nabeelsaabna avatar noamdolovichws avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.