Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0795aa1
feat(rules): expand container privilege checks
claude Jul 28, 2026
1a33cbb
docs(rules): cite the policies behind the capability and namespace lists
claude Jul 28, 2026
269c6c2
docs(rules): drop the Pod Security Standards citation
claude Jul 28, 2026
bae0f4c
fix(rules): close the lower-case "all" gap and correct two rule claims
claude Jul 28, 2026
09bd969
fix(rules): apply the new matching consistently across the sibling rules
claude Jul 28, 2026
128af3a
fix(rules): report every offending runArgs entry, and privileged=true
claude Jul 28, 2026
106952c
fix(rules): parse the no-new-privileges value the way Docker does
claude Jul 28, 2026
4dc85ed
refactor(rules): consolidate how Docker arguments are read
claude Jul 28, 2026
ab64986
fix(rules): match what docker/cli and moby actually accept
claude Jul 28, 2026
93d09ff
fix(rules): take the last name field of a --network field list
claude Jul 28, 2026
bca2631
fix(rules): trim network fields, and read --security-opt from the array
claude Jul 28, 2026
c0e3d8d
fix(rules): read runArgs the way docker run parses its command line
claude Jul 28, 2026
61e0a4f
fix(rules): resolve the last of the derived divergences
claude Jul 28, 2026
2fd89c3
fix(rules): keep reading runArgs past an entry that is not a string
claude Jul 28, 2026
677cb10
fix(rules): keep reading runArgs past a positional entry
claude Jul 29, 2026
cb39acf
fix(rules): add --use-api-socket to the boolean runArgs flags
claude Jul 29, 2026
7e22ddb
refactor(rules): drop the runArgs flag-arity table
claude Jul 29, 2026
4ed393f
feat(rules)!: drop no-initialize-command
claude Jul 29, 2026
ca13d3c
test(rules): move the shorthand cases to the rule that reads shorthands
claude Jul 29, 2026
ec09f03
test(rules): test dockerargs.go directly
claude Jul 29, 2026
e4b3421
docs(rules): say what runArgsBoolFlag's caller has to know
claude Jul 29, 2026
c2df320
refactor(rules): drop the repeated-option precedence helpers
claude Jul 29, 2026
354a0f7
fix(rules): accept "src" and a key's case in a mount entry
claude Jul 29, 2026
c6f1ad2
fix(linter): drop a finding identical to one already reported
claude Jul 29, 2026
d470cba
fix(linter): order two findings at one position by message
claude Jul 29, 2026
35bfc84
fix(rules): lower-case the mount type in the object form too
claude Jul 29, 2026
0f0d1a8
fix(rules): read "runArgs" with docker's own flag table
nozaq Jul 29, 2026
6933938
refactor(rules): move the Docker argument reading into its own package
nozaq Jul 29, 2026
01f2c60
Merge remote-tracking branch 'origin/main' into claude/rule-expansion…
claude Jul 29, 2026
c00a47a
Merge remote-tracking branch 'origin/claude/rule-expansion-proposal-1…
claude Jul 29, 2026
d58f2cf
fix(dockerargs): expand clustered shorthands a letter at a time
claude Jul 29, 2026
55d8857
test(dockerargs): pin the "-x=value" reading, guard the bare value
claude Jul 29, 2026
5d4bfda
refactor(linter): traverse "runArgs" as the docker run argv it is
claude Jul 29, 2026
28b0f27
fix(linter): match a "runArgs" flag by flag, not by spelling
claude Jul 30, 2026
6e52b09
fix(linter): stop the ordinary traversal at "runArgs"
claude Jul 30, 2026
82549ba
fix(linter): read every "runArgs" member, not just the first
claude Jul 30, 2026
5f85d71
fix(rules): identify a "runArgs" flag by the flag, not by its spelling
claude Jul 30, 2026
eada7bf
fix(rules): read a mount value as the flag it was written for
claude Jul 30, 2026
55ed1b2
fix(rules): a one-field "--volume" value mounts nothing of the host
claude Jul 30, 2026
92f18d5
fix(rules): read four Docker values the way Docker reads them
claude Jul 30, 2026
6ccd626
fix(dockerargs): read a "--network" field list as the CSV record it is
claude Jul 30, 2026
88c4802
fix(rules): answer "is this the Docker socket" in one place
claude Jul 30, 2026
a47b0d3
test(linter): make two assertions about the sort and the gate real
claude Jul 30, 2026
c4cc7c1
test(rules): pin every capability no-dangerous-cap-add reports
claude Jul 30, 2026
2e4cad6
test(rules): stop assertIssuesInDir writing to the caller's slice
claude Jul 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@ jobs:
- run: make docs-content
- run: git diff --exit-code README.md

dockerflags:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
# The flag table is generated from the docker/cli pinned in cmd/dockerflagsgen/go.mod, so a
# diff here means Docker changed the flags decolint reads "runArgs" with — which is what a
# renovate bump of that module is meant to surface.
- run: make dockerflags
- run: git diff --exit-code dockerargs/runflags_gen.go

dogfooding:
runs-on: ubuntu-latest
permissions:
Expand Down
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,25 @@ The layout of everything the generator writes lives in
[`cmd/docgen/templates/`](cmd/docgen/templates/), so changing how a
page looks is an edit to a template rather than to Go code.

## The "docker run" flag table

The devcontainer tooling passes `runArgs` to `docker run` unchanged, so
reading it means knowing which flags take a value: `["--label",
"--cap-drop=ALL"]` drops no capability, because Docker takes the second
entry as the label's value. [`dockerargs/runflags_gen.go`](dockerargs/runflags_gen.go)
is that table, generated by [`cmd/dockerflagsgen`](cmd/dockerflagsgen/)
from the flags docker/cli registers, so it can disagree with Docker only
by being older. Regenerate it with `make dockerflags`.

The generator is a module of its own, because it imports docker/cli,
which decolint neither imports nor ships. That also puts it outside
`./...`, so `go build`, `go test` and `make lint` at the repository root
leave it alone. Renovate updates that module like any other dependency,
and CI's `dockerflags` job regenerates the table and fails on a diff —
so a Docker release that changes one of these flags arrives as a
reviewable change to this file rather than as a finding that is quietly
wrong.

When implementing or reviewing rules, consult the Dev Container
specification at [containers.dev](https://containers.dev/) to confirm
the behavior matches the spec:
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ docs-serve: docs-content docs-syntax ## Serve the documentation site with live r
# /decolint/ and leave http://localhost:$(DOCS_PORT)/ a 404. Override it for local preview.
$(HUGO) server --source docs --port $(DOCS_PORT) --baseURL http://localhost:$(DOCS_PORT)/

.PHONY: dockerflags
dockerflags: ## Regenerate the "docker run" flag table the runArgs rules read
go generate ./dockerargs

.PHONY: docs-content
docs-content: ## Regenerate the rule pages, README-derived pages, and README rules table
go run ./cmd/docgen
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ runs without configuration; the rest are `off` until you enable them:
| Category | Default | Rules |
| --- | --- | --- |
| [`correctness`](https://bare-devcontainer.github.io/decolint/rules/#correctness) | `error` | 13 |
| [`security`](https://bare-devcontainer.github.io/decolint/rules/#security) | `off` | 8 |
| [`security`](https://bare-devcontainer.github.io/decolint/rules/#security) | `off` | 11 |
| [`reproducibility`](https://bare-devcontainer.github.io/decolint/rules/#reproducibility) | `off` | 4 |
| [`style`](https://bare-devcontainer.github.io/decolint/rules/#style) | `off` | 2 |
<!-- /decolint:categories -->
Expand Down
99 changes: 99 additions & 0 deletions cmd/dockerflagsgen/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
module github.com/bare-devcontainer/decolint/cmd/dockerflagsgen

go 1.26.5

require (
github.com/docker/cli v29.6.2+incompatible
github.com/spf13/cobra v1.10.2
github.com/spf13/pflag v1.0.10
)

require (
dario.cat/mergo v1.0.2 // indirect
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/clipperhouse/uax29/v2 v2.2.0 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/cli-docs-tool v0.11.0 // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.9.8 // indirect
github.com/docker/go-connections v0.8.1 // indirect
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fvbommel/sortorder v1.1.0 // indirect
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/klauspost/compress v1.18.7 // indirect
github.com/mattn/go-runewidth v0.0.27 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/go-archive v0.2.1 // indirect
github.com/moby/moby/api v1.55.0 // indirect
github.com/moby/moby/client v0.5.1 // indirect
github.com/moby/patternmatcher v0.6.1 // indirect
github.com/moby/swarmkit/v2 v2.1.2 // indirect
github.com/moby/sys/atomicwriter v0.1.0 // indirect
github.com/moby/sys/capability v0.4.0 // indirect
github.com/moby/sys/sequential v0.7.0 // indirect
github.com/moby/sys/signal v0.7.1 // indirect
github.com/moby/sys/symlink v0.3.0 // indirect
github.com/moby/sys/user v0.4.1 // indirect
github.com/moby/sys/userns v0.1.0 // indirect
github.com/moby/term v0.5.2 // indirect
github.com/morikuni/aec v1.1.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.1 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/sirupsen/logrus v1.9.4 // indirect
github.com/tonistiigi/go-rosetta v0.0.0-20220804170347-3f4430f2d346 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
go.etcd.io/raft/v3 v3.6.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 // indirect
go.opentelemetry.io/otel v1.44.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.44.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0 // indirect
go.opentelemetry.io/otel/metric v1.44.0 // indirect
go.opentelemetry.io/otel/sdk v1.44.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.44.0 // indirect
go.opentelemetry.io/otel/trace v1.44.0 // indirect
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/net v0.56.0 // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/term v0.45.0 // indirect
golang.org/x/text v0.40.0 // indirect
golang.org/x/time v0.11.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260630182238-925bb5da69e7 // indirect
google.golang.org/grpc v1.82.0 // indirect
google.golang.org/protobuf v1.36.11 // indirect
tags.cncf.io/container-device-interface v1.1.0 // indirect
)
Loading
Loading