Skip to content

CORE-6214: let Terraform Checks fetch private git modules over SSH - #172

Merged
sarasvoss merged 1 commit into
mainfrom
feature/CORE-6214-terraform-checks-ssh-key
Nov 9, 2026
Merged

sarasvoss merged 1 commit into
mainfrom
feature/CORE-6214-terraform-checks-ssh-key

Conversation

@sarasvoss

@sarasvoss sarasvoss commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

PR Summary

Jira: https://opensesame.atlassian.net/browse/CORE-6214

Description of Changes

CORE-6214 moves OpenSesame/identity-infrastructure onto Repo Checks. Its Terraform roots and
terraform/modules/common-config use module sources from the private
OpenSesame/devops-terraform-modules repository over SSH. run_terraform_checks 1.0.3 takes no
secrets, so init:terraform can't download them, and the Terraform job would always fail at
Initialize there. A contract exception doesn't help, because CI still runs init.

run_terraform_checks 1.1.0:

  • takes an optional ORG_READ_ONLY_SSH_KEY secret;
  • when the secret is set, installs it with configure-github-ssh 1.0.0, which pins GitHub's host
    keys, just before Initialize, as run_repo_validation and tf_plan_single_root do;
  • removes the key and SSH config right after Initialize, even when Initialize fails, so Validate,
    tflint and Checkov never run with the org key installed;
  • skips Initialize and Validate if SSH setup fails, so the Summary shows them as ❌ setup failed;
  • without the secret, skips the SSH steps and behaves exactly as before.

run_repo_checks 1.1.0 passes the ORG_READ_ONLY_SSH_KEY secret it already declares for Standard
through to the Terraform job.

The READMEs, including the run_terraform_checks Contract section, and both changelogs are updated.

Versioning

  • Yes
    • v:wf/run_terraform_checks/1.1.0
    • v:wf/run_repo_checks/1.1.0

Both are minor bumps: a new optional secret, with no change when it isn't passed.

Dependencies of PR

None. identity-infrastructure's CORE-6214 Repo Checks onboarding needs this released first.

Testing

  • npm run check passes: actionlint, zizmor, markdownlint, prettier, eslint and 293 tests.
  • New tests check that SSH is set up only when the secret is set and only before Initialize, that
    the cleanup runs between Initialize and Validate/Lint/Scan, and that Repo Checks passes the
    secret to the Terraform job.
  • The version label validator passes locally with both labels.
  • Not yet run against a real root with private modules; the identity-infrastructure onboarding
    PR will do that.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Terraform checks can now access private GitHub modules using an optional read-only SSH key. The temporary SSH configuration is removed after initialization, including if the workflow is cancelled.
    • Without the key, behavior remains unchanged. If SSH setup fails, initialization and validation are skipped.
  • Documentation
    • Updated workflow usage instructions and release notes to describe the optional key and private-module support.

run_terraform_checks took no secrets, so init:terraform couldn't
download module sources from private github.com repositories, such as
[email protected]:OpenSesame/devops-terraform-modules.git//... that
identity-infrastructure uses. Repo Checks' Terraform job would always
fail at Initialize there, and a contract exception doesn't help because
CI still runs init.

run_terraform_checks now takes an optional ORG_READ_ONLY_SSH_KEY. When
it is set, configure-github-ssh 1.0.0 installs it with GitHub's pinned
host keys just before Initialize, as run_repo_validation and
tf_plan_single_root do, and the key and SSH config are removed right
after, so Validate, tflint and Checkov never run with the org key
installed. If SSH setup fails, Initialize and Validate are skipped.
Without the secret the job behaves as before. run_repo_checks passes
the secret it already declares for Standard through to the Terraform
job.

Releases run_terraform_checks 1.1.0 and run_repo_checks 1.1.0, which
calls it from the same commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sarasvoss
sarasvoss requested a review from a team as a code owner November 9, 2026 00:20
@sarasvoss sarasvoss added v:wf/run_terraform_checks/1.1.0 Version label for run_terraform_checks 1.1.0 v:wf/run_repo_checks/1.1.0 Version label for run_repo_checks 1.1.0 labels Nov 9, 2026
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The repository checks workflow now forwards an optional SSH key to Terraform checks. Terraform checks configure SSH credentials for initialization when the key is present, then remove them after initialization. Tests and release documentation cover the updated workflow.

Changes: Terraform SSH module access

Layer / File(s) Summary
Forward the key and manage SSH credentials
.github/workflows/run_repo_checks.yml, .github/workflows/run_terraform_checks.yml, .github/workflows/TESTS/*, .github/workflows/READMES/*, .github/workflows/CHANGELOGS/*
The repository workflow passes ORG_READ_ONLY_SSH_KEY to Terraform checks. Terraform checks conditionally configure SSH credentials before initialization and remove them afterward. Tests assert the secret mapping, step order, conditions, and cleanup commands. Documentation and changelogs describe the optional key, its limits, and version 1.1.0.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant RepoChecks as run_repo_checks
  participant TerraformChecks as run_terraform_checks
  participant SSHSetup as SSH setup
  participant TerraformInit as Terraform initialization
  RepoChecks->>TerraformChecks: Pass ORG_READ_ONLY_SSH_KEY
  TerraformChecks->>SSHSetup: Configure credentials when key is present
  SSHSetup-->>TerraformChecks: Report setup outcome
  TerraformChecks->>TerraformInit: Initialize when setup did not fail
  TerraformChecks->>SSHSetup: Remove credentials after initialization when setup succeeded
Loading

Possibly related PRs

Suggested reviewers: alex-duhanov, anigarikipati

Merge Risk: Minimal · up to 794b3

The key is forwarded to Terraform checks and configured for GitHub SSH module access. No merge-blocking issue is established.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: letting Terraform Checks fetch private git modules over SSH. The changeset adds an optional ORG_READ_ONLY_SSH_KEY secret to run_terraform_checks, configures SSH before…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: letting Terraform Checks fetch private git modules over SSH. The changeset adds an optional ORG_READ_ONLY_SSH_KEY secret to run_terraform_checks, configures SSH before Initialize, removes it afterward, and forwards the secret from run_repo_checks. The title also carries the CORE-6214 ticket identifier, which is acceptable for scanning history.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 78a76dfb-be1c-493b-8ba7-43f9b593b408
Commits

Reviewing files that changed from the base of the PR and between c002f3d and 794b399.

Files selected for processing: 8

  • .github/workflows/CHANGELOGS/run_repo_checks.md
  • .github/workflows/CHANGELOGS/run_terraform_checks.md
  • .github/workflows/READMES/run_repo_checks.md
  • .github/workflows/READMES/run_terraform_checks.md
  • .github/workflows/TESTS/run_repo_checks.unit.test.js
  • .github/workflows/TESTS/run_terraform_checks.unit.test.js
  • .github/workflows/run_repo_checks.yml
  • .github/workflows/run_terraform_checks.yml

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Tags

The following tags will be created on main after merge

🏷️ workflows/run_terraform_checks/1.1.0
🏷️ workflows/run_repo_checks/1.1.0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

✅ Semgrep Security Scan Passed

🎉 No security issues found!

View run
🤖 Powered by Semgrep + reviewdog

@sarasvoss

Copy link
Copy Markdown
Contributor Author

Claude Code wrote Code Rabbit and I reviewed. No direct AWS prod access. Merging without additional human review.

@sarasvoss
sarasvoss merged commit 622e137 into main Nov 9, 2026
27 of 28 checks passed
@sarasvoss
sarasvoss deleted the feature/CORE-6214-terraform-checks-ssh-key branch November 9, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v:wf/run_repo_checks/1.1.0 Version label for run_repo_checks 1.1.0 v:wf/run_terraform_checks/1.1.0 Version label for run_terraform_checks 1.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant