import type { DockerRunner } from "../stack/docker.js"; import type { PortProbe } from "../stack/ports.js"; import type { Kube } from "./kubectl.js"; /** * The NetworkPolicy probe `nylorun local sandbox enable` runs before it trusts a cluster (D32), in * a throwaway namespace `nylorun-sbx-probe-`: * * - a `control` pod (no policy) must reach a `peer` pod and the allowed host port, which * proves the routes exist; * - the `restricted` pod, under the same policy shape as the Tenant's namespace (egress only * to `/32` on one port), must reach the allowed host port and nothing else: not the * peer pod, not another port on the host. * * The host ports are served by a temporary busybox container published on the bind address: two * free ports, or `--probe-ports` where a firewall in front of the host (a cloud VPC's) opens only * named ports to the pods. The namespace and the container are always removed. */ export interface ProbeDeps { kube: Kube; docker: DockerRunner; ports: PortProbe; err(line: string): void; /** Delay between polls; tests shorten it. */ pollMs?: number; /** How long the policy may take to apply. */ policyTimeoutMs?: number; } export interface ProbeResult { hostAddress: string; bindAddress: string; enforced: true; probedAt: string; /** Images the pre-pull could not pull (warnings, not failures). */ notPulled: string[]; } /** Docker Desktop and OrbStack forward the host address to this machine's loopback. */ export declare function defaultBind(context: string, hostAddress: string): string; export declare function assertIPv4(value: string, option: string): string; /** The probe's two host ports. */ export interface ProbePorts { /** The port the probe's policy allows. */ allowed: number; /** The port it denies. */ denied: number; } /** `--probe-ports ,`: two different TCP ports. */ export declare function parseProbePorts(value: string): ProbePorts; /** The last IPv4 address `nslookup` prints for the name (the first is the DNS server). */ export declare function parseNslookup(output: string): string | undefined; export declare function runProbe(deps: ProbeDeps, options: { hostAddress?: string; bindAddress?: string; probePorts?: ProbePorts; prePull?: readonly string[]; }): Promise;