Skip to content

[release-0.2] feat(systemtest): fetch sentinel settings via SETTINGS_URL; resolve test secrets guest-side from Vault - #662

Open
Lorquas wants to merge 1 commit into
release-0.2from
cct-3159/backport-release-0.2
Open

Lorquas wants to merge 1 commit into
release-0.2from
cct-3159/backport-release-0.2

Conversation

@Lorquas

@Lorquas Lorquas commented Nov 20, 2026

Copy link
Copy Markdown
Member

Cherry pick of PR #656 (commit 6347f18) to release-0.2, part of the CCT-3155 credential-migration epic (CCT-3159).

Switch the integration tests to guest-side Vault credential resolution: the settings file served from SETTINGS_URL carries every credential as an @vault: sentinel, pytest-client-tools resolves each sentinel at config load inside the test guest, and the guest authenticates to Vault with rhc's own AppRole — replacing Jenkins-side credential injection.

  • .testing-farm.yaml: SETTINGS_URL, VAULT_ADDR, VAULT_ROLE_ID and VAULT_SECRET_ID as encrypted Testing Farm secrets in the flat environments.secrets form, each bound to the team, OSCI and Packit tokens so team, gating and internal-ranch runs all receive them (byte-identical to the main-branch version — the ciphertexts bind to the repository and token, not the branch)
  • .packit.yml (this branch's packit config): deliver REQUESTS_CA_BUNDLE to the internal-ranch unit/rhel job via tf_extra_params so Packit-submitted guests trust the internal root CA; the public-ranch job deliberately receives no Testing Farm secrets
  • systemtest/tests/integration/test.sh: export PYTEST_CLIENT_TOOLS_VAULT_REQUIRED=1 alongside the download so an unresolved sentinel fails loud at config load; the ENV_FOR_DYNACONF=testing fallback (manual runs only) keeps tracing suppressed around the container credentials
  • integration-tests/requirements.txt: pin dynaconf>=3.2.13,<4 for python >= 3.8 (CVE-2026-33154); environment markers keep python-3.6 EL8 guests on the 3.1.x line
  • .gitignore: the downloaded settings.toml, its .bak and .secrets.toml

Adapted to the branch: TESTING.md and the main-only GitHub workflows do not exist on release-0.2; the test.sh comment points to the CCT credentials how-to on the QE wiki instead.

(cherry picked from commit 6347f18)

… via env vars

Backport of the credential-migration change (#656) to release-0.2,
adapted to the branch's older codebase:

- .testing-farm.yaml carries the four secrets (SETTINGS_URL, VAULT_ADDR,
  VAULT_ROLE_ID, VAULT_SECRET_ID) in the flat environments.secrets form
  required by Testing Farm's InRepoConfig parser (a nested
  environments.default.secrets map is silently ignored), three blobs per
  secret (cct-ci, OSCI, Packit Production) so one of the three tokens
  receives the four values and any other token receives none. The file
  is byte-identical to the main-branch version: the ciphertexts are
  bound to the repository and token, not the branch, so the same blobs
  work here. Rotation stays the manual rotate-tf-secrets.sh script plus
  a reviewed PR (CCT credentials how-to on the QE wiki); no secret
  values in comments.
- systemtest/tests/integration/test.sh re-asserts the marked dynaconf
  floor, exports PYTEST_CLIENT_TOOLS_VAULT_REQUIRED=1 on SETTINGS_URL
  runs (strict mode: an unresolved @vault: sentinel fails loudly at
  config load instead of degrading into a skipped run), and falls back
  to the well-known container candlepin credentials when
  ENV_FOR_DYNACONF=testing so the sanitized settings file passes the
  pytest-client-tools validator, with tracing suppressed around the
  fallback so an operator-supplied password never reaches the logs.
- integration-tests/requirements.txt pins dynaconf>=3.2.13,<4 for
  python >= 3.8 (CVE-2026-33154, SSTI in the @Jinja resolver, fixed in
  3.2.13; 4.0 deferred, CCT-3167) and keeps python-3.6 EL8 guests on
  dynaconf>=3.1.5,<3.2 (the branch had no pin; same floor logic as
  main). test.sh re-asserts the same marked floor.
- .gitignore ignores *settings.toml* and *secrets.toml* again (the
  globs reached main through earlier commits of this epic; the branch
  never had them, so both are added here with the explanatory comment).
- .packit.yml (this branch's packit config; main uses .packit.yaml):
  the internal-ranch unit/rhel job's tf_extra_params.environments
  gains the non-secret REQUESTS_CA_BUNDLE OS trust-bundle variable
  (/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem) so
  Packit-submitted guests complete the TLS handshake with
  vault.corp.redhat.com. The branch already used the list form the
  packit-service merge requires, so only the variables mapping is
  added.

Consciously dropped from the cherry-pick (no counterpart on this
branch):
- TESTING.md does not exist on release-0.2 (added on main after the
  branch point); its documentation changes are not carried over, and
  the test.sh comment points to the CCT credentials how-to on the QE
  wiki instead.
- .github/workflows/integration-tests.yml and rpmbuild.yml do not
  exist on release-0.2, so the golang 1.27.3 candlepin ML-DSA TLS
  workaround is not applicable.
- .packit.yaml is named .packit.yml here; the change was ported as
  described above.

(cherry picked from commit 36078d2)

Assisted-by: OpenCode (GLM)
Ref: CCT-3159
Signed-off-by: James Molet <jmolet@redhat.com>
@Lorquas
Lorquas marked this pull request as ready for review November 20, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant