Giter Club home page Giter Club logo

trivy-maven-plugin's Introduction

trivy-maven-plugin

This is a Maven plugin developed to simplify the process of scanning Docker images for vulnerabilities using Trivy.

This plugin utilizes Trivy as a security tool, operating in the background to enhance the protection and reliability of our software. Trivy is an open-source vulnerability analysis tool developed by AquaSecurity.

CI

maven-trivy-plugin

About the Plugin

The plugin has been created to streamline the task of performing Docker image scans for security vulnerabilities using the Trivy tool.

With this plugin, you can easily integrate security analysis into your Maven development workflow, enabling early detection of potential vulnerabilities in your Docker images.

Prerequisites

Before using this plugin, please ensure that Docker is installed on your system.

The plugin relies on Docker for scanning Docker images.

And Java 11 +

Usage

Add the Maven plugin to your project's pom.xml file, specifying the required configurations.

<plugin>
    <groupId>tech.orla</groupId>
    <artifactId>trivy-maven-plugin</artifactId>
    <version>${LATEST_VERSION}</version>
    <configuration>
        <vulnType>os,library</vulnType>
        <severity>HIGH,CRITICAL</severity>
        <ignoreUnfixed>true</ignoreUnfixed>
        <trivyVersion>v0.49.1</trivyVersion>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>trivy-scan</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Run the appropriate Maven command to perform Docker image scanning using the plugin. For example, mvn tech.orla:trivy-maven-plugin:trivy-scan

Configuration

The plugin provides the following basic configuration:

  • dockerFilePath: path to the Dockerfile. Default: current directory.
  • vulnType: vulnerability types to be analyzed. Default: all vulnerabilities.
  • severity: minimum severity of vulnerabilities to be displayed. Default: all severities.
  • ignoreUnfixed: ignore unfixed vulnerabilities. Default: false.
  • trivyVersion: choose trivy version. Default: v0.49.1.

Contributing

Contributions are welcome! Feel free to fork this repository, create a branch, make the desired changes, and submit a pull request.

License

This plugin is licensed under the Apache License 2.0

trivy-maven-plugin's People

Contributors

dependabot[bot] avatar netodevel-orla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

cmitatakis

trivy-maven-plugin's Issues

Missing class files

Hi
Since there is only source code released we built the project with the delivered pom.xml .

I have put the plugin into a profile named "dependencyCheck" in our company's project.

When I run (as described in the project description)

mvn br.com.orla:trivy-maven-plugin:trivy-scan -P dependencyCheck

I receive the following error:

[ERROR] Failed to execute goal br.com.orla:trivy-maven-plugin:1.0.0:trivy-scan (default-cli) on project tms_parent: Execution default-cli of goal br.com.orla:trivy-maven-plugin:1.0.0:trivy-scan failed: A required class was missing while executing br.com.orla:trivy-maven-plugin:1.0.0:trivy-scan: com/google/common/io/Files
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>br.com.orla:trivy-maven-plugin:1.0.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/rkreutz/.m2/repository/br/com/orla/trivy-maven-plugin/1.0.0/trivy-maven-plugin-1.0.0.jar
[ERROR] urls[1] = file:/C:/Users/rkreutz/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : com.google.common.io.Files

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.