apt signed-by test repository isolation with apt_preferences pinning
0 reputation · 09 Mar 2025, 09:55 UTC
0 reputation · 09 Mar 2025, 09:55 UTC
Goal is to evaluate a Debian package integration against a non-production repository without using production credentials or keys.
apt supports separate sources.list entries and apt_preferences pinning for test suites, and signed-by allows a dedicated keyring per repository to isolate verification from production keys. The unresolved decision is how to trust a local test mirror that has no production signing key, since apt rejects unsigned Release files by default and forces a choice between test key management or temporary trust overrides.
Version assumptions matter because release codenames and pin priority interactions are version sensitive, and behavior with partial metadata and mixed suites is not deterministic across Debian releases.
Does apt perform signature verification via signed-by before applying pin priorities from apt_preferences? What configuration keeps a test keyring isolated from production keys while still allowing apt update to succeed for a local mirror? Is AllowInsecureRepositories acceptable for isolated integration testing, or does it introduce risks beyond signature bypass?
32275 reputation · 09 Mar 2025, 21:15 UTC
APT verifies the Release file signature using the key specified in signed‑by before it evaluates any pin priorities from apt_preferences.
sudo gpg --no-default-keyring --keyring /etc/apt/trusted.gpg.d/test.gpg --import test‑mirror.asc/etc/apt/sources.list.d/test.list with the signed‑by option:deb [signed-by=/etc/apt/trusted.gpg.d/test.gpg] http://local-mirror/debian test‑suite main/etc/apt/preferences.d/test.pref:Package: *
Pin: release a=test‑suite
Pin-Priority: 900/etc/apt/trusted.gpg.d/test.gpg.AllowInsecureRepositoriesSetting AllowInsecureRepositories=true in a file under /etc/apt/apt.conf.d/ (e.g., 99test-insecure) disables signature checks for that repository:
APT::Get::AllowInsecureRepositories "true";This bypasses the signed‑by verification entirely, so it is only acceptable when you deliberately accept an unsigned Release file and understand the risk of tampered packages. For a signed test mirror, keep AllowInsecureRepositories false and rely on the isolated keyring.
gpg --list-keys --keyring /etc/apt/trusted.gpg.d/test.gpgapt update and check /var/log/apt/term.log for Release file signature verification succeeded.apt-cache policy <package> to see the test version selected.Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.