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 reconFTW results directory (format reconftw) is one input that is a directory of the task: its files are joined by importer.ParseBundle into one report (hosts, services, endpoints, nuclei results). It is partial coverage by nature, people and credential files (osint/) are never opened, and a link, a special file or a name outside the directory refuses the whole bundle. Files the importer did not read are logged (skipped on purpose, unmapped).
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 BundleLimits = importer.DefaultBundleLimits()
BundleLimits bound a results directory (the ctis defaults).
var Manifest = tool.Manifest{ Name: Name, Version: "1.2.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, nmap XML, testssl.sh JSON, CTIS reports) and a reconFTW results directory.", 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_name", "asset:repository", "asset:container", "asset:container_image", "asset:package", "asset:unclassified", "asset:web_origin", "asset:service", "asset:certificate", "asset:storage", "asset:web_application", "endpoint", "finding:vulnerability", "finding:weakness", "finding:misconfiguration", "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 `` /* 314-byte string literal not displayed */
// MinSeverity drops findings below it.
MinSeverity string `` /* 128-byte string literal not displayed */
}
Config is the tool's configuration.