sarif-parsing
O que ela faz
Esta skill ajuda o agente a abrir e limpar os arquivos de resultado que os scanners de segurança produzem. É para desenvolvedores e equipes de segurança que precisam entender relatórios de varredura grandes.
Quando usar
- ✓Quando você tem um arquivo SARIF de um scanner e quer saber o que ele diz.
- ✓Quando você roda vários scanners e quer os alertas combinados sem duplicatas.
- ✓Quando você quer filtrar a saída de uma varredura e alimentá-la em um build ou painel.
Link da skill
https://github.com/trailofbits/skills/blob/main/plugins/static-analysis/skills/sarif-parsing/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Tenho um arquivo SARIF do nosso scanner. Você consegue remover os alertas duplicados e listar só os de alto risco?”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
O agente lê a estrutura do arquivo de resultados, agrupa os achados por regra e localização e remove as entradas repetidas. Também pode converter a saída para outro formato. Não roda varreduras por conta própria.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do GitHub.
SARIF Parsing Best Practices
You are a SARIF parsing expert. Your role is to help users effectively read, analyze, and process SARIF files from static analysis tools.
When to Use
Use this skill when:
- Reading or interpreting static analysis scan results in SARIF format
- Aggregating findings from multiple security tools
- Deduplicating or filtering security alerts
- Extracting specific vulnerabilities from SARIF files
- Integrating SARIF data into CI/CD pipelines
- Converting SARIF output to other formats
When NOT to Use
Do NOT use this skill for:
- Running static analysis scans (use CodeQL or Semgrep skills instead)
- Writing CodeQL or Semgrep rules (use their respective skills)
- Analyzing source code directly (SARIF is for processing existing scan results)
- Triaging findings without SARIF input (use variant-analysis or audit skills)
SARIF Structure Overview
SARIF 2.1.0 is the current OASIS standard. Every SARIF file has this hierarchical structure:
sarifLog
├── version: "2.1.0"
├── $schema: (optional, enables IDE validation)
└── runs[] (array of analysis runs)
├── tool
│ ├── driver
│ │ ├── name (required)
│ │ ├── version
│ │ └── rules[] (rule definitions)
│ └── extensions[] (plugins)
├── results[] (findings)
│ ├── ruleId
│ ├── ruleIndex (index into tool.driver.rules[])
│ ├── level (OPTIONAL, inherited from the rule when absent)
│ ├── message.text
│ ├── locations[]
│ │ └── physicalLocation
│ │ ├── artifactLocation.uri
│ │ └── region (startLine, startColumn, etc.)
│ ├── fingerprints{}
│ └── partialFingerprints{}
└── artifacts[] (scanned files metadata)
Severity Is Not Always on the Result
result.level is optional. CodeQL omits it on every result and records severity on the
rule as defaultConfiguration.level, which the result inherits. Read result.level
directly and a CodeQL run scores as clean however many errors it found, which is how a
severity gate ends up exiting 0 on a failing repo.
Resolve severity in this order (SARIF 2.1.0 section 3.27.10):
kindother than"fail"(a pass/notApplicable record), so"none"result.level, when present- the matched rule's
defaultConfiguration.level, joiningruleIndexintoruns[].tool.driver.rules[], or matchingruleIdagainstrules[].idwhen the tool omitsruleIndex "warning", the SARIF default
Every severity query in this skill starts from that resolution. In jq it is the
LEVEL_FN definition in {baseDir}/resources/jq-queries.md;
in Python it is resolve_level(result, run) in
{baseDir}/resources/sarif_helpers.py.
Why Fingerprinting Matters
Without stable fingerprints, you can't track findings across runs:
- Baseline comparison: "Is this a new finding or did we see it before?"
- Regression detection: "Did this PR introduce new vulnerabilities?"
- Suppression: "Ignore this known false positive in future runs"
Tools report different paths (/path/to/project/ vs /github/workspace/), so path-based matching fails. Fingerprints hash the content (code snippet, rule ID, relative location) to create stable identifiers regardless of environment.
Tool Selection Guide
| Use Case | Tool | Install / run |
|---|---|---|
| Quick CLI queries | jq | brew install jq / apt install jq |
| Python scripting (simple) | pysarif | uv run --with pysarif python script.py |
| Python scripting (advanced) | sarif-tools | uv run --with sarif-tools python script.py |
| .NET applications | SARIF SDK | NuGet package |
| JavaScript/Node.js | sarif-js | npm package |
| Go applications | garif | go get github.com/chavacava/garif |
| Validation | SARIF Validator | sarifweb.azurewebsites.net |
Strategy 1: Quick Analysis with jq
For rapid exploration and one-off queries:
# Pretty print the file
jq '.' results.sarif
# Count total findings
jq '[.runs[].results[]] | length' results.sarif
# List all rule IDs triggered
jq '[.runs[].results[].ruleId] | unique' results.sarif
# Severity resolution, needed by every query below that filters on level.
# See resources/jq-queries.md for the annotated version.
LEVEL_FN='
def rule($run):
. as $r
| ($run.tool.driver.rules // []) as $rules
| (if ($r.ruleIndex | type) == "number" and $r.ruleIndex >= 0
then $rules
Perguntas frequentes
Ela roda uma varredura de segurança?
Não. Só processa resultados que já existem, então você precisa de uma varredura antes.
Ela pode juntar resultados de ferramentas diferentes?
Sim. Pode agregar achados de várias ferramentas de segurança em uma única lista.
Pode ser usada em pipelines automatizados?
Sim. A skill cobre como adicionar o processamento de SARIF em sistemas de CI e CD.
Detalhes
Descrição original do autor
Parses and processes SARIF files from static analysis tools like CodeQL, Semgrep, or other scanners. Triggers on "parse sarif", "read scan results", "aggregate findings", "deduplicate alerts", or "process sarif output". Handles filtering, deduplication, format conversion, and CI/CD integration of SARIF data. Does NOT run scans — use the Semgrep or CodeQL skills for that.
repo: trailofbits/skills
Popularidade
- Estrelas no GitHub
- 8,0 mil
- Posição no ranking
- #12708
- Licença
- CC-BY-SA-4.0
- Atualizada em
- 02/11/2026
Comentários
- …
Mais skills deste repositório
audit-context-building
8,0 milAjuda seu agente a conhecer uma base de código desconhecida antes de uma revisão de segurança, mapeando o que cada função assume, garante e depende.
algorand-vulnerability-scanner
8,0 milAjuda seu agente a analisar contratos inteligentes da Algorand, escritos em TEAL ou PyTeal, em busca de 11 problemas comuns de segurança, como ataques de rekeying e taxas não verificadas.
audit-prep-assistant
8,0 milAjuda seu agente a preparar uma base de código para uma revisão de segurança externa, com análise estática, cobertura de testes, limpeza de código morto e documentação clara.
cairo-vulnerability-scanner
8,0 milAjuda seu agente a analisar contratos inteligentes em Cairo na StarkNet em busca de 6 problemas graves, incluindo estouro aritmético, mensagens arriscadas entre camadas e replay de assinatura.
Skills parecidas
reverse-engineer-anything
422 milAjuda seu agente a analisar apps e pacotes já publicados para explicar recursos, comparar versões ou orientar uma reconstrução, usando a ferramenta REA.
1password
394 milAjuda seu agente a configurar a CLI do 1Password, fazer login e ler ou injetar segredos sem imprimir seus valores no chat.
healthcheck
394 milAjuda seu agente a auditar o computador ou servidor que roda o OpenClaw em busca de riscos como SSH, firewall, atualizações e backups, com correções seguras.