- Home
- Skills
- DevOps & Cloud
- Dev Container Safety Check
More screenshots
Works with the AI Agents you already use
Dev Container Safety Check
| bash" does not run in the container: it runs on your own machine, every time anyone opens the repository in a dev container.
$5
Dev Container Safety Check
Example session with this skill installed
Check this project with devcontainer-safety-check.
- Read your context and instructions
- Compiled the dev container safety
$ python3 scripts/check_devcontainer.py examples/risky
BLOCK .devcontainer/devcontainer.json:7 D01 HOST_COMMAND_DOWNLOADS_CODE
"initializeCommand": "curl -fsSL https://tools.example.dev/bootstrap.sh | bash",
Why: initializeCommand runs on the host machine, outside the container, every time the dev container is created or started, and this one downloads a script and runs it (curl | bash, iwr | iex). Whoever controls that URL runs code on every developer's machine with their user rights.
Safer: Move setup into the container (a Dockerfile step, a Feature or postCreateCommand). If something must run on the host, commit the script to the repository and run that file.
BLOCK .devcontainer/devcontainer.json:14 D02 SECRET_IN_DEVCONTAINER
BLOCK .devcontainer/devcontainer.json:17 D03 HOST_SECRETS_MOUNTED
BLOCK .devcontainer/devcontainer.json:18 D03 HOST_SECRETS_MOUNTED
REVIEW .devcontainer/devcontainer.json:5 D14 UNPINNED_IMAGE_OR_FEATURE
REVIEW .devcontainer/devcontainer.json:6 D11 PRIVILEGED_CONTAINER
REVIEW .devcontainer/devcontainer.json:9 D12 DOCKER_HOST_ACCESS
REVIEW .devcontainer/devcontainer.json:10 D14 UNPINNED_IMAGE_OR_FEATURE
REVIEW .devcontainer/devcontainer.json:20 D15 EXTRA_CONTAINER_PRIVILEGE
REVIEW .devcontainer/devcontainer.json:21 D20 PORT_OPEN_TO_NETWORK
REVIEW .devcontainer/devcontainer.json:23 D13 SETUP_COMMAND_DOWNLOADS_CODE
REVIEW .devcontainer/devcontainer.json:24 D17 ROOT_USER
REVIEW .devcontainer/ops/devcontainer.json:12 D18 HOST_COMMAND
REVIEW .devcontainer/ops/devcontainer.json:14 D16 HOST_NAMESPACE
REVIEW .devcontainer/ops/devcontainer.json:17 D19 SENSITIVE_HOST_MOUNT
REVIEW .devcontainer/ops/devcontainer.json:25 D21 CODESPACES_BROAD_REPO_ACCESS
(Each finding also has Why and Safer lines, as in the first one.)
Verdict: BLOCK. Checked 2 files, 2 with dev container content.
This is a static check of file text. NOT FLAGGED is not a guarantee.
Connects securely to your tools. The creator never sees your data.
About this skill
"initializeCommand": "curl -fsSL https://... | bash" does not run in the container: it runs on your own machine, every time anyone opens the repository in a dev container. And a mount of ${localEnv:HOME}/.ssh hands your private keys to every package install script inside it. This skill finds those and twelve other dev container risks before anyone opens the folder, and tells you how to fix each one.
Your agent runs a scanner on .devcontainer/devcontainer.json, .devcontainer.json and the per-folder configurations under .devcontainer/ (VS Code Dev Containers, GitHub Codespaces, the devcontainer CLI). It reads JSON with comments and trailing commas, knows the ${localEnv:NAME} and ${containerEnv:NAME} variables, the string, array and object forms of lifecycle commands, mount strings and mount objects, the docker run options in runArgs, that runArgs, appPort and workspaceMount do not apply to Docker Compose configurations, that numeric appPort values stay on localhost, and that a devcontainer-lock.json pins Features. Local development passwords (postgres, devpass, rootpass), settings about a secret (PASSWORD_HASHER) and placeholders (your-token, django-insecure-...) are not reported as secrets. It never runs docker, the devcontainer CLI or any command it finds. It returns BLOCK, REVIEW, or NOT FLAGGED, with the file, line, reason, and a safer approach. Secrets are never printed.
What it checks
BLOCK
- D01: an initializeCommand (it runs on the host) that downloads a script and runs it: curl | bash, bash <(curl ...), iwr | iex
- D02: passwords, tokens and keys written in containerEnv, remoteEnv, build args, runArgs -e, lifecycle commands (also docker login -p, az login -p, sqlcmd -P and a literal echoed into docker login --password-stdin), ${localEnv:NAME:default} defaults, the secrets property or any setting (secret names, passwords in URLs, known token formats)
- D03: your home folder, ~/.ssh, ~/.aws, cloud CLI and Docker logins, GnuPG, .npmrc, .netrc and other credential files, the host's root folder or /etc mounted into the container
REVIEW
- D11: privileged containers ("privileged": true, --privileged in runArgs, or the docker-in-docker Feature, which turns it on)
- D12: the Docker or Podman socket mounted, or the docker-outside-of-docker Feature, which mounts it
- D13: onCreateCommand, postCreateCommand and the other setup commands that pipe a download into a shell
- D14: images without a tag or with :latest, and Features without a version, with :latest or given as a tarball URL (unless a devcontainer-lock.json pins them)
- D15: capabilities beyond Docker's defaults (SYS_PTRACE alone is fine), host devices, and seccomp, AppArmor or SELinux turned off (the SYS_PTRACE plus seccomp=unconfined debugger setup is not reported)
- D16: host network, PID, IPC, UTS, user or cgroup namespaces
- D17: remoteUser, containerUser or runArgs --user set to root
- D18: an initializeCommand that runs a program or script on the host (mkdir, touch, cp, docker pull and similar simple steps are fine)
- D19: ~/.kube, ~/.minikube, /proc, /sys, /dev, /var/lib/docker, /run, /boot or /lib/modules mounted from the host
- D20: ports published on every network interface (runArgs -p or -P, appPort strings without 127.0.0.1)
- D21: Codespaces repository permissions with write-all, write access on owner/*, or workflows write
What's included
- The scanner (Python 3.9+, standard library only)
- A rules guide with the reason, safer approach and official source for each rule
- A risky and a safe example project (an API dev container and a cluster-tools dev container), and the real report the scanner produces on the risky one
Limits It reads devcontainer.json files only: the Dockerfile, the Docker Compose files named in dockerComposeFile, Feature install scripts, settings that images and Features add through their own metadata (other than the Docker Features in D11 and D12) and scripts that commands call are not read. Commands are matched as text, so a script downloaded to a file and run in a later step is not reported. Major version tags such as :1 count as pinned although the publisher can move them; only a digest or devcontainer-lock.json pins a Feature exactly. Privileged mode and the Docker socket are REVIEW, not BLOCK: both hand the Docker host to code in the container, but both are deliberate, documented ways to run Docker in a dev container (the official docker-in-docker and docker-outside-of-docker templates use them), so privileged mode gets the same level whether it is written out or turned on by the Feature. Mounting the whole home folder (an example in the VS Code docs) is BLOCK because every key in it becomes readable in the container. NOT FLAGGED is not a guarantee.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.
Static check of devcontainer.json text. Dockerfiles, Compose files, Feature scripts and image metadata are not read; scripts downloaded and run in separate steps are not followed. NOT FLAGGED is not a guarantee.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 4 days ago
Permissions
Runs one local Python script in the terminal. It reads your project's files, writes nothing, and makes no network calls. The example project includes one clearly fake, inert secret (not-a-real-...). Nothing in it is run.