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

The key that signs the Docker repository was trusted as whatever the URL served. It is now checked
against a pinned sha256, so a changed key stops the install until a person has verified it.

Assisted-by: Claude Code
This commit is contained in:
Defame1297 committed 2026-11-27 22:09:56 +00:00
1 parent b3b62121a3
commit c7c38c6bc0
8 files changed
+78 -2

No files matched your search

@@ -7,6 +7,8 @@
hosts: all
vars:
docker_gpg_url: file:///srv/docker-stub-repo/docker.asc
# The stand-in key is generated per run, so its hash is read here rather than pinned.
docker_keyring_checksum: "{{ docker_stub_key.stat.checksum }}"
docker_repo_base_url: file:///srv/docker-stub-repo
docker_users: [moleculeuser]
docker_start_missed: true
@@ -18,5 +20,11 @@
docker_log_max_file: "3"
docker_daemon_options:
max-concurrent-downloads: 3
pre_tasks:
- name: Stat the stand-in repository key
ansible.builtin.stat:
path: /srv/docker-stub-repo/docker.asc
checksum_algorithm: sha256
register: docker_stub_key
roles:
- role: mortis.kamino.docker