Skip to content

CAT-2962: floor puppet gem version in Gemfile - #397

Open
LukasAud wants to merge 2 commits into
mainfrom
cat-2962-puppet-gemfile-floor
Open

LukasAud wants to merge 2 commits into
mainfrom
cat-2962-puppet-gemfile-floor

Conversation

@LukasAud

@LukasAud LukasAud commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Resolves CAT-2962 (CVE-2026-115731, critical): gemsource_puppetcore previously only routed to the internal, maintained mirror (rubygems-puppetcore.puppet.com) when PUPPET_GEM_VERSION matched ~> 9 and a forge token was present. Every Puppet 8 lane (the common case) fell through to public rubygems.org, which is stuck at puppet 8.10.0 and carries this CVE.
  • Flips the default per the pattern already established in pdk-templates (ADR 0001/0002): gemsource_puppetcore now defaults to the internal puppetcore mirror, with an explicit, persisted opt-out (bundle config set gemsource.public true) rather than silently falling back to public gems. Also warns when no puppetcore credentials are detected, mirroring the same precedent, with gemsource.airgapped / gemsource.public as escape hatches.
  • main only for now; 1.9.x is a separate maintenance line and out of scope for this PR.
  • Verified the CVE is actually closed: puppet 8.22.3 and 9.1.4 (both above the CVE-2026-115731 fix threshold) resolve cleanly from puppetcore across all 4 Linux CI lanes and the Windows Puppet 9 lane.

Known, pre-existing issue surfaced by this fix (not introduced by it)

Windows, Puppet 8, Ruby 3.2 now fails at bundle exec with Bundler::GemNotFound: Could not find gem 'puppet (~> 8)' in locally installed gems, even though bundle install succeeds. Root cause, confirmed by inspecting the generated Gemfile.lock directly in CI: puppet 8.22.3's own gemspec (not ours) still declares a runtime dependency on puppet-resource_api (~> 1.9), which conflicts with main's current version (2.1.0) — unsatisfiable. This is the exact same upstream gemspec bug already filed with the PA team during CAT-2840 (puppet.gemspec requires puppet-resource_api ~> 1.9, but Agent ships/pins a 2.x release), just resurfacing on the Puppet 8 side instead of Puppet 9.

bundle install's initial resolve is lenient and doesn't catch this; bundle exec's stricter dependency-graph validation does, but only under a reasonably modern Bundler — confirmed reproducing identically on both Bundler 2.6.9 and 4.1.0. Linux's CI lane uses whatever (older) Bundler ships baked into that Ruby 3.2.11 build, which doesn't perform this validation as strictly, so it silently resolves the same conflicting pair without complaint. This is not fixable at the Gemfile/CI-config level — it needs either the PA gemspec fix extended to the 8.x line, or an explicit call that main shouldn't be CI-tested against Puppet 8 at all (matching the existing understanding that Puppet 8 Agent consumes the separate 1.9.x branch, not main).

Marked continue-on-error for just that one matrix entry (Windows + Puppet 8) with a comment referencing CAT-2840, so this known, tracked, upstream issue doesn't block the CVE fix from merging.

Test plan

  • bundle install with no env vars set resolves puppet from the puppetcore mirror, not public rubygems.org
  • bundle config set gemsource.public true still resolves from public rubygems.org
  • CI passes on all lanes except the known, tracked Windows+Puppet-8 issue above

@LukasAud
LukasAud requested review from a team as code owners November 23, 2026 15:09
@LukasAud LukasAud added the maintenance Maintenance (PDK sync and other maintaining commits) label Nov 23, 2026
LukasAud and others added 2 commits November 24, 2026 15:00
gemsource_puppetcore previously only routed to the internal mirror for
a Puppet 9 + forge-token run; every Puppet 8 lane fell through to
public rubygems.org, which is stuck at puppet 8.10.0 (CVE-2026-115731).
Flips the default per the pattern already established in pdk-templates
(ADR 0001/0002): puppetcore by default, public gems as an explicit,
persisted opt-out.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Known upstream gemspec bug (CAT-2840): puppet 8.x pins
puppet-resource_api ~> 1.9, which main (2.x) can't satisfy. bundle
install resolves it leniently; bundle exec's stricter validation
correctly rejects it under any reasonably modern Bundler. Linux
tolerates the same conflict only because its CI lane uses an older,
less strict Bundler baked into that Ruby build.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@LukasAud
LukasAud force-pushed the cat-2962-puppet-gemfile-floor branch from 579d6d4 to f7853d8 Compare November 24, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Maintenance (PDK sync and other maintaining commits)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant