Terraform and OpenTofu
How AccessRoot evaluates Terraform and OpenTofu plans to show what a proposed change makes reachable, before it is deployed.
Terraform and OpenTofu tell you what infrastructure will change. AccessRoot tells you what those changes mean for access. This page explains what AccessRoot reads from your infrastructure code, how a plan becomes an Access Diff, and how remediation stays in the same code.
What AccessRoot reads
AccessRoot works with both tools in the same way. For a proposed change, it reads the plan and the relevant configuration, and it maps the roles, permissions, trust relationships and resource policies in the plan to the access they affect.
| Tool | Plan command |
|---|---|
| Terraform | terraform plan |
| OpenTofu | tofu plan |
An infrastructure plan can succeed and still describe a risky access change. An IAM policy or trust relationship can have consequences that the resource diff does not show. AccessRoot compares the proposed state with the current access model, so the result describes access rather than resources.
Set it up
AccessRoot does not run Terraform or OpenTofu for you. It reads the plan that your pipeline already produces for each pull request, so setup is mostly a matter of connecting the right repositories and accounts.
- Connect the repositories that hold your infrastructure code with GitHub or GitLab. The permission Read pull requests and plans covers the changes and plans AccessRoot reads.
- Connect the cloud accounts the code deploys to, so there is a current access model to compare against. See AWS, Google Cloud or Azure.
- Keep running
terraform planortofu planon pull requests, as your pipeline does today.
In Settings › Connections, plan handling appears under Infrastructure as code as “Terraform · OpenTofu plans”, with the description Sensitive input, filtered before retention and the label Restricted.
Example: a plan with one change
In the sample workspace, pull request #187 updates the trust policy of an AWS role. The plan shows a single modified resource (illustrative output):
# aws_iam_role.data_maintenance will be updated in-place
Plan: 0 to add, 1 to change, 0 to destroy.
The plan alone does not say what that change allows. AccessRoot evaluates it against the existing access model and reports a finding: a new production data modification path. The reasoning is explicit. ci-deploy-role already has sts:AssumeRole on data-maintenance-role. The proposed trust policy satisfies the receiving role’s trust requirement, so the production data permissions of data-maintenance-role become reachable through the pipeline.
The finding is tied to the exact change that introduced it: the resource aws_iam_role.data_maintenance, the file infra/iam/data-access.tf and the pull request. It also lists the context that explains its priority: a machine identity, a sensitive production resource, a data modification privilege and a newly reachable role-assumption path.
What an Access Diff can report
Access Diff compares the proposed access with the current access and reports three kinds of change:
- Added: a path that does not exist today and would exist after the merge.
- Removed: a path that exists today and would no longer be reachable.
- Changed: a path that remains but with a different permission or scope.
Removals matter as much as additions. A pull request that deletes a legacy deployment role is reported as access removed. See Access Diff for how findings are presented.
How plans are handled
An infrastructure plan can contain sensitive values, even when a developer tool masks them in its output. AccessRoot treats plans as sensitive input. They are processed with restricted access and filtered before the information relevant to a finding is retained. They are not kept indefinitely just because they were submitted. See Permissions and data.
Remediation stays in the same code
When a fix is needed, AccessRoot prepares it as a change to the same Terraform or OpenTofu configuration, for example removing aws_iam_role.ci_deploy.arn from the trusted principals of data-maintenance-role. It opens it as a pull request. Your team reviews it and merges it, and your pipeline applies it. AccessRoot does not run apply. See Remediation.
What a plan cannot tell you
A plan describes intent. It is not the deployed state. After deployment, Access Drift compares the access your configuration defines with the access observed in the cloud environment, which is how a change made outside Terraform shows up.
Related
- The Terraform and OpenTofu integration page gives the product overview.
- How it works shows where plan analysis sits in the full loop.