Skip to content

API Reference parrot_tools.security.parsers.trivy

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.security.parsers.trivy

View source

Catalog-level Trivy JSON parser.

Parses Trivy's schema-version-2 JSON output into the catalog's ParsedReport (SeverityBreakdown + EmbeddedFinding).

Alias ParsedReport

Re-exported from parrot_tools.security.parsers._types.ParsedReport.

Class TrivyParser

Catalog-level parser for Trivy filesystem/image JSON reports.

Accepts Trivy's schema-version-2 JSON (ArtifactName, Results list with Vulnerabilities entries).

Attributes:

Attribute Type Description
parser_version str Fixed at "1.0.0" for v1 of this catalog.

Method TrivyParser.parse

Parse Trivy JSON into a ParsedReport.

parse(content: bytes | Path) -> ParsedReport

Parameter Type Default Description
content bytes | Path Raw Trivy JSON bytes or path to the JSON file.

Returns: ParsedReport — Deterministic ParsedReport with severity summary and top 10 findings sorted by severity desc, then finding_id asc.

Method TrivyParser.extract_section

Extract a named section from the Trivy JSON report.

extract_section(content: bytes | Path, section: str) -> dict

Parameter Type Default Description
content bytes | Path Raw Trivy JSON bytes or path to the JSON file.
section str One of "summary", "critical", "high", "medium", "low", "executive", "full".

Returns: dict — Dictionary with section-specific content.

Raises:

  • ValueError — If section is not in the supported set.

Alias load_bytes

Re-exported from parrot_tools.security.parsers._types.load_bytes.

Alias sort_findings

Re-exported from parrot_tools.security.parsers._types.sort_findings.

Alias validate_section

Re-exported from parrot_tools.security.parsers._types.validate_section.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally