Documentation
¶
Overview ¶
Package importtool is the file importer as a parser-class tool of the tool contract (pkg/tool): it converts files other security tools export (Nessus v2 XML, Qualys detection XML with its KnowledgeBase, DefectDojo Generic Findings JSON, CycloneDX, SPDX, osv-scanner results, CSAF and OpenVEX) into CTIS with the ctis importer package, so the conversion runs in the tool sandbox of a sensor instead of on the platform.
Stability: Beta (docs/STABILITY.md).
The tool reads only the task's inputs, which the runtime places in the task's private directory; it has no network and no other filesystem access (manifest: class parser, network none, workdir only). Each input is hostile: it must be a regular file inside the task directory (no absolute path, no "..", no link), within the size limit, and it is parsed with the importer's limits (no XML entities or external resources, depth, size and record caps).
A VEX document (CSAF, OpenVEX, a CycloneDX VEX) holds statements about products, not records of the task; they are written to the artifact vex-statements.json for the platform to apply, never emitted as findings.
Index ¶
Constants ¶
const MaxInputBytes = 256 << 20
MaxInputBytes is the largest input file the tool reads.
const Name = "file-import"
Name is the tool's name.
const VEXArtifact = "vex-statements.json"
VEXArtifact is the artifact the statements of VEX documents are written to.
Variables ¶
var Manifest = tool.Manifest{ Name: Name, Version: "1.0.0", Description: "Converts exported scanner, SBOM, VEX and findings files to CTIS (Nessus, Qualys with KnowledgeBase, DefectDojo Generic JSON, CycloneDX, SPDX, osv-scanner, CSAF, OpenVEX).", Class: tool.Parser, Tier: tool.T0, Consumes: []string{"file:application/xml", "file:application/json", "file:application/zip"}, Produces: []string{ "asset:host", "asset:ip_address", "asset:domain", "asset:repository", "asset:container", "asset:unclassified", "finding:vulnerability", "finding:compliance", "dependency", }, Permissions: tool.Permissions{Network: tool.NetNone, Filesystem: tool.FSWorkdir}, Resources: tool.Resources{ Timeout: tool.Duration(30 * time.Minute), MaxOutputBytes: 256 << 20, MaxRecords: 1_000_000, }, }
Manifest describes the tool.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Format of every input; auto detects it per input from its first
// bytes.
Format string `` /* 160-byte string literal not displayed */
// MinSeverity drops findings below it.
MinSeverity string `` /* 128-byte string literal not displayed */
}
Config is the tool's configuration.