Skip to content

Commit

Permalink
Add output images (#113)
Browse files Browse the repository at this point in the history
* Add 09_bans example
* Add output examples, fixup code fences
  • Loading branch information
Jake-Shadle authored Jan 20, 2020
1 parent b27e67d commit 2e60cc4
Show file tree
Hide file tree
Showing 17 changed files with 1,192 additions and 16 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

[![Build Status](https://github.com/EmbarkStudios/cargo-deny/workflows/CI/badge.svg)](https://github.com/EmbarkStudios/cargo-deny/actions?workflow=CI)
[![Latest version](https://img.shields.io/crates/v/cargo-deny.svg)](https://crates.io/crates/cargo-deny)
[![Docs](https://img.shields.io/badge/docs-The%20Book-green.svg)](https://embarkstudios.github.io/cargo-deny/)
[![Docs](https://img.shields.io/badge/The%20Book-📕-brightgreen.svg)](https://embarkstudios.github.io/cargo-deny/)
[![API Docs](https://docs.rs/cargo-deny/badge.svg)](https://docs.rs/cargo-deny)
[![SPDX Version](https://img.shields.io/badge/SPDX%20Version-3.7-blue.svg)](https://spdx.org/licenses/)
[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
[![Embark](https://img.shields.io/badge/embark-open%20source-blueviolet.svg)](http://embark.dev)

`cargo-deny` is a cargo plugin for linting your dependencies. See the [book 📖](https://embarkstudios.github.io/cargo-deny/) for in-depth documentation.
`cargo-deny` is a cargo plugin for linting your dependencies. See the [book 📕](https://embarkstudios.github.io/cargo-deny/) for in-depth documentation.

To run on CI as a GitHub Action, see [`cargo-deny-action`](https://github.com/EmbarkStudios/cargo-deny-action).

Expand Down Expand Up @@ -46,6 +46,8 @@ The licenses check is used to verify that every crate you use has license terms
cargo deny check licenses
```

<img src="https://imgur.com/XMmvx9L.png"/>

#### [Bans](https://embarkstudios.github.io/cargo-deny/checks/bans/index.html)

The bans check is used to deny (or allow) specific crates, as well as detect and handle multiple versions of the same crate.
Expand All @@ -54,6 +56,8 @@ The bans check is used to deny (or allow) specific crates, as well as detect and
cargo deny check bans
```

<img src="https://imgur.com/K3UeXcR.png"/>

#### [Advisories](https://embarkstudios.github.io/cargo-deny/checks/advisories/index.html)

The advisories check is used to detect issues for crates by looking in an advisory database.
Expand All @@ -62,6 +66,8 @@ The advisories check is used to detect issues for crates by looking in an adviso
cargo deny check advisories
```

<img src="https://imgur.com/FK50XLb.png"/>

#### [Sources](https://embarkstudios.github.io/cargo-deny/checks/sources/index.html)

The sources check ensures crates only come from sources you trust.
Expand All @@ -70,6 +76,8 @@ The sources check ensures crates only come from sources you trust.
cargo deny check sources
```

<img src="https://imgur.com/xdHFDWS.png"/>

## Contributing

We welcome community contributions to this project.
Expand Down
6 changes: 6 additions & 0 deletions docs/src/checks/advisories/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
The advisories check is used to detect issues for crates by looking in an
advisory database.

```bash
cargo deny check advisories
```

<img src="https://imgur.com/FK50XLb.png"/>

## Use Case - Detecting security vulnerabilities

Security vulnerabilities are generally considered "not great" by most people,
Expand Down
6 changes: 6 additions & 0 deletions docs/src/checks/bans/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
The bans check is used to deny (or allow) specific crates, as well as detect
and handle multiple versions of the same crate.

```bash
cargo deny check bans
```

<img src="https://imgur.com/K3UeXcR.png"/>

## Use Case - Denying specific crates

Sometimes, certain crates just don't fit in your project, so you have to remove
Expand Down
6 changes: 6 additions & 0 deletions docs/src/checks/licenses/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ you find acceptable. cargo-deny does this by evaluating the license requirements
specified by each crate against the [configuration](cfg.md) you've specified to
determine if your project meets that crate's license requirements.

```bash
cargo deny check licenses
```

<img src="https://imgur.com/XMmvx9L.png"/>

### SPDX

cargo-deny uses [SPDX license expressions][SPDX] as the source of truth for the
Expand Down
10 changes: 9 additions & 1 deletion docs/src/checks/sources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@

The sources check ensures crates only come from sources you trust.

```bash
cargo deny check sources
```

<img src="https://imgur.com/xdHFDWS.png"/>

## Use Case - Only allowing known/trusted sources

Cargo can retrieve crates from a variety of sources, namely registries,
git repositories, or local file paths. This is great in general and very
flexible for development. But esp. re-routing dependencies to git repositories increases the amount of sources that one would have to trust and may be something a repository want explicitly opt-in to.
flexible for development. But esp. re-routing dependencies to git repositories
increases the amount of sources that one would have to trust and may be
something a repository want explicitly opt-in to.

See [Why npm lockfiles can be a security blindspot for injecting malicious modules](https://snyk.io/blog/why-npm-lockfiles-can-be-a-security-blindspot-for-injecting-malicious-modules/)
for the motivating reason for why this check was added.
Expand Down
4 changes: 2 additions & 2 deletions examples/01_allow_license/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ the license requirements of every crate in your dependency graph.

## Requirement

```toml
```ini
license = "MIT OR Apache-2.0"
```

## Config

```toml
```ini
[license]
allow = [ "MIT" ]
```
Expand Down
4 changes: 2 additions & 2 deletions examples/02_deny_license/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ the license requirements of every crate in your dependency graph.

## Requirement

```toml
```ini
license = "MIT AND Apache-2.0"
```

## Config

```toml
```ini
[licenses]
allow = [ "MIT" ]
deny = [ "Apache-2.0" ]
Expand Down
4 changes: 2 additions & 2 deletions examples/03_deny_copyleft/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ the license requirements of every crate in your dependency graph.

## Requirement

```toml
```ini
license = "MIT AND Apache-2.0"
```

## Config

```toml
```ini
[licenses]
allow = [ "MIT" ]
deny = [ "Apache-2.0" ]
Expand Down
4 changes: 2 additions & 2 deletions examples/04_gnu_licenses/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ This example shows how to deal with the GNU style licenses such as GPL, AGPL, LG

## Requirement

```toml
```ini
license = "GPL-2.0-or-later AND LGPL-3.0-only"
```

## Config

```toml
```ini
[licenses]
allow = [ "GPL-3.0" ]
copyleft = "deny"
Expand Down
2 changes: 1 addition & 1 deletion examples/06_advisories/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This example shows cargo-deny's default behavior when checking security advisori

## Config

```toml
```ini
[dependencies]
# ammonia had a stack overflow < 2.1.0
# https://github.com/RustSec/advisory-db/blob/01ac6725d549dbc7873250fe2a55e54d528fe945/crates/ammonia/RUSTSEC-2019-0001.toml
Expand Down
5 changes: 2 additions & 3 deletions examples/07_deny_sources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ This example shows how to use cargo-deny to deny and only support explicitly all

## Config

```toml

```ini
[dependencies]
bitflags = { git = "https://github.com/bitflags/bitflags.git" }
```

```toml
```ini
[sources]
unknown-registry = "deny"
unknown-git = "deny"
Expand Down
2 changes: 1 addition & 1 deletion examples/08_target_filtering/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This example shows how to filter dependencies based upon their target configurat

## Config

```toml
```ini
targets = [
{ triple = "x86_64-unknown-linux-gnu" },
{ triple = "wasm32-unknown-unknown", features = ["atomics"] },
Expand Down
Loading

0 comments on commit 2e60cc4

Please sign in to comment.