importtool

package
v0.33.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

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

View Source
const MaxInputBytes = 256 << 20

MaxInputBytes is the largest input file the tool reads.

View Source
const Name = "file-import"

Name is the tool's name.

View Source
const VEXArtifact = "vex-statements.json"

VEXArtifact is the artifact the statements of VEX documents are written to.

Variables

View Source
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

func New

func New() tool.Tool

New returns the tool.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL