roles/docker/tasks/install.yml:20-26 downloads the Docker GPG key from docker_gpg_url (roles/docker/defaults/main.yml:11-12) with ansible.builtin.get_url and no checksum:. Whatever that URL serves is installed as the keyring that signs the Docker APT source, so a changed or substituted key is trusted silently.
Out of scope: the APT source format and the package list.
Proposal
Follow the tailscale role (roles/tailscale/defaults/main.yml:17-21): a static keyring sha256 input (for example docker_keyring_checksum), with a comment naming the key and saying that a rotated key fails the install until a person has checked the new one and updated the hash, and checksum: "sha256:{{ docker_keyring_checksum }}" on the get_url task. Add the input to meta/argument_specs.yml and the role README, plus a changelog fragment.
Acceptance criteria
The get_url task of the Docker key carries checksum: from a role input; checked by reading roles/docker/tasks/install.yml.
The input has a default (the sha256 of the current key) and is documented in roles/docker/meta/argument_specs.yml and roles/docker/README.md; pre-commit run --all-files passes.
A wrong checksum fails the install task; the docker Molecule scenario passes in CI with the correct one.
A changelog fragment in changelogs/fragments/ describes the new input.
### Problem
`roles/docker/tasks/install.yml:20-26` downloads the Docker GPG key from `docker_gpg_url` (`roles/docker/defaults/main.yml:11-12`) with `ansible.builtin.get_url` and no `checksum:`. Whatever that URL serves is installed as the keyring that signs the Docker APT source, so a changed or substituted key is trusted silently.
Out of scope: the APT source format and the package list.
### Proposal
Follow the `tailscale` role (`roles/tailscale/defaults/main.yml:17-21`): a static keyring sha256 input (for example `docker_keyring_checksum`), with a comment naming the key and saying that a rotated key fails the install until a person has checked the new one and updated the hash, and `checksum: "sha256:{{ docker_keyring_checksum }}"` on the `get_url` task. Add the input to `meta/argument_specs.yml` and the role README, plus a changelog fragment.
### Acceptance criteria
- [ ] The `get_url` task of the Docker key carries `checksum:` from a role input; checked by reading `roles/docker/tasks/install.yml`.
- [ ] The input has a default (the sha256 of the current key) and is documented in `roles/docker/meta/argument_specs.yml` and `roles/docker/README.md`; `pre-commit run --all-files` passes.
- [ ] A wrong checksum fails the install task; the docker Molecule scenario passes in CI with the correct one.
- [ ] A changelog fragment in `changelogs/fragments/` describes the new input.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
roles/docker/tasks/install.yml:20-26downloads the Docker GPG key fromdocker_gpg_url(roles/docker/defaults/main.yml:11-12) withansible.builtin.get_urland nochecksum:. Whatever that URL serves is installed as the keyring that signs the Docker APT source, so a changed or substituted key is trusted silently.Out of scope: the APT source format and the package list.
Proposal
Follow the
tailscalerole (roles/tailscale/defaults/main.yml:17-21): a static keyring sha256 input (for exampledocker_keyring_checksum), with a comment naming the key and saying that a rotated key fails the install until a person has checked the new one and updated the hash, andchecksum: "sha256:{{ docker_keyring_checksum }}"on theget_urltask. Add the input tometa/argument_specs.ymland the role README, plus a changelog fragment.Acceptance criteria
get_urltask of the Docker key carrieschecksum:from a role input; checked by readingroles/docker/tasks/install.yml.roles/docker/meta/argument_specs.ymlandroles/docker/README.md;pre-commit run --all-filespasses.changelogs/fragments/describes the new input.