Skip to content

[release-4.19] [pkg] Add TOFU host key validation - #4563

Open
wgahnagl wants to merge 1 commit into
openshift:release-4.19from
wgahnagl:backport-tofu-4.19
Open

[release-4.19] [pkg] Add TOFU host key validation#4563
wgahnagl wants to merge 1 commit into
openshift:release-4.19from
wgahnagl:backport-tofu-4.19

Conversation

@wgahnagl

@wgahnagl wgahnagl commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Implements SSH host key validation using Trust On First Use (TOFU) pinning to Windows nodes.

Storage strategy:

  • Node annotation (preferred): When Node object exists
  • ConfigMap fallback: By address when Node doesn't exist (BYOH bootstrap)
  • Automatic migration: ConfigMap → Node annotation with cleanup

SSH host key validation tests

Test 1 & 2: testSSHHostKeyAnnotations

  • Verifies ssh-host-key and ssh-host-key-type annotations exist on all nodes
  • Validates annotation contains valid base64-encoded SSH public key
  • Re-fetches node to verify key stability (not regenerated on reconcile)

Test 3: testSSHHostKeysConfigMapCleanup

  • Verifies windows-ssh-host-keys ConfigMap has no stale entries
  • Confirms keys migrate from ConfigMap to Node annotations with cleanup

Test 4: testReAddInstance (extended)

  • Captures host key before BYOH instance removal
  • Verifies same key persists after re-add (validates TOFU property)

Backport of #4212

Implements SSH host key validation using Trust On First Use (TOFU) pinning
to Windows nodes.

Storage strategy:
- Node annotation (preferred): When Node object exists
- ConfigMap fallback: By address when Node doesn't exist (BYOH bootstrap)
- Automatic migration: ConfigMap → Node annotation with cleanup

SSH host key validation tests

Test 1 & 2: testSSHHostKeyAnnotations
- Verifies ssh-host-key and ssh-host-key-type annotations exist on all nodes
- Validates annotation contains valid base64-encoded SSH public key
- Re-fetches node to verify key stability (not regenerated on reconcile)

Test 3: testSSHHostKeysConfigMapCleanup
- Verifies windows-ssh-host-keys ConfigMap has no stale entries
- Confirms keys migrate from ConfigMap to Node annotations with cleanup

Test 4: testReAddInstance (extended)
- Captures host key before BYOH instance removal
- Verifies same key persists after re-add (validates TOFU property)
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci

openshift-ci Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 1, 2026
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 910620e7-ce4c-442f-a592-37d5448e0600

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@jrvaldes
jrvaldes marked this pull request as ready for review September 1, 2026 20:48
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 1, 2026

@jrvaldes jrvaldes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@openshift-ci

openshift-ci Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jrvaldes, wgahnagl

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 1, 2026
@mansikulkarni96

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Sep 2, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test aws-e2e-operator
/test azure-e2e-operator
/test azure-e2e-upgrade
/test gcp-e2e-operator

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 058ad10 and 2 for PR HEAD f49c69f in total

@mansikulkarni96

Copy link
Copy Markdown
Member

/override ci/prow/vsphere-disconnected-e2e-operator

@openshift-ci

openshift-ci Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@mansikulkarni96: Overrode contexts on behalf of mansikulkarni96: ci/prow/vsphere-disconnected-e2e-operator

Details

In response to this:

/override ci/prow/vsphere-disconnected-e2e-operator

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@mansikulkarni96

Copy link
Copy Markdown
Member

/override ci/prow/azure-e2e-upgrade
failed to deprovision

@openshift-ci

openshift-ci Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@mansikulkarni96: Overrode contexts on behalf of mansikulkarni96: ci/prow/azure-e2e-upgrade

Details

In response to this:

/override ci/prow/azure-e2e-upgrade
failed to deprovision

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@mansikulkarni96

Copy link
Copy Markdown
Member

/retest-required

1 similar comment
@mansikulkarni96

Copy link
Copy Markdown
Member

/retest-required

@openshift-ci

openshift-ci Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@wgahnagl: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/azure-e2e-operator f49c69f link true /test azure-e2e-operator

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants