Files
codex-proxy-rs/.github/workflows/security-scan.yml
T
2026-07-03 23:37:27 +08:00

84 lines
1.9 KiB
YAML

name: Security Scan
on:
push:
branches:
- '**'
pull_request:
schedule:
- cron: '0 3 * * 1'
permissions:
contents: read
concurrency:
group: security-scan-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
backend-security:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Rust
uses: dtolnay/rust-toolchain@1.95
- name: Cache Rust
uses: Swatinem/rust-cache@v2.9.1
with:
workspaces: backend -> target
- name: Install cargo-audit
run: cargo install cargo-audit --locked
- name: Run cargo audit
working-directory: backend
run: cargo audit
frontend-security:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup pnpm
uses: pnpm/action-setup@v6
with:
version: 11.7.0
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Install frontend dependencies
run: pnpm --dir frontend install --frozen-lockfile
- name: Run pnpm audit
run: pnpm --dir frontend audit --prod --audit-level=high
docker-security:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Build runtime image
run: docker build -f deploy/Dockerfile --target runtime -t codex-proxy-rs:security-scan .
- name: Scan runtime image
uses: aquasecurity/trivy-action@v0.36.0
with:
image-ref: codex-proxy-rs:security-scan
severity: HIGH,CRITICAL
vuln-type: os,library
ignore-unfixed: true
exit-code: '1'