Security Audit #52
This file contains hidden or 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: | |
branches: | |
- main | |
paths: | |
- '**/Cargo.toml' | |
- '**/Cargo.lock' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '**/Cargo.toml' | |
- '**/Cargo.lock' | |
schedule: | |
- cron: "0 3 * * *" | |
workflow_dispatch: | |
jobs: | |
rustsec_audit_check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout the source code | |
uses: actions/checkout@v5 | |
- name: generate the lockfile | |
# https://github.com/rustsec/audit-check/issues/27 | |
run: if [ ! -e "./Cargo.lock" ]; then cargo generate-lockfile; fi | |
- name: cache and/or reuse compiled Rust dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: run audit-check | |
uses: rustsec/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
trivy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout the source code | |
uses: actions/checkout@v5 | |
- name: generate the lockfile | |
run: if [ ! -e "./Cargo.lock" ]; then cargo generate-lockfile; fi | |
- name: run trivy | |
uses: aquasecurity/[email protected] | |
with: | |
scan-type: 'repo' | |
scanners: 'vuln,misconfig,secret,license' | |
severity: 'HIGH,CRITICAL' | |
ignore-unfixed: true | |
exit-code: 1 |