/** * Weavetab — cdp/security.ts * Security verification functions for browser isolation and process identity. * - Profile verification: ensures the browser uses an isolated profile * - Browser fingerprinting: verifies launched process identity * - Process killing safety: whitelisting and verification * Weavetab by fy2ne */ import CDP from "chrome-remote-interface"; import type { Config } from "../config/loader.js"; /** * Verifies that the browser is actually using the isolated profile directory. * Uses CDP to check the actual user data directory being used by the browser. * Results are cached per session to avoid per-call overhead. */ export declare function verifyProfileIsolation(session: CDP.Client, config: Config, targetId: string): Promise<{ verified: boolean; actualProfile?: string; expectedProfile: string; }>; /** * Clears the profile verification cache for a specific session. * Called when a session is closed or reconnected. */ export declare function clearProfileVerificationCache(targetId: string): void; interface BrowserFingerprint { pid: number; port: number; profileDir: string; browserPath: string; launchTimestamp: number; userAgent: string; cdpVersion: string; } /** * Creates a unique fingerprint for the launched browser process. * This is stored in the lock file and verified on reconnection. */ export declare function createBrowserFingerprint(pid: number, port: number, profileDir: string, browserPath: string): BrowserFingerprint; /** * Verifies that the connected browser matches the expected fingerprint. * Runs at CDP connect time only. */ export declare function verifyBrowserFingerprint(session: CDP.Client, expectedFingerprint: BrowserFingerprint): Promise<{ valid: boolean; reason?: string; }>; export declare function getCurrentFingerprint(): BrowserFingerprint | null; export declare function safelyKillWeavetabProcesses(profileDir: string, expectedPid?: number): void; export {};