IF Commons GitHub

logical/detect

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-findings-importers FR-005

Which importer reads a report: by what is in it. A JSON with runs and a version is SARIF, one with site is a ZAP report; an XML with <issues is a Burp report and one with <NessusClientData a Nessus export.

import { detectFormat } from "./detect.ts";
detectFormat("a.xml", "<issues/>"); // "burp"

Source: commons/findings/src/logical/detect.ts

2 of 6 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

logical.ReportFormattypeno test imports it
type ReportFormat = "sarif" | "zap" | "burp" | "nessus" | "nuclei" | "nmap";

The report formats.

logical.detectFormatfunctionno test imports it
function detectFormat(text: string): ReportFormat | undefined

The format of a report, or nothing where none is read.

logical.importReportfunctionno test imports it
function importReport(file: string, text: string, asset?: string): Imported & { readonly format: ReportFormat | undefined; }

The findings of a report by its format; asset is the system a SARIF report is of (the others say theirs).

ReportFormattypeno test imports it
type ReportFormat = "sarif" | "zap" | "burp" | "nessus" | "nuclei" | "nmap";

The report formats.

detectFormatfunction
function detectFormat(text: string): ReportFormat | undefined

The format of a report, or nothing where none is read.

Imported by 8 tests of the run (8 passed, 0 failed): the library's results

importReportfunction
function importReport(file: string, text: string, asset?: string): Imported & { readonly format: ReportFormat | undefined; }

The findings of a report by its format; asset is the system a SARIF report is of (the others say theirs).

Imported by 8 tests of the run (8 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.