Export findings as SARIF for GitHub code scanning

Aperta
#72 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
json, rust
Ambito
cli, security

Direzione di ricerca

Start from the existing finding, evidence and report modules, which hold the data the export must map to SARIF results. Add the lh sec export --format sarif subcommand alongside the current lh sec commands. Done means the three acceptance criteria pass: schema-valid output, stable partialFingerprints across two exports, and redaction of secrets and home paths. Upload design (gh api, confirmation, target repo and branch) is still open, so confirm scope with the maintainer before building it.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: ecosystem area: security enhancement priority: P2

Problem

Findings live in the session and in a prose report. There is no machine-readable export, so a finding cannot flow into GitHub code scanning, a CI gate, or another triage tool. Security work that stays in a terminal transcript does not survive the engagement.

SARIF 2.1.0 is the common format for static-analysis results; GitHub code scanning consumes it directly. Semgrep and CodeQL already speak it, and a harness that produces findings should too.

Inspiration

  • SARIF 2.1.0 specification.
  • GitHub code scanning SARIF support.
  • Semgrep and CodeQL result formats.
  • The existing finding, evidence and report modules.

Proposal

Add lh sec export --format sarif [path]:

  • One run with the LocalHarness driver, rules derived from finding classes, and results for each finding.
  • Each result: ruleId, level (error/warning/note), message, physical location (file, line, column), logical locations, partialFingerprints, and a property bag with evidence ids and confidence.
  • Include the finding's CWE/CVSS when known; never invent them.
  • Redact secrets and absolute home paths; evidence artifacts are referenced by id, not embedded.
  • Validate against the SARIF schema before writing.
  • Optional --upload uses gh api to upload to code scanning, with an explicit confirmation and the repository/branch named.

Acceptance criteria

  • A three-finding engagement produces schema-valid SARIF 2.1.0.
  • Each result maps to a rule and a file/line location.
  • Fingerprints are stable across two exports of the same finding.
  • Secrets and home paths are redacted.
  • Invalid SARIF is refused before writing.
  • Upload is off by default and names the target repository and branch.
Lingua principale
Rust
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GotinhaAzul/LocalHarness

Tutte le issue di GotinhaAzul/LocalHarness

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.