Scan your Elixir project's dependencies for known vulnerabilities

栏目: IT技术 · 发布时间: 6年前

内容简介:AddThen runIf you do not wish to include
Scan your Elixir project's dependencies for known vulnerabilities

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, "~> 0.1", 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

Scan your Elixir project's dependencies for known vulnerabilities

How does it work?

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

  1. A list of security advisories fetched from the community-maintained 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 patched and unaffected version policies).

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.


以上所述就是小编给大家介绍的《Scan your Elixir project's dependencies for known vulnerabilities》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

数字乌托邦

数字乌托邦

[美]弗雷德·特纳 / 张行舟、王芳、叶富华、余倩 / 译言·东西文库/电子工业出版社 / 2013-5-1 / 49.80元

20世纪60年代早期,在美国大众眼中,计算机只是冷战中冰冷的机器,然而到了90年代互联网到来之时,计算机却呈现出一个截然不同的世界——它们模拟出了一个数字乌托邦般的协同体,而这正是曾经最反对冷战的嬉皮士们的共同愿景。 本书正是探索这次非同寻常,且颇具讽刺意味的变革的第一本书。作者挖掘出那些在旧金山湾区的先驱者——斯图尔特·布兰德和他的“全球网络”鲜为人知的故事。1968年到1998年期间,通......一起来看看 《数字乌托邦》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换