Security audit #964
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Security audit | |
on: | |
push: | |
paths: | |
- "**/Cargo.toml" | |
- "**/Cargo.lock" | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
permissions: | |
contents: read | |
jobs: | |
audit: | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
checks: write | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 | |
with: | |
egress-policy: block | |
allowed-endpoints: > | |
api.github.com:443 | |
artifactcache.actions.githubusercontent.com:443 | |
frsnacprodeus2file1.blob.core.windows.net:443 | |
github.com:443 | |
gitlab.com:443 | |
static.rust-lang.org:443 | |
index.crates.io:443 | |
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | |
- uses: Swatinem/rust-cache@81d053bdb0871dcd3f10763c8cc60d0adc41762b | |
- uses: actions-rs/audit-check@35b7b53b1e25b55642157ac01b4adceb5b9ebef3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
cargo-deny: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
checks: | |
- advisories | |
- bans licenses sources | |
# Prevent sudden announcement of a new advisory from failing ci: | |
continue-on-error: ${{ matrix.checks == 'advisories' }} | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 | |
with: | |
egress-policy: block | |
allowed-endpoints: > | |
crates.io:443 | |
index.crates.io:443 | |
api.github.com:443 | |
github.com:443 | |
gitlab.com:443 | |
static.crates.io:443 | |
static.rust-lang.org:443 | |
index.crates.io:443 | |
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | |
- uses: EmbarkStudios/cargo-deny-action@a50c7d5f86370e02fae8472c398f15a36e517bb8 | |
with: | |
command: check ${{ matrix.checks }} |