Security Audits #915
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 Audits | |
on: | |
schedule: | |
- cron: '0 0 * * *' # every day at midnight | |
workflow_dispatch: # allow manual execution | |
jobs: | |
image-audit: | |
name: Audit container image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@master | |
with: | |
image-ref: 'docker.io/rouhim/this-week-in-past:latest' | |
format: 'sarif' | |
output: 'trivy-results.sarif' | |
exit-code: '0' | |
ignore-unfixed: true | |
severity: 'CRITICAL,HIGH' | |
- name: Upload Trivy scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: 'trivy-results.sarif' | |
filesystem-audit: | |
name: Audit repo filesystem | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@master | |
with: | |
scan-type: 'fs' | |
format: 'sarif' | |
output: 'trivy-results.sarif' | |
exit-code: '0' | |
ignore-unfixed: true | |
severity: 'CRITICAL,HIGH' | |
- name: Upload Trivy scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: 'trivy-results.sarif' | |
config-audit: | |
name: Audit config files | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@master | |
with: | |
scan-type: 'config' | |
hide-progress: false | |
format: 'sarif' | |
output: 'trivy-results.sarif' | |
exit-code: '0' | |
ignore-unfixed: true | |
severity: 'CRITICAL,HIGH' | |
- name: Upload Trivy scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: 'trivy-results.sarif' | |
check-unused-dependencies: | |
name: Check for unused deps | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
- uses: Swatinem/rust-cache@v2 # use rust / cargo caching | |
with: | |
cache-on-failure: "true" | |
- name: Install cargo-udeps | |
run: cargo update -p proc-macro2 && cargo install cargo-udeps --locked | |
- name: Analyze dependencies | |
run: cargo +nightly udeps |