Class TrivyParser

All Implemented Interfaces:
Serializable

public class TrivyParser extends JsonIssueParser

Parser for reports of aquasec trivy container vulnerability scanner.

Usage: trivy image -f json -o results.json golang:1.12-alpine

Author:
Thomas Fürer - tfuerer.javanet@gmail.com
See Also:
  • Constructor Details

    • TrivyParser

      public TrivyParser()
  • Method Details

    • parseJsonObject

      protected void parseJsonObject(Report report, org.json.JSONObject jsonReport, IssueBuilder issueBuilder)
      Used with schema version 2 starting with trivy 0.20.0.
      Overrides:
      parseJsonObject in class JsonIssueParser
      Parameters:
      report - the report to fill
      jsonReport - the input JSON report given as JSON object
      issueBuilder - build to be used to create issues
    • parseJsonArray

      protected void parseJsonArray(Report report, org.json.JSONArray jsonReport, IssueBuilder issueBuilder)
      Used with older schema before trivy 0.20.0.
      Overrides:
      parseJsonArray in class JsonIssueParser
      Parameters:
      report - the report to fill
      jsonReport - the input JSON report given as JSON array
      issueBuilder - build to be used to create issues