Repository navigation
feat(spec,tck): add host-only docker registry authentication - #201
Conversation
There was a problem hiding this comment.
🟡 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
There was a problem hiding this comment.
🟡 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
There was a problem hiding this comment.
🟡 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
There was a problem hiding this comment.
🟡 Changes recommended
Critical gaps in hook-observation and cross-field confidentiality checks allow runtimes that expose real credentials to pass the suite.
6 open issues
Compare returned credentials against all protected values · New Check hook observations for credential and token disclosure · New Separate stale-token rejection from expiry authorization checks · New Reject authenticated content after optional credentials are skipped · New Use fresh contexts and persistent issuer failures in expiry probes · New Reject real-credential use in the no-grant baseline · New
4 resolved since last review
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Active issues leave structured error responses insufficiently checked for credential leaks and can reject valid runtime behavior due to token-freshness timing and eager authorization failures.
3 open issues
6 resolved since last review
Check hook observations for credential and token disclosure Compare returned credentials against all protected values Reject real-credential use in the no-grant baseline Use fresh contexts and persistent issuer failures in expiry probes Reject authenticated content after optional credentials are skipped Separate stale-token rejection from expiry authorization checks
Review effort: Balanced
a23cb77 to
362ef11
Compare
There was a problem hiding this comment.
🟡 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
There was a problem hiding this comment.
🟡 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
There was a problem hiding this comment.
🟡 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
There was a problem hiding this comment.
🟡 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
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>
There was a problem hiding this comment.
🔵 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



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:
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
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 recordsrequest-scope— the real login appears only on the admitted HTTPS token exchangehost-only— clients resolve usable placeholders, never the real logintoken-mediation— client-visible token fields are placeholders; failed exchanges fail closedbearer-scope— substitution confined to the admitted HTTPS registry API; unknown placeholders rejectedredirect-confinement— signed download URLs stay host-side; client-visible locations remain usablelifetime— authentication available in install/startup hooks; run-local placeholders withdrawn when the run endsno-extra-access— no egress, socket or engine from the grant aloneConfinement 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-validis covered bydescriptor-valid;source-privateis waived following thegit-identity@1/source-privateprecedent.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.