importtool

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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

BundleLimits bound a results directory (the ctis defaults).

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

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 `` /* 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.

Jump to

Keyboard shortcuts

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