AI News HubLIVE
サイト内リライト5 分で読了

翻訳待ち:Show HN: Hands-on Docker security labs, from CIS checks to AI context poisoning

AI サービスが一時的に利用できないため、復旧後に翻訳を補完します。ソース概要:Notifications You must be signed in to change notification settings Fork 8 Star 43 BranchesTags Open more actions menu Latest commit History 65 Commits 65 Commits Folders and files NameName Last commit message Last comm…

ソースHacker News AI著者: opscart

AI サービスが一時的に利用できないため、復旧後に翻訳を補完します。

Notifications You must be signed in to change notification settings Fork 8 Star 43 BranchesTags Open more actions menu Latest commit History 65 Commits 65 Commits Folders and files NameName Last commit message Last commit date .github/workflows .github/workflows docs docs examples examples labs labs tools tools .gitattributes .gitattributes .gitignore .gitignore LICENSE LICENSE README.md README.md Repository files navigation A hands-on Docker and container security guide built around reproducible labs, attack scenarios, defensive controls, and production-oriented validation. What You'll Learn The repository progresses from foundational Docker hardening to runtime escape analysis, secrets management, software supply-chain trust, AI-assisted remediation, and AI context-poisoning defenses. Core Topics Covered Security auditing: Docker Bench Security and CIS-aligned checks Container hardening: least privilege, Linux capabilities, read-only filesystems, and resource controls Vulnerability management: Trivy, Syft, Grype, SBOMs, and policy enforcement Image trust: Cosign signing, provenance, attestations, and admission controls Seccomp: application-specific syscall filtering Network security: segmentation, internal networks, TLS, and misconfiguration testing Runtime security: Docker socket exposure, privileged containers, dangerous capabilities, host mounts, and /proc or /sys exposure Secrets management: Docker Swarm secrets, Vault, BuildKit secrets, secret scanning, and audit evidence AI workload security: ML container controls, secured MCP tool access, and AI context-poisoning defenses Trust governance: hardened images, Kyverno policies, signed attestations, and fleet drift analysis OpsCart Labs Platform This guide is part of OpsCart Labs, a collection of open-source, hands-on labs informed by production cloud and Kubernetes operations. Available Lab Series Docker Security: A Practical Guide — this repository 13 labs covering Docker security from auditing through AI context defense Reproducible scripts, configurations, policies, and captured experiment evidence Status: active development Certified Kubernetes Administrator Exam Prep Hands-on CKA preparation labs Automated validation and operational notes Status: active development Why OpsCart Labs? Built from practical Docker, Kubernetes, cloud, and DevOps experience Designed around reproducible scenarios rather than theory alone Maintained in public Git repositories Intended for engineers, security practitioners, auditors, and platform teams Documentation Hub Use this section as the central entry point for the repository. Area Purpose Lab Catalog Select a hands-on lab by security domain or learning level Publications and Research Connect formal research, CNCF publications, practitioner articles, and implementation evidence Additional Resources Browse official documentation, standards, security tools, and primary research Setup Guide Prepare Docker, shared tooling, and the common lab environment Troubleshooting Guide Diagnose shared Docker, Compose, networking, tooling, and Kubernetes problems Repository Issues Report broken links, reproducibility problems, or documentation corrections Suggested Routes New to the repository: Setup Guide → Lab Catalog → Lab 01 Docker or container security practitioner: Lab Catalog → Labs 02–10 Supply-chain or platform engineer: Labs 03, 04, 07, 10, and 12 AI and agent-security reader: Labs 06, 11, and 13 Research or publication reader: Publications and Research Looking for authoritative references: Additional Resources A lab failed: Lab README → Troubleshooting Guide → repository issue Companion Projects Some topics evolve independently of this repository or require deeper experimentation than fits within the Docker Security Guide. These companion repositories provide verified implementations, extended experiments, and specialized documentation. Project Description Docker Sandbox DevOps Dedicated companion repository for Docker Sandboxes, AI coding-agent isolation, Kubernetes debugging, and DevOps toolkit experiments. Lab Catalog Each lab has its own README with prerequisites, detailed steps, validation, expected results, and cleanup instructions. The root README intentionally provides a concise catalog so lab-specific documentation remains the source of truth. Level 1: Foundations (Labs 01–06) Lab 01: Security Auditing with Docker Bench Run Docker Bench Security, interpret CIS-aligned findings, identify dangerous configurations, and review practical remediations. Estimated time: 30–45 minutes Lab 02: Secure Container Configurations Compare insecure and hardened configurations using capability controls, read-only filesystems, tmpfs, non-root execution, and no-new-privileges. Estimated time: 45–60 minutes Lab 03: Vulnerability Scanning Pipeline Scan images with Trivy, generate SBOMs with Syft, analyze them with Grype, and enforce vulnerability policy with OPA. Estimated time: 60–90 minutes Lab 04: Image Signing and Verification Sign and verify images with Cosign, examine content trust, manage signing keys, and enforce image-signing policy. Estimated time: 45–60 minutes Lab 05: Custom Seccomp Profiles Understand Linux syscalls, examine Docker's default seccomp behavior, generate restrictive profiles, and validate them without breaking workloads. Estimated time: 90–120 minutes Lab 06: AI Model Security Harden containerized ML inference with resource controls, input validation, monitoring, and Kubernetes security settings. Estimated time: 60–90 minutes Level 2: Supply Chain and Network Security (Labs 07–08) Lab 07: Supply Chain Security with SBOM Generate and compare SBOMs, scan them for vulnerabilities, and integrate supply-chain checks into GitHub Actions and Azure Pipelines. Estimated time: 45–60 minutes Lab 08: Docker Network Security — 5 Scenarios Practice network isolation, multi-tier segmentation, internal networks, TLS encryption, and common network-misconfiguration remediation. Estimated time: 18–22 minutes Level 3: Runtime Escape and Defense (Lab 09) Lab 09: Docker Runtime Escape — 5 Scenarios Explore Docker socket escape, privileged containers, CAP_SYS_ADMIN, host mounts, and /proc or /sys exposure, then apply Falco, Kyverno, and audit-script defenses. Run offensive scenarios only in an isolated disposable environment. Do not use a production host. Estimated time: 2–2.5 hours Level 4: Production Security and Controlled Remediation (Labs 10–11) Lab 10: Docker Secrets Management — 6 Scenarios Study secret leakage anti-patterns, Docker Swarm secrets, Vault integration, BuildKit secret mounts, repository scanning, and audit/compliance evidence. Scenarios: Secret-management anti-patterns Docker Swarm secrets HashiCorp Vault integration BuildKit secrets Secret scanning Audit and compliance Estimated time: approximately 90 minutes Lab 11: Docker MCP Gateway for AI-Powered Container Remediation Build an AutoGen-based agent that uses GPT-3.5-turbo and a secured MCP server to inspect logs, restart containers, update resources, and escalate unsafe or uncertain remediation decisions. The security pipeline includes HMAC authentication, Redis-backed rate limiting, input validation, audit logging, non-root execution, read-only filesystems, dropped capabilities, and resource limits. Scenarios: OOM remediation, crash escalation, exit-code retry logic, and health-check recovery. Estimated time: 60–90 minutes Level 5: Container Trust Governance (Lab 12) Lab 12: Docker Hardened Images as a Container Trust Control Plane Build a vendor-neutral trust-control architecture using hardened images, Kyverno admission policies, Cosign, SBOM and provenance attestations, phased enforcement, break-glass controls, and fleet drift analysis. Experiments: Drift observation Trust and provenance verification Admission enforcement Supply-chain gates Runtime failure modes Estimated time: 90–120 minutes Level 6: AI Context Security (Lab 13) Lab 13: AI Context Poisoning Detection and Defense Test zero-width Unicode instruction injection and malicious agent hooks against controlled projects, compare Claude Code and Gemini CLI behavior, and validate Docker Sandboxes as an infrastructure-level defense. The lab documents two independent defenses: Agent-layer detection and refusal Sandbox-level filesystem isolation Estimated time: follow the lab README; execution time varies by agent and sandbox environment Getting Started Prerequisites Common requirements: Docker Engine or Docker Desktop Docker Compose v2 Linux, macOS, or Windows with WSL2 Basic Docker and command-line knowledge Some advanced labs additionally require tools such as kubectl, kind, helm, cosign, syft, grype, jq, Python, an OpenAI API key, or Docker Sandboxes. Always check the selected lab's README before starting. Quick Start git clone https://github.com/opscart/docker-security-practical-guide.git cd docker-security-practical-guide cd labs/01-docker-bench-security cat README.md ./run-audit.sh How to Use This Guide For Beginners Start with Labs 01–06, then continue according to your goals. Each lab remains self-contained, so you can pause or skip topics that are not relevant to your environment. For Experienced Users Select labs by threat model: Labs 03, 04, 07, and 12 for vulnerability and supply-chain controls Labs 05, 08, and 09 for runtime and isolation controls Lab 10 for secrets management Labs 06, 11, and 13 for AI-related container security For Security Auditors Use Lab 01 for baseline checks, Labs 03 and 07 for vulnerability and SBOM evidence, Lab 09 for runtime-risk review, Lab 10 for secrets evidence, and Lab 12 for admission and trust-governance controls. For DevOps and Platform Engineers Focus on reusable scripts, CI/CD examples, policies, runtime controls, and migration patterns. Adapt them to your platform only after reviewing each lab's assumptions and safety notes. Lab Setup Each lab is self-contained and may include: A lab-specific README.md Setup, execution, validation, and cleanup scripts Dockerfiles or Docker Compose configurations Kubernetes manifests and policy definitions Vulnerable and hardened examples Captured experiment evidence CI/CD configurations where relevant Running a Lab cd labs/XX-lab-name cat README.md # Run only the commands documented by that lab. # Cleanup commands also vary by lab. Learning Path Foundations Labs 01–06 | +--> Supply chain and network security: Labs 07–08 | +--> Runtime escape and defense: Lab 09 | +--> Production security and remediation: Labs 10–11 | +--> Container trust governance: Lab 12 | +--> AI context security: Lab 13 Estimated total: approximately 14–17 hours, excluding optional extensions, environment setup, repeated experiments, and agent-dependent Lab 13 testing. Tools and Technologies Security Tools Used Docker Bench Security, Trivy, Syft, Grype, Cosign, OPA, Kyverno, Falco, Vault, GitLeaks, OpenSSL, Docker Scout, kind, Kubernetes, Redis, Flask, AutoGen, Claude Code, Gemini CLI, and Docker Sandboxes. Technologies Covered Docker Engine, Docker Compose, Linux capabilities, seccomp, user namespaces, read-only filesystems, Docker networking, TLS, CI/CD security gates, SBOMs, provenance, admission control, secrets management, AI tool isolation, and context-poisoning defense. Best-Practices Summary Image and Supply-Chain Security Use minimal, maintained base images Pin versions or digests where reproducibility matters Scan images and generate SBOMs Sign and verify release images Enforce trusted origin, signature, provenance, and vulnerability policy Maintain break-glass procedures with auditability Runtime Security Run as a non-root user Drop unnecessary capabilities Use read-only filesystems and controlled writable mo [truncated for AI cost control]