Sourcetypeno test imports ittype Source = { readonly path: string; readonly text: string };A file's path and text.
The ban on hand-built ssh arguments (commons headless 0005-reach-and-targets FR-010): a program that reaches a machine over ssh does it through the executor, so that the options, the quoting and the host-key policy are in one place. This finds, in the text of a program's sources, an ssh argument vector that sets the options only the executor sets (BatchMode, ConnectTimeout, ServerAliveInterval, StrictHostKeyChecking, UserKnownHostsFile, ControlMaster, -T) or an option of the host-key policy turned off, and gives a finding for each, to be held by a consumer's own check.
import { sshArgumentFindings } from "./ban.ts";
sshArgumentFindings([{ path: "a.ts", text: 'run(["ssh", "-o", "BatchMode=yes", host, cmd]);' }]).length; // 1Sourcetypeno test imports ittype Source = { readonly path: string; readonly text: string };A file's path and text.
SshFindingtypeno test imports ittype SshFinding = { readonly file: string; readonly line: number; readonly rule: "ssh/hand-built"; readonly message: string };A hand-built ssh argument.
sshArgumentFindingsfunctionfunction sshArgumentFindings(files: readonly Source[]): readonly SshFinding[]Every hand-built ssh argument in the sources given, by file and line. A source of the executor itself is not given to it.