發表文章

目前顯示的是有「proxy」標籤的文章

打造 AI Agent 零信任 Egress 防線

English Abstract: Putting real API keys into the environment variables of AI agent containers is unsafe. An agent that can run shell commands can read them from /proc/self/environ, leak them through DNS queries, or expose them through a .env file. This article builds a zero-trust egress layer: an internal-only Docker network with no external route, plus an egress proxy that holds the real keys and swaps a phantom token for them only on allowlisted domains. It includes a runnable Docker Compose and mitmproxy setup, and extends the design into an enterprise AI gateway for key rotation, budget circuit breaking, and audit logging. 本文重點大綱 架構觀念翻轉 :在微服務時代,The Twelve-Factor App 提倡將設定與憑證存入環境變數(Environment Variables);但在具備 Shell 執行權限與自主控制迴圈(Control Loop)的 AI Agent 時代,將真實 API Key 放進容器環境變數等同於將機密公開。 三大真實攻擊向量與 CVE 佐證 :深入剖析失控或遭受間接提示詞注入(Indirect Prompt Injection)的 AI Agent,如何繞過指令黑名單,透過 Linux /proc/self/environ 跨行程繼承 、 DNS 隧道(DNS Exfiltration,以 CVE-2025-55284 為例) 與 .env 渲染漏洞 竊取憑證。 視覺化網路拓撲與時序拆解 ...

Docker 環境下的 Proxy 配置

關於 Docker 環境下的 Proxy 配置,需要先根據問題具體情況分辨配置方法,有兩種:一個是 docker daemon 的配置,這主要是為了能讓 docker host 通過 proxy server 使用 docker pull/docker run 存取遠端 registry;另一個是 docker client 為了建置 image 或運行 container 的時候所需要的網路配置。 首先快速回顧一下 Linux 作業系統中命令行環境的 proxy 配置方法,以 CentOS 系統環境為例,假設一台 HTTPS proxy server 位在 192.168.1.34 而且 port 是 3128: # environment variables for https proxy # export https_proxy="https://192.168.1.34:3128/" 如果 Proxy server 需要輸入帳號密碼,則用下面這樣的形式 # Https proxy with authentication # export https_proxy="https://username:password@192.168.1.34:3128/" 之後 ping 8.8.8.8 看看Internet是否有連通,可以的話就可在 shell 環境下使用軟體包管理器像是 yum, apt-get 等等,安裝新的軟體,但是,同樣的作業系統環境變數設定對於 Docker 引擎不起作用。 Docker 環境下的 Proxy 配置,根據問題具體情況分為 docker daemon 以及 docker client 的配置,下面分別詳細說明。以下方法可適用在 Docker CE 或 Docker EE 17.06 以上的版本。 (一)Docker daemon 的 proxy 配置 如果 Docker host 處於 air-gapped 的環境下,需要先配置 proxy 才能連到 Internet,否則直接用 docker pull 或相關的命令從遠端 registry 來存取 docker images 會遭遇失敗。 以 CentOS,RedHat, Debian, Ub...

熱門文章

Docker 環境下的 Proxy 配置