Coder Social home page Coder Social logo

stephanerob / mix_audit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mirego/mix_audit

0.0 1.0 0.0 1.69 MB

🕵️‍♀️ MixAudit provides a mix deps.audit task to scan a project Mix dependencies for known Elixir security vulnerabilities

Home Page: https://open.mirego.com

License: BSD 3-Clause "New" or "Revised" License

Elixir 93.23% Makefile 6.77%

mix_audit's Introduction



MixAudit provides a mix deps.audit task to scan Mix dependencies for security vulnerabilities.
It draw its inspiration from tools like npm audit and bundler-audit.

Installation

Project dependency

Add mix_audit to the deps function in your project’s mix.exs file:

defp deps do
  [
    {:mix_audit, "~> 2.0", only: [:dev, :test], runtime: false}
  ]
end

Then run mix do deps.get, deps.compile inside your project’s directory.

Local escript

If you do not wish to include mix_audit in your project dependencies, you can install it as global escript:

$ mix escript.install hex mix_audit
…
* creating …/.mix/escripts/mix_audit

The only difference is that instead of using the mix deps.audit task, you will have to use the created executable.

Usage

To generate a security report, you can use the deps.audit Mix task:

$ mix deps.audit

Options

Option Type Default Description
--path String Current directory The root path of the project to audit
--format String "human" The format of the report to generate ("json" or "human")
--ignore-advisory-ids String "" Comma-separated list of advisory IDs to ignore
--ignore-package-names String "" Comma-separated list of package names to ignore

Example

How does it work?

MixAudit builds two lists when it’s executed in a project:

  1. A list of security advisories fetched from the GitHub-sourced elixir-security-advisories repository
  2. A list of Mix dependencies from the various mix.lock files in the project

Then, it loops through each project dependency and tries to find security advisories that apply to it (through its package name) and that match its version specification (through the advisory vulnerable version ranges).

If one is found, a vulnerability (the combination of a security advisory and a project dependency) is then added to the report.

The task will exit with a 0 status only if the report passes (ie. it reports no vulnerabilities). Otherwise, it will exit with a 1 status.

License

MixAudit is © 2020 Mirego and may be freely distributed under the New BSD license. See the LICENSE.md file.

The detective hat logo is based on this lovely icon by Vectors Point, from The Noun Project. Used under a Creative Commons BY 3.0 license.

About Mirego

Mirego is a team of passionate people who believe that work is a place where you can innovate and have fun. We’re a team of talented people who imagine and build beautiful Web and mobile applications. We come together to share ideas and change the world.

We also love open-source software and we try to give back to the community as much as we can.

mix_audit's People

Contributors

remi avatar jcsrb avatar almirsarajcic avatar

Watchers

James Cloos 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.