IF Commons GitHub

governance/catalog

Written to: 3 requirements: 3 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-scanners-catalog FR-001, 0002-scanners-catalog FR-002, 0002-scanners-catalog FR-003

The scanners that can be run, as data, and the command line each is given. A scanner has an identity, the tool it runs (none for the built-in check), the technique an engagement must allow for it (passive for the ones that read files and send nothing to a target, probe for a normal client's requests, scan for the ones that send many), what it scans (an endpoint's address, a host, a path, an image), and how its output is read. A command line is made only from the scanner's own flags and a target that has passed its check: an address, a host name, a path or an image reference, never anything that begins with a dash or holds a space, a quote, a semicolon or a newline. The tool is called with an argument vector and never through a shell.

import { argvOf } from "./catalog.ts";
argvOf("nmap", { kind: "host", value: "athens.example.test" }, { outDir: "/tmp/x" }); // { kind: "ok", value: ["-sV", ...] }

Source: commons/scanners/src/governance/catalog.ts

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

governance.TargetKindtypeno test imports it
type TargetKind = "endpoint" | "host" | "path" | "image";

What a scanner scans.

governance.Targettypeno test imports it
type Target = { readonly kind: TargetKind; readonly value: string };

A target: what it is and its text.

governance.Scannertypeno test imports it
type Scanner = { readonly id: string; /** The tool it runs, or nothing for the check that is built in. */ readonly… (590 characters)
type Scanner = {
  readonly id: string;
  /** The tool it runs, or nothing for the check that is built in. */
  readonly tool: string | undefined;
  /** The technique an engagement must allow: `passive` sends nothing to a target. */
  readonly technique: "passive" | "probe" | "scan";
  readonly target: TargetKind;
  readonly summary: string;
  /** Where the output is read from: the standard output, or a file the tool writes in the folder it is given. */
  readonly output: { readonly from: "stdout" } | { readonly from: "file"; readonly name: string } | { readonly from: "builtin" };
};

A scanner.

governance.SCANNERSconstno test imports it
const SCANNERS: readonly Scanner[]

The scanners that can be run.

governance.NOT_RUNconstno test imports it
const NOT_RUN: Readonly<Record<string, string>>

What cannot be run, and why.

governance.scannerByIdfunctionno test imports it
function scannerById(id: string): Scanner | undefined

A scanner by identity.

governance.targetProblemfunctionno test imports it
function targetProblem(t: Target): string | undefined

Whether a target is fit to be given to a tool: why not, or nothing.

governance.ArgvOptionstypeno test imports it
type ArgvOptions = { readonly outDir: string; readonly rate?: number; readonly ports?: string };

What the command line may depend on besides the target.

governance.argvOffunctionno test imports it
function argvOf(id: string, target: Target, o: ArgvOptions): Result<readonly string[], string>

The arguments of a scanner for a target (the tool itself is not among them), or why they cannot be made.

TargetKindtypeno test imports it
type TargetKind = "endpoint" | "host" | "path" | "image";

What a scanner scans.

Targettypeno test imports it
type Target = { readonly kind: TargetKind; readonly value: string };

A target: what it is and its text.

Scannertypeno test imports it
type Scanner = { readonly id: string; /** The tool it runs, or nothing for the check that is built in. */ readonly… (590 characters)
type Scanner = {
  readonly id: string;
  /** The tool it runs, or nothing for the check that is built in. */
  readonly tool: string | undefined;
  /** The technique an engagement must allow: `passive` sends nothing to a target. */
  readonly technique: "passive" | "probe" | "scan";
  readonly target: TargetKind;
  readonly summary: string;
  /** Where the output is read from: the standard output, or a file the tool writes in the folder it is given. */
  readonly output: { readonly from: "stdout" } | { readonly from: "file"; readonly name: string } | { readonly from: "builtin" };
};

A scanner.

SCANNERSconst
const SCANNERS: readonly Scanner[]

The scanners that can be run.

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

NOT_RUNconst
const NOT_RUN: Readonly<Record<string, string>>

What cannot be run, and why.

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

scannerByIdfunction
function scannerById(id: string): Scanner | undefined

A scanner by identity.

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

targetProblemfunction
function targetProblem(t: Target): string | undefined

Whether a target is fit to be given to a tool: why not, or nothing.

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

ArgvOptionstypeno test imports it
type ArgvOptions = { readonly outDir: string; readonly rate?: number; readonly ports?: string };

What the command line may depend on besides the target.

argvOffunction
function argvOf(id: string, target: Target, o: ArgvOptions): Result<readonly string[], string>

The arguments of a scanner for a target (the tool itself is not among them), or why they cannot be made.

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

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