Repository navigation
Converge the HashiCorp APT key before apt_update (development) - #304
Merged
Merged
Conversation
HashiCorp rotated its package signing key on 2026-09-09 (HCSEC-2026-33) with no overlap and no cross-signature. Terraformers seeded with the old key by cloud-init fail apt_update in stage init, which skips all of stage main. profile::hashicorp_repo re-fetches the key from apt.releases.hashicorp.com on every run, in stage init and before Class['apt::update'], so a rotation heals on the next Puppet run. Development environment only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
infrahouse8
approved these changes
Oct 3, 2026
akuzminsky
added a commit
that referenced
this pull request
Oct 3, 2026
…oduction) (#305) Straight promotion of #304, proven end to end by infrahouse/terraform-aws-terraformer#42: with the module no longer seeding the HashiCorp repository, a development-environment terraformer got Terraform from apt.releases.hashicorp.com via profile::hashicorp_repo. All three copies of hashicorp_repo.pp, converge-apt-keyring.sh and terraformer.pp are now identical. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 1 of 3 for the HashiCorp signing-key rotation. Development environment only.
environments/developmentonly.DEB-GPG-KEY-hashicorpand theextra_reposentry. Its CI runs againstenvironment = "development", so a green test proves this change.modules/(production).Why
HashiCorp rotated its Linux package signing key on 2026-09-09 (HCSEC-2026-33),
AA16FCBCA621E701toFC9CA96ACA026560. There was no notice, no overlap period, and the old key does not sign the new one.InReleaseis now signed by the new key only.terraform-aws-terraformer bundles the 2023 key and cloud-init seeds it, so every terraformer fails:
apt_updateruns in stageiniton every run, and when it fails all of stagemainis skipped, including anything there that could have fixed the key. A pinned key cannot survive an emergency rotation like this one, so trust has to move to TLS on the key URL. That is what HashiCorp's own install instructions do, and it is whatprofile::infrahouse_repoalready does for our own key.What changed
profile::hashicorp_repo(new), declared byprofile::terraformerwithstage => initand orderedbefore => Class['apt::update']:/etc/apt/keyrings/hashicorp.gpgfromhttps://apt.releases.hashicorp.com/gpgon every run/etc/apt/sources.list.d/hashicorp.list. That is the file cloud-init'sextra_reposseed writes (verified incc_apt_configure.add_apt_sources) and the path HashiCorp's docs use. Rewriting it avoids a second line with a differentsigned-by, which apt rejects with "Conflicting values set for option Signed-By"/etc/apt/cloud-init.gpg.d/hashicorp.gpgconverge-apt-keyring.sh(new) works likeconverge-infrahouse-keyring.sh, but takes the URL and keyring path as arguments, with two behaviour differences:apt_update, so failing would skip the whole run over a HashiCorp outage the existing key may well survive. With no keyring installed it fails.logoutput => true;checkkeeps steady state silent), so a rotation is visible in the Puppet log.--proto =https --proto-redir =https, since trust is anchored on TLS. The fetched key must parse as an OpenPGP public key.Verification
puppet-lint --fail-on-warningsandshellcheckare clean.The script was run through 12 cases in
ubuntu:noble. All behaved as intended:D55C…6560)http://, no keyringPuppet 8.4.0 + puppetlabs-apt 9.4.0 in
ubuntu:noble, with a wrapper shaped likeprofile::terraformer. The container was seeded with cloud-init's 3.x state (old key at/etc/apt/cloud-init.gpg.d/hashicorp.gpg), andapt-get updateexited 100. One Puppet run then healed it:Afterwards
apt-get updateexited 0. A second run touched no HashiCorp resources. A fresh container with no seed (the phase 2 state) gave the same result.The container used a wrapper, not the full role. The end-to-end proof is phase 2's CI run.
Not covered
init, so they need the key fixed by hand once (or replacement) before this can reach them.profile::infrahouse_repoconverges in stagemain, so it has the same blind spot for our own key: an expired or non-overlapping rotation of the InfraHouse key would wedge the same way (see the skipped converge above). Separate follow-up.🤖 Generated with Claude Code