HN 표시: Buildcage – Docker 빌드에 대한 송신 필터링(SNI 기반, MitM 없음)

hackernews | | 📰 뉴스
#docker #sni #보안 #컨테이너 #필터링 #하드웨어/반도체
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

해커뉴스(Show HN)에 소개된 ‘Buildcage’는 도커 빌드 중에 악의적인 종속성이 기밀을 유출하거나 외부에 연결하는 것을 방지하기 위해 개발된 솔루션입니다. 이 도구는 미들맨 공격 없이 SNI 검사를 통한 HTTPS 필터링을 제공하며, 허용된 도메인 외의 모든 아웃바운드 연결을 차단하고 기록합니다. 최근 업데이트에서는 HAProxy로 교체하여 모든 TCP 포트 가로채기 및 IP 화이트리스트 기능을 추가하고 규칙 문법을 개선했습니다. 개발자는 이를 보안의 ‘마지막 방어선’으로 정의하며, 신뢰 문제를 해결하기 위해 직접 이미지를 빌드할 수 있는 가이드를 제공합니다.

본문

Secure your Docker builds against supply chain attacks — restrict outbound network access to only the domains you allow. When you run RUN npm install or RUN pip install in a Dockerfile, those commands can execute arbitrary code and make outbound connections to any server on the internet — without visibility or control. A compromised dependency could silently exfiltrate your build secrets or phone home to an attacker's server. Buildcage prevents this. You define a list of allowed domains, and only those connections are permitted during builds. Everything else is blocked. No Dockerfile changes required. No proxy configuration needed. No certificates to install. Works with any language or package manager. Buildcage runs as a remote driver for Docker Buildx. All RUN step containers are placed on an isolated network, and outbound traffic is routed through a proxy that enforces your allowlist. - HTTPS: SNI (Server Name Indication) for domain matching — TLS is not terminated - HTTP: Host header for domain matching - Direct IP access: blocked unless explicitly allowed - Non-TCP protocols (UDP, ICMP, etc.): all blocked — only TCP connections are supported Two modes available (see Reference for details): - Audit mode: Records all network destinations during builds, useful for creating allowlists. - Restrict mode: Allows access only to permitted domains, blocking everything else. - CI/CD pipelines pulling from public registries — if your builds download packages from npm, PyPI, RubyGems, or other public sources, Buildcage limits the blast radius of compromised packages - Builds that handle secrets — if your Dockerfiles use build secrets, tokens, or credentials, Buildcage prevents them from being exfiltrated to unauthorized servers - Teams that need network visibility — if you need to know exactly which external services your builds contact, Buildcage logs every outbound connection and can enforce an allowlist - Fully offline builds — if your builds run in an air-gapped environment with no external network access - Internal-only registries — if all dependencies come from vetted, internal repositories with no public package sources - No-dependency builds — if your Dockerfile only copies files and never runs commands that fetch external resources - 🚀 GitHub Actions support: Available as reusable actions for CI/CD pipelines - ✅ Zero Dockerfile changes: Works with existing Dockerfiles without modification - 🔒 Network isolation: Isolates network access for each RUN step using CNI (Container Network Interface) - 🔍 Audit mode: Discover dependencies before enforcing restrictions - 🛡️ Restrict mode: Production-ready access control - 📊 Detailed logging: Complete visibility into all network connections during builds - 🔐 Self-hostable: Fork or import the repo to build and manage the image in your own GitHub environment — full control over what you trust - Docker with BuildKit (buildx plugin) - GitHub Actions runner with Docker support (for CI/CD usage) - Docker Compose (for local usage) Using Buildcage in GitHub Actions involves three workflow steps: - Start the Buildcage container (runs BuildKit inside a network-controlled environment) - Configure Docker Buildx to use the Buildcage container as a remote builder - Run your build as usual — your Dockerfile and build commands stay the same name: Discover Build Dependencies on: [push] jobs: audit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Start Buildcage in audit mode id: buildcage uses: dash14/buildcage/setup@v2 with: proxy_mode: audit # Log everything, block nothing - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 with: driver: remote endpoint: docker-container://buildcage - name: Build and discover dependencies uses: docker/build-push-action@v6 with: context: . push: false # Set to true to push the built image - name: Show Buildcage report if: always() uses: dash14/buildcage/report@v2 with: fail_on_blocked: false # Don't fail, just show the report See the complete example workflow. The report action outputs a Job Summary showing every domain your build contacted: Copy these domain names into allowed_https_rules or allowed_http_rules for Step 3. name: Secure Build on: [push] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Start Buildcage in restrict mode id: buildcage uses: dash14/buildcage/setup@v2 with: proxy_mode: restrict # Block everything except allowed domains allowed_https_rules: >- registry.npmjs.org:443 fonts.googleapis.com:443 name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 with: driver: remote endpoint: docker-container://buildcage - name: Build with protection uses: docker/build-push-action@v6 with: context: . push: false # Set to true to push the built image - name: Show Buildcage report if: always() uses: dash14/buildcage/report@v2 # Build fails if any unexpected connections were blocked See the complete example workflow. Your builds are now protected. Any unexpected connections wil

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →