AGENT SKILL

run2_csv_generation

Robust JSON-to-CSV parser for Trivy vulnerability reports.

License 许可
MIT
最近更新
2026-10-02
Stars
★ 93
Forks
8

01 前言 Front Matter

name
run2_csv_generation
description
Robust JSON-to-CSV parser for Trivy vulnerability reports.

03 SKILL.md 正文

Improved CSV Generation

A Python utility to extract vulnerability data from Trivy's JSON structure.

Processing Logic

  1. Load the JSON report.
  2. Iterate Results -> Vulnerabilities.
  3. Extract PkgName, InstalledVersion, VulnerabilityID, Severity, CVSS (checking nvd, ghsa, redhat sources), FixedVersion (if any), Title, PrimaryURL.
  4. Use csv.DictWriter for clean field escaping.

Best Practice

  • Always provide a fallback string (e.g., "N/A") for missing fields to avoid runtime KeyError.
  • Ensure the CSV is opened with newline="" to prevent extra lines in some OS environments.

04 同仓库更多 Skills