import type { SecurityEvents } from "../incident/SecurityEvents.js"; import { type PostureCheckId, type PostureConfig, type PostureFacts, type PostureFinding } from "./PostureChecks.js"; export type PostureMode = "ENFORCED" | "DEVELOPMENT"; export interface PostureReport { readonly mode: PostureMode; readonly findings: readonly PostureFinding[]; /** Failed and not waived: what refuses the start. */ readonly failed: readonly PostureFinding[]; /** Failed and waived under development posture. */ readonly waived: readonly PostureFinding[]; } /** A refusal to start: the check, never a value. */ export declare class PostureError extends Error { readonly check: PostureCheckId; readonly subject?: string | undefined; constructor(check: PostureCheckId, subject?: string | undefined); } /** What the service consults per request: whether a drift is standing. */ export interface PostureState { readonly degraded: boolean; } export interface HostPostureOptions { readonly mode: PostureMode; readonly intervalSeconds: number; readonly config: PostureConfig; readonly facts?: PostureFacts; } /** * What this process can verify about the host it runs on, and the refusal * to run when it does not hold. It cannot create isolation: the container * runtime, Pod Security Admission, and the network policy do that. It can * see that it is not root, that its root filesystem and working directory * are not writable, that no service-account token was mounted, that no * proxy, extra trust anchor, key log, inspector, or option injection sits in * its environment, that every secret file is where and how it should be, * and that Node's permission model denies writes, child processes, and * workers. Under development posture the host-specific checks are waived * and said so; the ones that would make the process a different process are * never waived. A regression while running is drift. */ export declare class HostPosture implements PostureState { private readonly options; private readonly events; private readonly facts; private timer; private drifted; private last; constructor(options: HostPostureOptions, events: SecurityEvents); get degraded(): boolean; get report(): PostureReport | null; /** Every check once; the first non-waived failure refuses the start. */ assertAtStartup(): PostureReport; /** Repeats the drift subset on the interval; a regression degrades, a recovery restores. */ start(): () => void; stop(): void; /** One drift evaluation, for the interval and for tests. */ tick(): PostureReport; private evaluate; } //# sourceMappingURL=HostPosture.d.ts.map