Repository navigation
infra 7 : Terraform for Render/Vercel + GitHub OIDC for Azure credentials - #176
Merged
Merged
Conversation
TFT444
requested review from
Vishnu2707,
parthrohit22 and
ritiksah141
as code owners
July 12, 2026 03:03
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
m-khan-97
approved these changes
Jul 12, 2026
m-khan-97
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the full diff — this is exceptionally well-scoped for a "we have zero live infra access" constraint. A few things stood out as particularly well-reasoned:
- Correctly limits OIDC to CI, not runtime.
AZURE_CLIENT_SECRETis deliberately kept out of the Terraform-managed env group and left as a manual Render dashboard entry, not deleted. That's the right call — Render's compute has no Azure workload-identity federation, so the long-running API/worker service still needs a standing credential; only the ephemeral GitHub Actions runner indeploy.ymlcan use OIDC. Good to see that distinction actually reflected in the code, not just asserted in prose. - Honest about the danger zone. The README is explicit that the Render web service, Postgres instance, and both Vercel projects already exist and must be
terraform import-ed before any realterraform apply, or it'll attempt to create duplicates. That's the single most important thing whoever does the first real apply needs to not skip — worth restating out loud here since it's easy to gloss over in a large README. - Full CI is green, including
terraform fmt/validateactually running (not just claimed), and the known overlap with #172'srender.yamlblueprint is flagged as an explicit unresolved follow-up rather than silently left for someone to discover later.
Two minor, non-blocking notes:
docs/ci-oidc-setup.mdanddocs/secrets-inventory.mddescribe the Azure identity on the Render web service as distinct from "end-user scan credentials" / "the product feature itself," implying a BYOC flow. As far as I can tell from the current codebase, there's only one server-side Azure service principal in play (AZURE_SUBSCRIPTION_ID/CLIENT_ID/TENANT_IDenv vars used by both the API's own scans and the smoke test) — there's no per-user credential flow today. Worth softening that language slightly so it doesn't read as describing a feature that doesn't exist yet.- The planning doc under
docs/superpowers/specs/2026-07-12-terraform-oidc-design.mdreferencesazure/login@v2in a couple of spots while the shipped workflow and the paired plan doc both correctly usev3. Harmless since it's scratch/planning material, not user-facing docs, but a quick pass would keep it internally consistent.
Neither blocks this. Approving — nice work handling a "no credentials, be honest about it" constraint without pretending the risk isn't there.
Vishnu2707
approved these changes
Jul 12, 2026
Vishnu2707
left a comment
Collaborator
There was a problem hiding this comment.
Approved, as this addresses the clear scope of the work.
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
Closes #160.
infra/terraform/: Terraform for the current live topology — one Render web service (openshield-api), one Render Postgres (openshield-db), a shared secrets env group, and two Vercel projects (frontenddashboard,websitedocs site). Every credential-shaped value is asensitive = trueTerraform variable with no default — nothing is applied, no live credentials exist in this repo. Seeinfra/terraform/README.mdfor the one-time setup and plan/apply flow..github/workflows/terraform-plan.yml: runsterraform fmt/validateon every PR touchinginfra/terraform/**; also runsterraform planonceTF_API_TOKENis configured (gracefully skipped until then, workflow still passes).deploy.yml: Azure smoke-test authentication switched from a storedAZURE_CLIENT_SECRETto GitHub OIDC federation viaazure/login@v3. No application code changes needed —DefaultAzureCredential()already picks up workload-identity federation automatically.docs/ci-oidc-setup.md: the one-timeaz ad app federated-credential createcommands needed on the existingopenshield-scannerservice principal (I have no Azure access to run these myself).docs/secrets-inventory.md: every credential-shaped value in the project and where it lives (GitHub secret vs Render env var vs Terraform variable).Known scope limits (called out explicitly, not silently swept under)
render.yamlblueprint. This PR models today's live topology only; reconciling Terraform vs therender.yamlblueprint is a follow-up once Infra: add deterministic Render deploy pipeline and separate worker services #172 lands (documented ininfra/terraform/README.md).terraform planhas never run against real infrastructure. Verified instead viaterraform fmt -checkandterraform validate(both pass, provider schemas confirmed against each provider's own docs). The plan tier variables (render_postgres_plan,render_web_service_plan) are documented best-guesses fromdocs/api-render-deploy.md— flagged inline as needing confirmation against the real dashboard before the first apply.AZURE_CLIENT_SECRETis not deleted — that's a manual, deliberate step for whoever holds repo admin access, done only after confirming OIDC actually works in a realdeploy.ymlrun (seedocs/ci-oidc-setup.md).deploy.yml's maintainer-owned smoke-test Azure identity, not to how the product itself authenticates to end users' own Azure subscriptions (those are user-supplied credentials; OIDC federation is inherent to GitHub Actions and can't apply there).Security/quality pass
gitleaksscan of every new commit: 0 leaks.trivy configscan ofinfra/terraform/: 0 misconfigurations.sensitive = truewith no defaults; confirmedAZURE_CLIENT_SECRETappears nowhere underinfra/.terraform-plan.yml:contents: read, pull-requests: write;deploy.yml: added onlyid-token: write, contents: read).outputs.tfexposes only non-sensitive identifiers/URLs, neverconnection_infoor env var values.Test plan
terraform fmt -check -recursive— cleanterraform validate(local backend override, no live credentials) —Success! The configuration is valid.ruff check/ruff format --check— clean (this PR touches no.pyfiles)gitleaks+trivy config— clean