From 09062e764a3beef031be4dde3912adcfa062ac7f Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 17 Nov 2026 18:42:01 -0800 Subject: [PATCH] Fix security finding acf_3aad8b1ad3a40bbd54a7221c5c2d5a61 --- docs/configuration.md | 3 +++ docs/variables.md | 1 + roles/digital/unipager/README.md | 15 +++++++++++++-- roles/digital/unipager/defaults/main.yml | 3 +++ roles/digital/unipager/tasks/main.yml | 11 +++++++++++ 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index babfd62..e81cc38 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -884,6 +884,9 @@ The current role set also includes `digital/multimon-ng`, `digital/unipager`, The managed multimon-ng service runs as the dedicated `hamstack_multimon_ng_user` account, and JS8Call AppImages are verified against `hamstack_js8call_x86_64_checksum` / `hamstack_js8call_aarch64_checksum`. +UniPager installation requires an independently verified +`hamstack_unipager_repo_key_checksum`; the role checks the downloaded key +before configuring it as APT's repository trust anchor. Downloaded packages and executables must come from HTTPS URLs. AREDN integration is read-only monitoring of existing AREDN nodes rather than firmware/configuration ownership. diff --git a/docs/variables.md b/docs/variables.md index e1ebb2d..3f0c211 100644 --- a/docs/variables.md +++ b/docs/variables.md @@ -311,6 +311,7 @@ This is the exhaustive index of `hamstack_*` variables currently declared by the | `hamstack_unipager_autostart` | `false` | Enable/start the managed service or desktop autostart entry. | | `hamstack_unipager_enabled` | `false` | Enable the digital/unipager role/capability. | | `hamstack_unipager_install` | `true` | Allow HamStack to install the upstream software. | +| `hamstack_unipager_repo_key_checksum` | `` | Configuration value for unipager repo key checksum; see the digital/unipager role README for operational context. | | `hamstack_unipager_repo_key_url` | `https://hampager.de/debian/rwth-afu.key` | Configuration value for unipager repo key url; see the digital/unipager role README for operational context. | | `hamstack_unipager_repo_suite` | `unipager` | Configuration value for unipager repo suite; see the digital/unipager role README for operational context. | | `hamstack_unipager_repo_url` | `https://hampager.de/debian` | Configuration value for unipager repo url; see the digital/unipager role README for operational context. | diff --git a/roles/digital/unipager/README.md b/roles/digital/unipager/README.md index 8c765bb..7c86d1f 100644 --- a/roles/digital/unipager/README.md +++ b/roles/digital/unipager/README.md @@ -12,13 +12,24 @@ enabling/installing this role does not intentionally leave the pager transmitter controller running. The operator must explicitly opt in after the hardware and RF configuration are understood. +## Repository trust + +UniPager installation is fail-closed until +`hamstack_unipager_repo_key_checksum` is set to the independently verified +SHA-256 digest of the repository signing key, in `sha256:<64-hex-digest>` +form. Do not derive the checksum from `hamstack_unipager_repo_key_url` during +the playbook run: the checksum is the trust anchor that prevents that origin +from substituting both a signing key and packages. A key rotation requires an +explicit reviewed checksum update. + ## Current upstream packaging status HamStack points at the currently documented `https://hampager.de/debian` repository and key. On Ubuntu 26.04, APT rejects that repository because the upstream signing key is expired (`EXPKEYSIG 275E586934BE1547`). HamStack intentionally does **not** mark the repository trusted or allow unauthenticated -packages to bypass that failure. Fresh installs remain upstream-blocked until a -valid signing key/repository signature is published. +packages to bypass that failure. No digest is shipped for the expired key, so +fresh installs remain upstream-blocked until a valid signing key/repository +signature is published and its digest is independently reviewed. Upstream: https://github.com/rwth-afu/UniPager diff --git a/roles/digital/unipager/defaults/main.yml b/roles/digital/unipager/defaults/main.yml index f9efc58..22877be 100644 --- a/roles/digital/unipager/defaults/main.yml +++ b/roles/digital/unipager/defaults/main.yml @@ -3,6 +3,9 @@ hamstack_unipager_enabled: false hamstack_unipager_install: true hamstack_unipager_repo_url: https://hampager.de/debian hamstack_unipager_repo_key_url: https://hampager.de/debian/rwth-afu.key +# Required sha256: trust anchor for the repository key. Verify it +# independently of hamstack_unipager_repo_key_url before enabling installation. +hamstack_unipager_repo_key_checksum: '' hamstack_unipager_repo_suite: unipager hamstack_unipager_autostart: false hamstack_unipager_service: unipager diff --git a/roles/digital/unipager/tasks/main.yml b/roles/digital/unipager/tasks/main.yml index 239de9d..8ad840d 100644 --- a/roles/digital/unipager/tasks/main.yml +++ b/roles/digital/unipager/tasks/main.yml @@ -8,6 +8,16 @@ - ansible_facts['os_family'] == 'Debian' fail_msg: UniPager installation supports Debian/Raspbian family systems. + - name: Validate UniPager repository trust anchor + ansible.builtin.assert: + that: + - hamstack_unipager_repo_key_checksum is match('^sha256:[0-9A-Fa-f]{64}$') + fail_msg: >- + UniPager installation requires + hamstack_unipager_repo_key_checksum=sha256:<64-hex-digest>, verified + independently of hamstack_unipager_repo_key_url. + when: hamstack_unipager_install | bool + - name: Install UniPager repository prerequisites ansible.builtin.apt: name: @@ -23,6 +33,7 @@ ansible.builtin.get_url: url: "{{ hamstack_unipager_repo_key_url }}" dest: /usr/share/keyrings/unipager.asc + checksum: "{{ hamstack_unipager_repo_key_checksum }}" mode: '0644' when: hamstack_unipager_install | bool