feat(docker): pin the Docker apt key by checksum #454

Merged
Defame1297 merged 2 commits from feat/448-docker-keyring-checksum into main 2026-11-28 08:22:24 +00:00
4 changed files with 6 additions and 4 deletions
Showing only changes of commit a185a301db - Show all commits

No files matched your search

@@ -3,3 +3,4 @@ minor_changes:
- >-
docker - New input ``docker_keyring_checksum``: the Docker APT key is verified against a pinned
sha256, and a changed key fails the install until a person has checked it and updated the hash.
Set ``docker_keyring_checksum`` too when ``docker_gpg_url`` is overridden.
+1 -1
View File
@@ -27,7 +27,7 @@ The role targets Ubuntu hosts only: it installs from Docker's Ubuntu repository,
| `docker_keyring_path` | `/etc/apt/keyrings/docker.asc` | no | Repository key location. |
| `docker_apt_list_path` | `/etc/apt/sources.list.d/docker.list` | no | APT source file. |
| `docker_gpg_url` | `https://download.docker.com/linux/ubuntu/gpg` | no | Key URL. |
| `docker_keyring_checksum` | sha256 of the current Docker key | no | Expected sha256 of the key at `docker_gpg_url`; a mismatch fails the download, so a changed key stops the install until this is updated. |
| `docker_keyring_checksum` | sha256 of the current Docker key | no | Expected sha256 (hex, no `sha256:` prefix) of the key at `docker_gpg_url`; set it too when `docker_gpg_url` is overridden; a mismatch fails the download, so a changed key stops the install until this is updated. |
| `docker_repo_base_url` | `https://download.docker.com/linux/ubuntu` | no | Repository base URL. |
| `docker_apt_arch` | derived from the host | no | Architecture in the APT source. Empty derives it (`x86_64` gives `amd64`, `aarch64` gives `arm64`); another architecture fails until this is set. A value set here is always used; lowercase letters and digits only. |
| `docker_start_missed` | `false` | no | Install a boot unit that starts the containers Docker skipped after a reboot (see [Boot and shutdown units](#boot-and-shutdown-units)). |
+3 -2
View File
@@ -54,8 +54,9 @@ argument_specs:
default: 1500c1f56fa9e26b9b8f42452a553675796ade0807cdce11975eb98170b3a570
description:
- >-
sha256 (hex) of the key at C(docker_gpg_url). The download fails on a mismatch, so a rotated or re-armored
upstream key stops the install until the new key is checked and the hash updated.
sha256 of the key at C(docker_gpg_url), as the hex digest without the C(sha256:) prefix. The download fails
on a mismatch, so a rotated or re-armored upstream key stops the install until the new key is checked and
the hash updated. Set C(docker_keyring_checksum) too when C(docker_gpg_url) is overridden.
docker_repo_base_url:
type: str
default: https://download.docker.com/linux/ubuntu
+1 -1
View File
@@ -434,7 +434,7 @@
- (docker_verify_daemon_after.content | b64decode | from_json)['max-concurrent-downloads'] == 6
quiet: true
# A key that does not match docker_keyring_checksum fails its download before the source line is touched. It goes to a separate path, so
# A key that does not match docker_keyring_checksum fails at the key download, so the source line and packages are untouched. It goes to a separate path, so
# the installed key stays for the removal below.
- name: A key that does not match the pinned checksum is refused
hosts: all