Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
161 changes: 161 additions & 0 deletions content/reference/post-quantum-cryptography.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
---
title: Post-quantum cryptography at Docker
linkTitle: Post-quantum cryptography
description: >-
See which Docker products and endpoints support hybrid post-quantum key
exchange, and check the connections and images you depend on.
keywords: post-quantum cryptography, PQC, hybrid key exchange, X25519MLKEM768,
ML-KEM, TLS, OpenSSL 3.5, Docker Hardened Images, Docker Hub, Docker
Sandboxes, quantum-safe
weight: 50
---

This page lists hybrid post-quantum key exchange support for Docker endpoints,
Docker Sandboxes, and Docker Hardened Images, and shows how to check the
connections and images you depend on.

Docker is extending hybrid key exchange to the remaining endpoints and to
Comment thread
craig-osterhout marked this conversation as resolved.
Resolved
Docker Hardened Images FIPS variants. For details, see
[Docker and the move to post-quantum cryptography](https://www.docker.com/blog/docker-and-the-move-to-post-quantum-cryptography/).

## Hybrid key exchange

Hybrid key exchange on this page means the `X25519MLKEM768` TLS 1.3 key
exchange group, defined in
[RFC 10024](https://www.rfc-editor.org/rfc/rfc10024.html).

Hybrid key exchange applies only when both ends of a connection support it.
If either end doesn't, the connection uses classical key exchange.

## Docker endpoints

These are the services your clients connect to. An endpoint that supports
hybrid key exchange uses it when your client offers it.

| Endpoint | Hybrid key exchange |
| --- | --- |
| Docker Desktop and Docker Engine downloads | Supported |
| Docker Hardened Images registry (`dhi.io`) | Supported |
| Docker Hub image pulls (`docker.io`), including Docker Official Images | Not supported |
| Docker Hub web application (`hub.docker.com`) | Supported |
| Docker Sandboxes cloud API and hosted MCP gateway | Supported |
| Docker Sandboxes cloud scheduling service | Not supported |
| Docker sign-in (`login.docker.com`) | Supported |

## Docker Sandboxes

Docker Sandboxes (`sbx`) offers hybrid key exchange by default on the
connections its CLI and daemon make. The
[`tls.postQuantumKeyExchange`](/manuals/ai/sandboxes/configuration/settings.md#tlspostquantumkeyexchange)
setting controls it.

## Docker Hardened Images

Applications in an image use hybrid key exchange only when their TLS library
supports it and the other end supports it.

| Image | Hybrid key exchange | Details |
| --- | --- | --- |
| Images on Debian 13, or Alpine 3.22 or later | Offered by default | These images ship OpenSSL 3.5 or later. Applications that use the system OpenSSL offer hybrid key exchange. |
| FIPS variants | Not offered | FIPS variants use the validated OpenSSL 3.1.2 FIPS provider, which doesn't support hybrid key exchange. |

## Check a connection

Use OpenSSL 3.5 or later to test whether an endpoint accepts hybrid key
exchange. Check your local version first:

```console
$ openssl version
```

Then require TLS 1.3 and offer only the hybrid group, so the handshake fails
if the server doesn't support it:

```console
$ openssl s_client -tls1_3 -connect hub.docker.com:443 \
-servername hub.docker.com \
-groups X25519MLKEM768 </dev/null 2>&1 \
| grep "Negotiated TLS1.3 group"
```

If the endpoint supports hybrid key exchange, the output shows:

```text
Negotiated TLS1.3 group: X25519MLKEM768
```

If it doesn't, the handshake fails with an alert, such as
`handshake failure` or `protocol version`, and the group shows as `<NULL>`.

Replace `hub.docker.com` with any endpoint you want to test, such as
`dhi.io`, `login.docker.com`, or one of your own services.

## Check an image

Images can include different TLS libraries and language runtimes, so no
single command covers every image. Check the following, in order:

1. Find the TLS libraries and runtimes in the image.
1. Compare their versions with the versions that support hybrid key exchange.
1. Test a running service directly, if the image runs a TLS server.

### Find the TLS libraries in the image

List the packages in the image SBOM with
[Docker Scout](/manuals/scout/how-tos/view-create-sboms.md) and filter for
common TLS libraries and runtimes:

```console
$ docker scout sbom --format list <image> | grep -iE "openssl|libssl|gnutls|boringssl|golang|stdlib|node|python|openjdk"
```

For Docker Hardened Images, the system OpenSSL already supports hybrid key
exchange, except in FIPS variants. See
[Docker Hardened Images](#docker-hardened-images). Use the SBOM to find
runtimes and applications that bundle their own TLS library. See
[Software Bill of Materials](/manuals/dhi/explore/security-concepts/sbom.md).

### Compare versions

Hybrid key exchange depends on the library or runtime that makes the TLS
connection, not on the image as a whole. Look up the component the
application uses:

| Component | Hybrid key exchange |
| --- | --- |
| OpenSSL | Offered by default in 3.5 and later |
| OpenSSL FIPS provider 3.1.2 | Not offered |
| Go standard library (`crypto/tls`) | Offered by default in 1.24 and later |
| Other libraries and runtimes | Check the vendor documentation |

An application can bundle its own TLS library instead of using the system
OpenSSL. For example, Go programs use the Go standard library
(`crypto/tls`).

If the image includes these tools, you can also ask the runtime directly:

```console
$ docker run --rm --entrypoint openssl <image> version
$ docker run --rm --entrypoint python3 <image> -c "import ssl; print(ssl.OPENSSL_VERSION)"
$ docker run --rm --entrypoint node <image> -p process.versions.openssl
```

Docker Hardened Images runtime images don't include a shell or other
non-essential components. Use the SBOM for those images instead.

### Test a running service

If the image runs a TLS server, start it and test the port with the same
OpenSSL command used in [Check a connection](#check-a-connection):

```console
$ docker run -d --name tls-test -p 8443:<container-port> <image>
$ openssl s_client -tls1_3 -connect localhost:8443 -groups X25519MLKEM768 </dev/null 2>&1 | grep "Negotiated TLS1.3 group"
$ docker rm -f tls-test
```

The test also depends on the server configuration. A server can restrict its
TLS groups even when its library supports hybrid key exchange.

To keep TLS libraries current, use current Docker Hardened Images (Debian 13,
or Alpine 3.22 or later) and rebuild regularly.
2 changes: 1 addition & 1 deletion data/navigation/products.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"label": "Security",
"root": "/manuals/security",
"category": "admin",
"references": []
"references": ["/reference/post-quantum-cryptography"]
},
"faqs": {
"label": "FAQs",
Expand Down
5 changes: 5 additions & 0 deletions data/navigation/references.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,10 @@
{
"label": "docker model",
"root": "/reference/cli/docker/model"
},
{
"label": "Post-quantum cryptography",
"root": "/reference/post-quantum-cryptography",
"group": "security"
}
]
4 changes: 4 additions & 0 deletions layouts/_partials/reference-directory/groups.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(dict "id" "cli" "title" "CLI references" "icon" "terminal")
(dict "id" "api" "title" "APIs" "icon" "code")
(dict "id" "formats" "title" "File formats and build checks" "icon" "file-text")
(dict "id" "security" "title" "Security" "icon" "shield-check")
-}}
{{- $group := . -}}
{{- $items := slice -}}
Expand All @@ -16,6 +17,9 @@
{{- else if strings.HasPrefix .root "/reference/api/" -}}
{{- $kind = "api" -}}
{{- end -}}
{{- with .group -}}
{{- $kind = . -}}
{{- end -}}
{{- if eq $kind $group.id -}}
{{- $root := .root -}}
{{- $label := .label -}}
Expand Down