安全模型
理解 Airlock 保护什么、不保护什么,是正确部署的前提。本节描述威胁边界、固定路由、Secret 生命周期与策略边界。
01威胁边界
保护对象:不可信的 LLM、Agent、脚本与自动化调用方。它们只能看到本地入口与本地凭据,无法读取真实目标地址、上游账号、密码、私钥或 API Key,也无法把请求转发到任意目的地。
不保护对象:本机管理员/root、能够调试 Airlock 进程或已控制操作系统的攻击者、以及可读取进程内存的同一用户进程。Airlock 不是沙箱,也不是通用 VPN 或防火墙。
02固定路由与能力
每条路由在创建时绑定一个上游与最小权限策略:HTTP 限定方法/路径/查询,SSH 限定命令与交互能力,LLM 限定模型/输出/频率/并发。调用方持有可撤销的本地能力(capability token、二次 API Key 或本地 SSH 身份),能力与真实 Secret 完全分离。
固定目标原则Airlock 不是开放代理:调用方永远不能指定上游 URL、SSH 地址或模型之外的目标。
03Secret 生命周期
- 录入:在 Airlock 窗口内录入(桌面)或
0600 JSON 规格文件(Server Core);不进入命令行、日志或 WebView。 - 存储:默认本地
0600 文件;可选 Keychain / Credential Manager / Secret Service。路由摘要与活动记录不返回 Secret。 - 使用:策略校验通过后,在发起上游请求/会话时才注入;响应与错误经过脱敏。
- 轮换与删除:本地凭据可独立轮换;删除路由同时删除相关 Secret,文件删除采用安全覆写。
04策略边界
HTTP方法/路径/查询GET/HEAD 白名单、路径逃逸防护、同源重定向控制、Range 下载。
SSH命令与交互精确命令或受控完整 exec;Shell/SFTP/PTY 由独立开关控制,Agent/X11 与端口转发始终拒绝。
LLM模型与用量模型白名单、最大输出、RPM 与并发;统计只保留数字。
05控制面与审计
桌面控制通道使用当前用户专属 Unix 套接字(Windows 命名管道),不开放 TCP 管理端口;Server Core 的 CLI 通过 0600 token 文件认证,Web UI 仅 loopback 且只呈现脱敏状态。所有活动默认脱敏,命令审计需显式开启并受滚动上限约束。
06部署建议
- 使用专用最小权限上游账号;SSH"所有命令"与 SFTP 只对隔离账号开放。
- 保持入口 loopback;开放私有局域网前评估同网段威胁。
- Server Core 使用独立服务账号、分离的 control/web token,并通过 SSH 隧道管理 Web UI。
- 定期轮换本地凭据与上游密码,备份视为 Secret 处理。
完整审计记录见生产就绪安全审计。
Security model
Understanding what Airlock protects (and does not protect) is a prerequisite for correct deployment.
01Threat boundary
Protected: untrusted LLMs, agents, scripts, and automation. They see only local endpoints and local credentials, cannot read upstream targets or secrets, and cannot reach arbitrary destinations.
Not protected: local administrators/root, anyone who can debug Airlock or control the OS, and same-user processes that can read process memory. Airlock is not a sandbox, VPN, or firewall.
02Fixed routes and capabilities
Each route binds one upstream and a least-privilege policy: HTTP methods/paths/query keys, SSH commands and interaction, LLM models/output/rate/concurrency. Callers hold revocable local capabilities (capability token, secondary API key, or local SSH identity) that stay separate from real secrets.
Fixed-target principleAirlock is not an open proxy: callers can never choose upstream URLs, SSH addresses, or models outside the policy.
03Secret lifecycle
- Entry: entered inside the Airlock window (desktop) or
0600 JSON spec files (Server Core); never command arguments, logs, or the WebView. - Storage: local
0600 file by default; optional Keychain/Credential Manager/Secret Service. Summaries and activity never return secrets. - Use: injected only after policy approval, at the upstream request; responses and errors are sanitized.
- Rotation and deletion: local credentials rotate independently; deleting a route deletes its secrets with secure file erasure.
04Policy boundaries
HTTPMethods/paths/queriesGET/HEAD allowlists, path-traversal protection, same-origin redirects, Range downloads.
SSHCommands and interactionExact commands or controlled exec; Shell/SFTP/PTY are independent switches; Agent/X11 and port forwarding stay denied.
LLMModels and usageModel allowlist, output cap, RPM and concurrency; numbers-only statistics.
05Control plane and audit
The desktop control channel is a current-user Unix socket (named pipe on Windows) with no TCP management port; the server CLI authenticates with 0600 token files; the Web UI is loopback-only and sanitized. Activity is sanitized by default; command audit is explicit and bounded.
06Deployment recommendations
- Use dedicated least-privilege upstream accounts; reserve all-commands and SFTP for isolated accounts.
- Keep ingress loopback; assess same-subnet threats before exposing a private LAN.
- Server Core: dedicated service account, separate control/web tokens, SSH-tunneled Web UI.
- Rotate local and upstream credentials regularly; treat backups as secrets.
See the production-readiness security audit.
セキュリティモデル
Airlock が何を守り、何を守らないかを理解することが、正しい導入の前提です。
01脅威境界
守る対象:信頼できない LLM・Agent・スクリプト・自動化。呼び出し元はローカルエンドポイントとローカル認証情報だけを見られ、上流ターゲットや Secret を読めず、任意の宛先へ到達できません。
守れない対象:ローカル管理者・root・プロセスをデバッグできる攻撃者・OS を制御した攻撃者。Airlock はサンドボックスでも VPN でもファイアウォールでもありません。
02固定ルートと capability
各ルートは 1 つの上流と最小権限ポリシーにバインドされます(HTTP はメソッド/パス/クエリ、SSH はコマンドと対話、LLM はモデル/出力/レート/並列)。呼び出し元は失効可能なローカル capability を持ち、実際の Secret とは分離されています。
固定ターゲットの原則呼び出し元は上流 URL、SSH アドレス、モデルをポリシー外で指定できません。
03Secret のライフサイクル
- 入力:Airlock ウィンドウ内で入力(デスクトップ)または
0600 JSON 仕様(Server Core)。コマンドライン・ログ・WebView には入れません。 - 保存:既定はローカル
0600 ファイル。Keychain / Credential Manager / Secret Service も選択可能。要約とアクティビティは Secret を返しません。 - 使用:ポリシー承認後に上流リクエストで注入。レスポンスとエラーはサニタイズされます。
- ローテーションと削除:ローカル認証情報は独立にローテーション可能。ルート削除時に Secret も安全に消去されます。
04ポリシー境界
HTTPメソッド/パス/クエリGET/HEAD 許可リスト、パストラバーサル保護、同一オリジンリダイレクト、Range ダウンロード。
SSHコマンドと対話完全一致コマンドまたは制御付き exec。Shell/SFTP/PTY は独立スイッチ。Agent/X11・ポート転送は常に拒否。
LLMモデルと使用量モデル許可リスト、出力上限、RPM・並列上限。統計は数値のみ。
05コントロールプレーンと監査
デスクトップの制御チャネルはユーザー専用 Unix ソケット(Windows は名前付きパイプ)で、TCP 管理ポートはありません。Server Core の CLI は 0600 トークンで認証し、Web UI は loopback のみでサニタイズ表示です。アクティビティは既定でサニタイズされ、コマンド監査は明示的かつ上限付きです。
06導入の推奨事項
- 専用の最小権限上流アカウントを使用。「すべてのコマンド」と SFTP は隔離アカウントのみ。
- 入口は loopback を維持。プライベート LAN 開放前に対象サブネットの脅威を評価。
- Server Core は専用サービスアカウント、control/web トークン分離、SSH トンネル経由の Web UI。
- 認証情報を定期的にローテーションし、バックアップも Secret として扱います。
本番準備監査も参照してください。