governance.TargetKindtypeno test imports ittype TargetKind = "endpoint" | "host" | "path" | "image";What a scanner scans.
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", ...] }governance.TargetKindtypeno test imports ittype TargetKind = "endpoint" | "host" | "path" | "image";What a scanner scans.
governance.Targettypeno test imports ittype Target = { readonly kind: TargetKind; readonly value: string };A target: what it is and its text.
governance.Scannertypeno test imports ittype 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 itconst SCANNERS: readonly Scanner[]The scanners that can be run.
governance.NOT_RUNconstno test imports itconst NOT_RUN: Readonly<Record<string, string>>What cannot be run, and why.
governance.scannerByIdfunctionno test imports itfunction scannerById(id: string): Scanner | undefinedA scanner by identity.
governance.targetProblemfunctionno test imports itfunction targetProblem(t: Target): string | undefinedWhether a target is fit to be given to a tool: why not, or nothing.
governance.ArgvOptionstypeno test imports ittype ArgvOptions = { readonly outDir: string; readonly rate?: number; readonly ports?: string };What the command line may depend on besides the target.
governance.argvOffunctionno test imports itfunction 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 ittype TargetKind = "endpoint" | "host" | "path" | "image";What a scanner scans.
Targettypeno test imports ittype Target = { readonly kind: TargetKind; readonly value: string };A target: what it is and its text.
Scannertypeno test imports ittype 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.
SCANNERSconstconst SCANNERS: readonly Scanner[]The scanners that can be run.
NOT_RUNconstconst NOT_RUN: Readonly<Record<string, string>>What cannot be run, and why.
scannerByIdfunctionfunction scannerById(id: string): Scanner | undefinedA scanner by identity.
targetProblemfunctionfunction targetProblem(t: Target): string | undefinedWhether a target is fit to be given to a tool: why not, or nothing.
ArgvOptionstypeno test imports ittype ArgvOptions = { readonly outDir: string; readonly rate?: number; readonly ports?: string };What the command line may depend on besides the target.
argvOffunctionfunction 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.