Pass license arguments to the VM's Ruby as string literals

Cause

cmd_license spliced the activation code and the add-on name into the Ruby that gitlab-rails runner runs on the VM. A quote or a Ruby BEGIN block in either ran at parse time, before any check. !107 (merged) moved the add-on lookup to ruby_str; the activation call and the add-on messages still interpolated the raw text. bootstrap-gitlab-omnibus.sh spliced SIM_ROOT_PASSWORD into its runner script the same way.

Sites fixed

  • skills/gitlab-simulation/gce/simulation.sh, cmd_license: ActivateService.new.execute(...) now takes a ruby_str literal.
  • skills/gitlab-simulation/gce/simulation.sh, cmd_license: the two add-on messages (NO instance-wide ..., no ... purchase was provisioned) read a Ruby local addon_name built from ruby_str.
  • skills/gitlab-simulation/gce/bootstrap-gitlab-omnibus.sh: password: and password_confirmation: in the root-user runner script take a base64 unpack1 literal built the same way.

A grep of the engine for other caller-derived text inside gitlab_rails, gitlab_rails_raw, gitlab_rails_file and gitlab-rails runner scripts found no further site. The remaining interpolations are constants or values read from the VM (svc_host, the Geo IPs and token, repo_name, the register_runner tags).

Tests

engine-selftest.sh captures the runner script cmd_license would send, runs it in local Ruby against stub classes, and asserts that a canary file is not created and that the value reaches the primitive byte for byte. It covers three values per slot (code and add-on), two of them breakout payloads. bootstrap-omnibus-selftest.sh does the same for the root password.

Check origin/main this branch
engine-selftest.sh, licence section 6 checks fail (the code canary is created for the breakout, the add-on canary for its breakout, four round-trips differ) all 12 pass; suite passes
bootstrap-omnibus-selftest.sh, root password 3 checks fail (canary created, two round-trips differ) all 4 pass; suite passes

Fixtures use FAKE-ACTIVATION-CODE-0000; no real code appears anywhere. skill-scan passes with scan-accept.yml unchanged; shellcheck -S warning is clean on the four scripts; word-budget adds no skill prose.

Merge request reports

Loading
Loading