Skip to content

ci(security): add SARIF reporting, gitleaks secret scanning, and Semgrep SAST pipeline (closes #1334) - #1433

Open
guptakumarranjeet150 wants to merge 1 commit into
LabsCrypt:mainfrom
guptakumarranjeet150:feat/issue-1334-security-scanning-pipeline
Open

guptakumarranjeet150 wants to merge 1 commit into
LabsCrypt:mainfrom
guptakumarranjeet150:feat/issue-1334-security-scanning-pipeline

Conversation

@guptakumarranjeet150

Copy link
Copy Markdown

Summary

Closes #1334 — Implements a comprehensive automated security scanning pipeline with SARIF reporting, secret leak detection, and static code analysis.

Changes to .github/workflows/security.yml

1. Dependency Vulnerability Scan (existing — cleaned)

  • Root-level + frontend + backend npm audit --audit-level=high
  • Removed duplicate cargo-audit steps that caused redundant CI runs

2. Rust Cargo Audit with SARIF Upload (upgraded)

  • cargo install cargo-audit --version 0.22.0 --locked (pinned, cached)
  • Emits cargo-audit.sarif and uploads to GitHub Security tab via github/codeql-action/upload-sarif@v3 with category: cargo-audit

3. Secret Scanning — gitleaks (new)

  • gitleaks/gitleaks-action@v2 scans full git history (fetch-depth: 0)
  • Docker fallback generates SARIF; uploaded to Security tab with category: gitleaks
  • continue-on-error: true so CI does not hard-fail on missing GITLEAKS_LICENSE in forks

4. Semgrep SAST (new)

  • Rulesets: p/javascript, p/typescript, p/react, p/nodejs, p/security-audit, p/owasp-top-ten, p/secrets
  • SARIF output uploaded to Security tab with category: semgrep-sast

5. CodeQL Multi-Language Analysis (restructured)

  • Matrix: javascript, typescript (Rust removed to keep CodeQL DB valid)
  • Queries: security-extended,security-and-quality
  • Per-language category tag in SARIF upload for clean Security tab grouping

Acceptance Criteria

  • Security workflow runs on all PRs and weekly schedule (0 2 * * 0)
  • Blocks PRs with known high/critical CVEs (npm audit + cargo audit)
  • Generates SARIF reports in GitHub Security tab (cargo-audit, gitleaks, semgrep, codeql)

Closes #1334

…rep SAST pipeline (closes LabsCrypt#1334)

- Add gitleaks secret-scanning job with SARIF upload to GitHub Security tab
- Add Semgrep SAST job (p/javascript, p/typescript, p/react, p/nodejs,
  p/owasp-top-ten, p/secrets rulesets) with SARIF upload
- Add CodeQL analysis for javascript/typescript with security-extended queries
- Upgrade cargo-audit job to emit SARIF and upload to Security tab
- Remove duplicate cargo-audit steps that caused redundant CI runs
- All SARIF uploads use github/codeql-action/upload-sarif@v3 with
  unique 'category' keys to populate the GitHub Security tab dashboard
- Weekly cron schedule preserved (0 2 * * 0) for CVE re-scan

Closes LabsCrypt#1334
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/Security] Automated Static Security Analysis & Vulnerability Scanning Pipeline

1 participant