The Simplest Way to Make OpenTofu and Phabricator Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Pairing opentofu and phabricator lets teams review cloud code before making live changes. Engineers submit plans for peer review and trigger automated runs after approval. This workflow stops bad setups from reaching live cloud accounts. It also keeps a clear record of every change and who approved it. Teams get one place to read code, discuss plans, and track runs. How opentofu and phabricator share roles and data The workflow starts when a developer sends a code change for review. The revi

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Pairing opentofu and phabricator lets teams review cloud code before making live changes. Engineers submit plans for peer review and trigger automated runs after approval.

This workflow stops bad setups from reaching live cloud accounts. It also keeps a clear record of every change and who approved it. Teams get one place to read code, discuss plans, and track runs.

How opentofu and phabricator share roles and data

The workflow starts when a developer sends a code change for review. The review tool holds the git repo and tracks team comments. When a new change arrives, the system triggers a build worker.

The build worker checks out the code and runs a plan step. It uses a cloud role to read the current state of resources. Then it sends the plan text back to the review page.

Reviewers read the exact resource changes right next to the code diff. They check that no wrong items get changed or deleted. Once a reviewer approves the diff, the author lands the code.

Landing the code triggers a second job on the build worker. This job runs the apply step to update the real cloud setup. It writes the new state file to a shared remote storage bucket. It also posts the final run log back to the review thread.

Common failure modes and how to scope roles

Many teams fail by giving one big cloud key to all workers. If a worker runs both plans and applies, any diff can change production. A bad actor could write code that steals keys during a plan run.

Another common risk is using shared bot tokens for code reviews. When every worker uses the same token, you lose track of who ran what. You also risk leaking wide repo rights if a build box fails.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Unlogged runs create big blind spots for security teams. If an engineer runs changes from a laptop, the review tool misses it. The state file updates, but no one knows why or who approved it.

To fix this, split your worker roles into two clear groups. Give plan workers a read-only cloud role so they cannot alter live apps. Give apply workers write rights, and lock them to the main branch only.

Scope network paths so workers only reach the exact endpoints they need. Plan workers only need to read state and query cloud APIs. Apply workers need write paths, but only after a merge event occurs. Rotate API tokens often and tie every action to a human user ID.

Keeping state files and review comments safe

Plan outputs often contain private details from your cloud setup. When a worker posts a plan to a review thread, secrets can leak. Anyone who can read the review page might see private database details.

Data masking helps stop these leaks in review comments and logs. Masking rewrites matched fields in results, like emails, phone numbers, or card numbers. It also rewrites national IDs before the text hits the review page.

Teams should also lock down who can read the remote state file. Only the build workers and core platform leads should hold state read roles. Every read and write to the state store should write to an audit log. This helps teams trace every single cloud change back to an approved diff.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

How do we stop a plan step from changing live cloud items?

Run the plan step on a separate worker with a read-only cloud role. Keep the write role on a locked worker that only runs after merge.

Where should the build worker store the state file?

Store the state file in a remote cloud bucket with state locking turned on. Never commit the state file back into the source code repo.

How can we hide private data in review thread comments?

Mark sensitive variables in your code and use log masking on the worker. Masking rewrites matched fields like emails or card numbers before posting the plan.

The query runs. The emails stay hidden.