Skip to content

[B2] ci: add CodeQL + gitleaks + Trivy + SBOM security pipeline #868

Description

@MichaelFisher1997

Part of #834 (Production-Readiness Audit) — Batch B2 (hardening, parallel-safe).
Replaces audit item #8 (P1). Parallel with: audit-b2 siblings — this issue owns a new workflow file.

Problem

No security / supply-chain scanning today. Missing:

  • SAST: CodeQL or Semgrep
  • Dependency vulnerabilities: Trivy / Grype / nix flake show audit
  • Secret scanning: gitleaks / trufflehog (PR + history)
  • SBOM: CycloneDX / SPDX generation
  • Provenance: SLSA / sigstore signing of build artifacts

The repo already grants id-token: write to build jobs, so signing/provenance is the natural next step.

Acceptance criteria

  • New .github/workflows/security.yml with:
    • CodeQL analysis (autobuild or build-mode; Zig support is limited — fall back to Semgrep if CodeQL lacks Zig).
    • gitleaks scan on every PR + full history on schedule.
    • Trivy filesystem + nix flake show dependency scan.
    • SBOM generated (CycloneDX) and uploaded as artifact + to GH Dependency graph API.
  • Workflow runs on pull_request:, push: dev, and scheduled (nightly).
  • Findings fail the PR (configurable severity threshold — start at CRITICAL/HIGH).
  • Optional phase 2: SLSA provenance + sigstore signing of release artifacts.

Files in scope

  • .github/workflows/security.yml (new)
  • .github/codeql.yml or codeql config (new, if CodeQL used)
  • .gitleaks.toml (new, if custom rules)

Out of scope

Branch / PR

  • Branch: ci/security-pipeline · Targets: dev

Metadata

Metadata

Labels

audit-b2Audit Batch 2: Lint + hardening config (independent quick wins)cihotfixproduction-readinessAudit findings: missing CI/lint/benchmark/regression guardrails for production-grade enginequestionFurther information is requested

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions