Skip to content

feat(spec,tck): add host-only docker registry authentication - #201

Merged
cdupuis merged 1 commit into
docker:mainfrom
rumpl:docker-auth
Nov 4, 2026
Merged

cdupuis merged 1 commit into
docker:mainfrom
rumpl:docker-auth

Conversation

@rumpl

@rumpl rumpl commented Nov 3, 2026

Copy link
Copy Markdown
Member

What

com.docker.sandbox/docker-auth@1: registry authentication through opaque, run-scoped placeholders. Real login credentials and issued tokens remain outside the sandbox while Docker-compatible clients keep working unchanged.

Config is only a list of registries:

capabilities:
  - type: com.docker.sandbox/docker-auth@1
    config:
      registries: [docker.io, ghcr.io]

The contract is implementation-neutral and outcome-oriented: credential discovery, storage, token acquisition and renewal strategies are runtime choices. Authentication services are learned from verified registry challenges, not configured endpoints.

Spec layer

  • Contract doc with per-requirement TCK anchors, JSON schema, strict Go validation (DNS grammar, Docker Hub alias dedup), whole-entry arity, composition/surface rules
  • Spec package tests: validation, composition, surface, expansion, schema/validator agreement

TCK

Eight runtime checks share one guest probe and one suite-owned TLS service (registry, token issuer, CDN):

  • host-resolution — admitted binding works; required+missing refuses; optional+missing skips and records
  • request-scope — the real login appears only on the admitted HTTPS token exchange
  • host-only — clients resolve usable placeholders, never the real login
  • token-mediation — client-visible token fields are placeholders; failed exchanges fail closed
  • bearer-scope — substitution confined to the admitted HTTPS registry API; unknown placeholders rejected
  • redirect-confinement — signed download URLs stay host-side; client-visible locations remain usable
  • lifetime — authentication available in install/startup hooks; run-local placeholders withdrawn when the run ends
  • no-extra-access — no egress, socket or engine from the grant alone

Confinement is judged by exact-value comparison at the client interface and in the services' independent request traces — never by scanning probe output — so no output encoding can hide a leak. Every check has a mutation in the conforming fake, each verified to fail for its intended reason. config-valid is covered by descriptor-valid; source-private is waived following the git-identity@1/source-private precedent.

The adapter contract gains create --docker-auth-config <absolute-path>, a suite-owned transport for synthetic bindings, routes for the three logical test hosts, and the suite CA.

Validation

gofmt, vet, unit tests (both modules), race, markdownlint, anchor/waiver accounting, fixture validation, conforming-fake baseline and all mutations pass.

@rumpl
rumpl requested a review from a team as a code owner November 3, 2026 22:33
Copilot AI balanced review requested due to automatic review settings November 3, 2026 22:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The sandbox authentication tests can reject conforming runtimes, misattribute setup traffic, and miss bearer-confinement and redirect network-policy violations.

5 open issues
What changed in this PR

Adds com.docker.sandbox/docker-auth@1 to the specification and conformance suite, defining registry authentication through run-scoped placeholders while keeping real credentials outside the sandbox.

Changes:

  • Defines the capability contract, strict validation, JSON schema, and composition rules.
  • Adds eight runtime conformance checks, synthetic HTTPS services, guest probes, and fake-adapter mutations.
  • Extends adapter configuration and provides an example Kit and authoring guidance.
File Description
tck/​sandbox/​testdata/​fixtures/​workload/​workload.dockerfile Installs the authentication probe.
tck/​sandbox/​testdata/​fixtures/​workload/​kit-tck-docker-auth.py Observes client credentials and HTTP exchanges.
tck/​sandbox/​testdata/​fixtures/​docker-auth/​docker-auth.yaml Requests required registry authentication.
tck/​sandbox/​testdata/​fixtures/​docker-auth-optional/​docker-auth-optional.yaml Requests optional registry authentication.
tck/​sandbox/​testdata/​fixtures/​docker-auth-network/​docker-auth-network.yaml Grants network access to test services.
tck/​sandbox/​testdata/​fixtures/​docker-auth-hooks/​docker-auth-hooks.yaml Exercises authentication during lifecycle hooks.
tck/​sandbox/​testdata/​fixtures/​docker-auth-absent/​docker-auth-absent.yaml Provides a network-only baseline.
tck/​sandbox/​testdata/​fake-adapter Dispatches authentication fixtures to the fake runtime.
tck/​sandbox/​testdata/​docker-auth-fake.py Models credential mediation and failure mutations.
tck/​sandbox/​sandbox_test.go Registers authentication mutations.
tck/​sandbox/​fixtures_test.go Updates the expected fixture count.
tck/​sandbox/​docker_auth.go Implements synthetic services and runtime checks.
tck/​sandbox/​coverage_test.go Records requirement coverage and the privacy waiver.
tck/​sandbox/​checks.go Adds authentication to capability-refusal checks.
tck/​adapter/​adapter.go Transports suite-owned authentication configuration.
tck/​adapter/​adapter_test.go Verifies literal configuration-path transport.
Taskfile.yaml Includes the example in Kit builds.
spec/​validate.go Integrates authentication validation.
spec/​types.go Defines the capability identifier.
spec/​schema_test.go Includes the capability in schema checks.
spec/​instance_key.go Assigns whole-entry arity.
spec/​instance_key_test.go Tests the capability’s arity.
spec/​groups.go Registers the known capability.
spec/​docker_auth.go Defines configuration and registry validation.
spec/​docker_auth_test.go Tests validation, composition, expansion, and schema agreement.
spec/​capabilities.go Registers the typed configuration.
spec/​capabilities_test.go Tests strict parameterized configuration decoding.
skills/​create-kit-v3/​SKILL.md Adds authentication authoring guidance.
schema/​kit.schema.json Connects the capability to its configuration schema.
schema/​capabilities/​com.docker.sandbox/​docker-auth@1.schema.json Defines registry-list constraints.
examples/​docker-auth/​docker-auth.yaml Demonstrates authentication with separate network grants.
docs/​spec/​SPEC-v3.md Lists the capability and its arity.
docs/​spec/​conformance.md Documents adapter bindings, routing, and probe requirements.
docs/​spec/​capabilities/​com.docker.sandbox/​docker-auth@1.md Defines credential confinement and runtime obligations.

Review effort: Balanced

Comment thread tck/sandbox/docker_auth.go Resolved
Comment thread tck/sandbox/docker_auth.go Resolved
Comment thread tck/sandbox/docker_auth.go Resolved
Comment thread tck/sandbox/docker_auth.go Resolved
Comment thread tck/sandbox/docker_auth.go Resolved
Copilot AI balanced review requested due to automatic review settings November 3, 2026 22:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The conformance checks can pass despite credential leaks, out-of-scope credential substitution, or expired authorization reuse because their observations and probes do not adequately exercise those cases.

3 open issues
5 resolved since last review

Review effort: Balanced

Comment thread tck/sandbox/docker_auth.go Resolved
Copilot AI balanced review requested due to automatic review settings November 3, 2026 22:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Missing HTTP-status validation, fragile scenario selection, and concurrent token-allocation races undermine conformance results, while upload-state credential leaks remain untested.

4 open issues
3 resolved since last review

Review effort: Balanced

Comment thread tck/sandbox/docker_auth.go Resolved
Copilot AI balanced review requested due to automatic review settings November 4, 2026 07:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread tck/sandbox/docker_auth.go Resolved
Comment thread tck/sandbox/docker_auth.go Resolved
Comment thread tck/sandbox/docker_auth.go Resolved
Comment thread tck/sandbox/docker_auth.go Resolved
Comment thread tck/sandbox/docker_auth.go Resolved
Comment thread tck/sandbox/docker_auth.go Resolved
Copilot AI balanced review requested due to automatic review settings November 4, 2026 08:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread tck/sandbox/docker_auth.go Resolved
Comment thread tck/sandbox/docker_auth.go Resolved
Comment thread tck/sandbox/docker_auth.go Resolved
Copilot AI balanced review requested due to automatic review settings November 4, 2026 09:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical authentication-trace gaps can hide create-time credential leakage and let post-expiry replays pass without token renewal.

3 open issues
3 resolved since last review

Review effort: Balanced

Comment thread tck/sandbox/docker_auth.go Resolved
Comment thread tck/sandbox/docker_auth.go Resolved
Comment thread tck/sandbox/docker_auth.go Resolved
Copilot AI balanced review requested due to automatic review settings November 4, 2026 10:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The probes reject valid host-mediated authentication and can falsely pass expired-token replays or network-policy bypasses during credential substitution.

2 open issues
3 resolved since last review

Review effort: Balanced

Comment thread tck/sandbox/docker_auth.go Resolved
@rumpl
rumpl force-pushed the docker-auth branch 2 times, most recently from a23cb77 to 362ef11 Compare November 4, 2026 12:13
Copilot AI balanced review requested due to automatic review settings November 4, 2026 12:13
Copilot AI balanced review requested due to automatic review settings November 4, 2026 13:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The token endpoint lacks a JSON Content-Type, risking rejection by compliant runtimes, and the positive probes can incorrectly accept truncated HTTP responses.

2 open issues
3 resolved since last review

Review effort: Balanced

Comment thread tck/sandbox/docker_auth.go Resolved
Copilot AI balanced review requested due to automatic review settings November 4, 2026 13:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The fixture fails valid Docker identity-token credentials, and the normative specification omits the Docker Hub alias equivalence and duplicate restriction enforced by validation.

2 open issues
2 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 4, 2026 13:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A critical credential-detection gap lets POST-body identity tokens leak off-scope without failing request-scope or withdrawn-credential checks, which inspect only Authorization headers.

1 open issue
2 resolved since last review

Review effort: Balanced

Comment thread tck/sandbox/docker_auth.go Resolved
Copilot AI balanced review requested due to automatic review settings November 4, 2026 13:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The suite lacks an unrequested-registry binding and an overbroad-binding mutation, leaving a critical gap in detecting unauthorized credential access in host-resolution and host-only modes.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread tck/sandbox/docker_auth.go Resolved
Copilot AI balanced review requested due to automatic review settings November 4, 2026 14:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The credential-reuse assertions can mistake permitted background authentication for placeholder substitution, causing nondeterministic conformance failures unless negative-probe traffic is distinguished from background activity.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread tck/sandbox/docker_auth.go Resolved
Copilot AI balanced review requested due to automatic review settings November 4, 2026 14:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical gaps in response-header checks allow credential-bearing URLs and Basic/Bearer credentials to leak while confinement and confidentiality checks still pass.

2 open issues
1 resolved since last review

Review effort: Balanced

Comment thread tck/sandbox/docker_auth.go Resolved
com.docker.sandbox/docker-auth@1 grants registry authentication through
opaque, run-scoped placeholders: real logins and issued tokens stay
outside the sandbox while Docker-compatible clients keep working.

The TCK judges credential confinement by exact-value comparison at the
client interface and in the suite services' independent request traces,
never by scanning probe output, so no output encoding can hide a leak.
Eight runtime checks share one probe and one conforming fake with a
single broken branch per check.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
Copilot AI balanced review requested due to automatic review settings November 4, 2026 14:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The new credential-interception security boundary needs security-owner review and real-runtime validation of credential confinement and run-scoped withdrawal, which the fake-adapter tests cannot establish.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@cdupuis
cdupuis merged commit 6b0bc25 into docker:main Nov 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants