Skip to content

ci(security): add cargo audit --deny warnings and pnpm audit with SARIF upload - #608

Open
DevJoshhie wants to merge 1 commit into
DevNiola:mainfrom
DevJoshhie:feat/408-security-audit-sarif
Open

DevJoshhie wants to merge 1 commit into
DevNiola:mainfrom
DevJoshhie:feat/408-security-audit-sarif

Conversation

@DevJoshhie

Copy link
Copy Markdown

Summary

The security workflow had cargo audit and pnpm audit jobs but ran without --deny warnings and produced no SARIF output, so advisories in existing lockfiles were not surfaced in GitHub's code-scanning tab. This PR hardens both audit jobs and uploads results as SARIF.

What was implemented

Rust audit (cargo-audit job)

  • Added security-events: write permission to allow SARIF upload
  • Installs cargo-audit with the sarif feature
  • Runs cargo audit --deny warnings as the fail gate — the job fails on any advisory including warnings
  • Generates a SARIF 2.1.0 report from cargo audit --json via a Python script
  • Uploads the SARIF file to GitHub code scanning under the cargo-audit category

JavaScript audit (javascript-audit job)

  • Converted to a matrix across three workspaces: apps/web, apps/server, extensions/vscode
  • Each leg runs pnpm audit --audit-level=high scoped to that workspace
  • Generates a SARIF 2.1.0 report per workspace from pnpm audit --json output
  • Uploads each SARIF file to code scanning under a workspace-specific category

Files changed

  • .github/workflows/security.yml

Closes #408

…IF upload (DevNiola#408)

- Run cargo audit --deny warnings as the fail gate for Rust dependencies
- Generate SARIF report from cargo audit JSON output and upload to code scanning
- Split pnpm audit into a matrix across apps/web, apps/server, extensions/vscode
- Generate SARIF from pnpm audit JSON output per workspace and upload to code scanning
- Requires security-events: write permission on audit jobs

Closes DevNiola#408
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DevOps] Add cargo-audit and pnpm audit to the security workflow

1 participant