feat: isolate canonical known-host source validation - #72
Merged
Merged
Conversation
Contributor
OpenTofu TestOpenTofu test passed. View run output |
Contributor
OpenTofu PlanOpenTofu plan passed. View run outputOpenTofu will perform the following actions:
# github_workflow_repository_permissions.release_automation will be created
+ resource "github_workflow_repository_permissions" "release_automation" {
+ can_approve_pull_request_reviews = true
+ default_workflow_permissions = "read"
+ id = (known after apply)
+ repository = "terraform-libvirt-domain"
}
Plan: 1 to add, 0 to change, 0 to destroy.
OpenTofu will perform the following actions:
# github_workflow_repository_permissions.release_automation will be created
+ resource "github_workflow_repository_permissions" "release_automation" {
+ can_approve_pull_request_reviews = true
+ default_workflow_permissions = "read"
+ id = (known after apply)
+ repository = "terraform-libvirt-domain"
}
Plan: 1 to add, 0 to change, 0 to destroy. |
Contributor
Author
|
CI completed successfully at head
No source diagnostic, real field extraction, host connection, or apply was dispatched by this change. Successful plan execution is not a claim of a no-op or a reviewed exact infrastructure delta. Merge remains on hold pending explicit owner approval covering the existing main-apply trigger and outstanding unrelated infrastructure scope. After any separately authorized merge, manually dispatch only |
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.
Summary
Add the owner-approved source-side diagnostic to distinguish an absent canonical known-host entry from a delivery problem. The new
check-known-host-sourceworkflow has credentialless synthetic tests on PRs and a separately confirmed, main-only manual source job. The diagnostic itself runs no OpenTofu/state operation, does not contact Hero, and does not write GitHub secrets.Four new files: a Python-stdlib helper, synthetic tests, workflow, and operator guide. No encrypted source, Terraform resource, recipient mapping, shared workflow, or Hero workflow changes.
Fixes: N/A — owner-approved investigation of the consumer preflight's
missing-host-entryresult.Type of change
Validation
synthetic-testsand existing OpenTofu test/plan.Synthetic tests use temporary generated keys and real Python streaming producers in place of SOPS; they never access KMS or real encrypted data. Coverage includes matching/hashed/missing entries, extraction failures, oversized/infinite streams, timeout termination, mode-restricted temporary files, cleanup, fixed-output assertions, invalid inputs, and workflow main/manual/credential guards.
Adversarial, infrastructure-security, DevOps integration, and QA reviews have no unresolved Critical/High findings. Review fixes replaced unbounded buffered extraction with bounded reads (1 MiB plus one overflow-detection byte), discarded SOPS stderr, and made temporary paths run/attempt-specific. No local tests or decryption ran; CI is the execution authority.
Impact and rollout
Owner/producer: tfroot-github maintainers own this thin orchestration around existing SOPS/OpenSSH tools and its sole manual-workflow consumer. No new package, service, image, or shared-workflow fork is introduced.
Compared path: canonical
ssh_known_hosts-> existingHERO_HOST_CONFIG_SSH_KNOWN_HOSTSresource for hero-host-config -> its runner-local known_hosts file. Both diagnostics use OpenSSHssh-keygen -Fwith the same supplied destination. A source match does not prove byte equality, ED25519 validity, host identity, or successful distribution.Diagnostic selection: PRs run only synthetic tests in this new workflow. A new dispatch from main after separate authorization uses the existing production environment, arc-tf image, and SOPS KMS role. OIDC/KMS access is not proven until that dispatch. The helper extracts the field inside CI, discards tool diagnostics, prints only a fixed result category, and removes its temporary plaintext file. No artifacts/caches retain source material.
IMPORTANT MERGE GATE: the repository's existing OpenTofu workflow remains unchanged. PR creation still triggers its normal test/plan, and merging still triggers its normal main workflow, including its environment-scoped apply. Current main includes unrelated repository-deletion work whose latest apply failed. This PR is NOT authorization to retry or apply those changes. Review the outstanding infrastructure plan and actual environment protection before authorizing merge; environment declaration alone does not establish a required-reviewer gate. No merge or manual dispatch has been performed.
Stages: authored/branch-published and independently reviewed; CI pending. Merge and manual source diagnostic are separate confirmation gates. Consumer comparison and runtime resolution remain pending. No tfroot-libvirt cleanup is included.
Rollback: close before merge or remove the four new files through a reviewed PR. The diagnostic changes no remote secret or host state. Interruption cleanup is best-effort; a host crash cannot guarantee deletion, as documented.
Safety and secrets
AI-assisted implementation and independent reviews. The source check does not expose values, keys, fingerprints, hashes, or subprocess errors. Dispatch destinations can appear as ordinary workflow input metadata; no endpoint is committed.