Rules

Each rule belongs to one category, which sets its severity unless a config file overrides it; only correctness is enabled out of the box. A rule that names a platform runs only when that platform is selected with -platform.

correctness

The configuration is invalid or does not behave as written. These run by default, at error.

RulePlatformChecks
conflicting-container-defalldisallow a devcontainer.json that defines more than one of “image”, “build”, or “dockerComposeFile”
feature-install-script-not-executablealldisallow a Feature’s install.sh that lacks executable permission bits
id-dir-mismatchalldisallow a Feature’s or Template’s “id” that does not match the name of its containing directory
invalid-semveralldisallow a Feature’s or Template’s “version” that is not a valid semantic version
missing-build-dockerfilealldisallow a devcontainer.json “build” object that is missing “dockerfile”
missing-compose-servicealldisallow a devcontainer.json that sets “dockerComposeFile” without “service”
missing-container-defalldisallow a devcontainer.json that defines none of “image”, “build”, or “dockerComposeFile”
missing-feature-install-scriptalldisallow a Feature directory without the required install.sh install script
missing-required-propsalldisallow a Feature’s or Template’s metadata that is missing a required property (“id”, “version”, or “name”)
missing-workspace-mount-folderalldisallow a devcontainer.json using “image” or “build” that sets only one of “workspaceMount” or “workspaceFolder”
no-bind-mountcodespacesdisallow “bind” type entries in “mounts”, which GitHub Codespaces silently ignores except for the Docker socket
no-host-port-formatcodespacesdisallow “host:port” entries in “forwardPorts” and “portsAttributes”, which GitHub Codespaces does not support
undefined-template-optionalldisallow a ${templateOption:...} reference to an option not declared in devcontainer-template.json

security

Container runtime privileges and hardening.

RulePlatformChecks
no-cap-add-allalldisallow granting all Linux capabilities via an “ALL” entry in the “capAdd” property, or a “–cap-add=ALL” entry in a devcontainer.json’s “runArgs”
no-docker-socket-mountalldisallow bind-mounting the host’s Docker socket via a devcontainer.json’s “mounts” or “runArgs”, which grants the container root-equivalent control over the host
no-privileged-containeralldisallow running the container in privileged mode via the “privileged” property or a “–privileged” entry in “runArgs”
no-seccomp-overridealldisallow overriding the container runtime’s default seccomp profile via a devcontainer.json’s or Feature’s “securityOpt” property, or a “–security-opt seccomp=…” entry in a devcontainer.json’s “runArgs”
no-seccomp-unconfinedalldisallow disabling seccomp confinement via a devcontainer.json’s or Feature’s “securityOpt” property, or a “–security-opt seccomp=unconfined” entry in a devcontainer.json’s “runArgs”
require-cap-drop-allallrequire a “–cap-drop=ALL” entry in a devcontainer.json’s “runArgs”, dropping every Linux capability
require-no-new-privilegesallrequire “no-new-privileges” to be set via a devcontainer.json’s “securityOpt” property, or a “–security-opt no-new-privileges…” entry in “runArgs”
require-non-rootallrequire “remoteUser” or, if unset, “containerUser” to be set to a non-root user

reproducibility

Unpinned versions or digests that let the environment drift between builds.

RulePlatformChecks
no-image-latestalldisallow container images without an explicit tag or with the “latest” tag
pin-extension-versionvscode, codespacesdisallow a “customizations.vscode.extensions” entry without an explicit pinned version
pin-feature-versionalldisallow a Feature reference without an explicit version or with the “latest” version
pin-image-digestalldisallow an “image” property that does not pin the image by content digest (e.g. “image@sha256:…”)

style

Discouraged or legacy configuration that still works.

RulePlatformChecks
no-app-portalldisallow the legacy “appPort” property in favor of “forwardPorts”
unused-template-optionalldisallow a Template option that no file in the Template references