Change how security advisories work on CI (#3461)

Before this commit we actually have two builders checking for security
advisories on CI, one is `cargo audit` and one is `cargo deny`. The
`cargo deny` builder is slightly different in that it checks a few other
things about our dependency tree such as licenses, duplicates, etc. This
commit removes the advisory check from `cargo deny` on CI and then moves
the `cargo audit` check to a separate workflow.

The `cargo audit` check will now run nightly and will open an issue on
the Wasmtime repository when an advisory is found. This should help make
it such that our CI is never broken by the publication of an advisory
but we're still promptly notified whenever an advisory is made. I've
updated the release process notes to indicate that the open issues
should be double-checked to ensure that there are no open advisories
that we need to take care of.
This commit is contained in:
Alex Crichton
2021-10-19 10:12:36 -05:00
committed by GitHub
parent 13feef7bb8
commit b553d84362
4 changed files with 17 additions and 23 deletions

12
.github/workflows/cargo-audit.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
name: Run cargo-audit
on:
schedule:
- cron: '0 0 * * *'
jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -47,7 +47,7 @@ jobs:
curl -L https://github.com/EmbarkStudios/cargo-deny/releases/download/0.8.5/cargo-deny-0.8.5-x86_64-unknown-linux-musl.tar.gz | tar xzf - curl -L https://github.com/EmbarkStudios/cargo-deny/releases/download/0.8.5/cargo-deny-0.8.5-x86_64-unknown-linux-musl.tar.gz | tar xzf -
mv cargo-deny-*-x86_64-unknown-linux-musl/cargo-deny cargo-deny mv cargo-deny-*-x86_64-unknown-linux-musl/cargo-deny cargo-deny
echo `pwd` >> $GITHUB_PATH echo `pwd` >> $GITHUB_PATH
- run: cargo deny check - run: cargo deny check bans licenses
doc: doc:
name: Doc build name: Doc build
@@ -458,21 +458,6 @@ jobs:
files: "dist/*" files: "dist/*"
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
cargo-audit:
env:
CARGO_AUDIT_VERSION: 0.11.2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ${{ runner.tool_cache }}/cargo-audit
key: cargo-audit-bin-${{ env.CARGO_AUDIT_VERSION }}
- run: echo "${{ runner.tool_cache }}/cargo-audit/bin" >> $GITHUB_PATH
- run: |
cargo install --root ${{ runner.tool_cache }}/cargo-audit --version ${{ env.CARGO_AUDIT_VERSION }} cargo-audit
cargo audit
verify-publish: verify-publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@@ -8,13 +8,6 @@ targets = [
{ triple = "aarch64-linux-android" }, { triple = "aarch64-linux-android" },
] ]
# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html
[advisories]
vulnerability = "deny"
unmaintained = "deny"
yanked = "deny"
ignore = []
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html # https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
[licenses] [licenses]
allow = [ allow = [

View File

@@ -10,6 +10,8 @@ made (there's also not really a body governing these decisions, it's more
whimsical currently, or on request from others) then the following steps need to whimsical currently, or on request from others) then the following steps need to
be executed to make the release: be executed to make the release:
1. Double-check that there are no open [rustsec advisory
issues][rustsec-issues] on the Wasmtime repository.
1. `git pull` - make sure you've got the latest changes 1. `git pull` - make sure you've got the latest changes
1. Run `rustc scripts/publish.rs` 1. Run `rustc scripts/publish.rs`
1. Run `./publish bump` 1. Run `./publish bump`
@@ -31,3 +33,5 @@ be executed to make the release:
a bit between runs of the script. a bit between runs of the script.
And that's it, then you've done a Wasmtime release. And that's it, then you've done a Wasmtime release.
[rustsec-issues]: https://github.com/bytecodealliance/wasmtime/issues?q=RUSTSEC+is%3Aissue+is%3Aopen+