New: Access Diff now reviews Terraform pull requests on GitHub

Quickstart

Connect one cloud account and one repository, then read your first access check on a pull request.

This walkthrough takes you from an empty workspace to a first Access Diff result. It uses AWS, GitHub and Terraform because they are the most common starting point. If you use Google Cloud, Azure, GitLab or OpenTofu, follow the same steps with the matching guide.

Before you start

You need:

  • An AccessRoot workspace and an account with permission to manage connections. If you do not have a workspace yet, you can book a demo.
  • Permission to create a read-only role in the cloud account you want to analyze.
  • Permission to install a GitHub App on the organization or repositories you want to connect.
  • A repository where Terraform or OpenTofu changes go through pull requests, with a plan step in your pipeline.

1. Connect a cloud account

  1. Open Settings › Connections.
  2. Under Cloud environments, choose AWS.
  3. Follow the setup to create the discovery role in your account. The role is read-only, and AccessRoot uses temporary credentials with it.
  4. Select the account to analyze, for example halvorne-prod.

When the connection is active, it appears in the list with the label Read-only. The full steps, including what the role can read, are in AWS.

2. Connect a repository

  1. In Settings › Connections, under Source control, choose GitHub.
  2. Install the AccessRoot GitHub App and select only the repositories you want analyzed, for example halvorne/platform-infra.
  3. Leave remediation pull requests off for now. You can enable them later, and they use a separate permission.

The connection is then listed as Scoped, for example “3 of 12 repositories selected”. See GitHub for the permissions involved.

3. Look at the access graph

Once the first collection finishes, open Access Graph and select your account. Start from a resource you care about, such as the CustomerRecords table, and switch the view to From a resource. Select any step on a path to see the relationship, the action it allows and, for access managed in code, the file that defines it.

Spend a few minutes here before you open a pull request. It is the same model Access Diff compares against. See Access Graph for how to read it.

4. Open a pull request that changes access

Make a small change to a role in your repository. For example, add a principal to a trust policy:

resource "aws_iam_role" "data_maintenance" {
  name = "data-maintenance-role"
  assume_role_policy = jsonencode({
    Statement = [{
      Effect    = "Allow"
      Action    = "sts:AssumeRole"
      Principal = { AWS = [
        aws_iam_role.ci_deploy.arn,
        aws_iam_role.ops_maintenance.arn,
      ] }
    }]
  })
}

Open the pull request as you normally would. Your own checks run, including terraform validate and terraform plan (or tofu plan).

5. Read the check

AccessRoot publishes a check named AccessRoot / Access Diff on the pull request. If the change makes something new reachable, the check asks for action and links to a finding. The finding shows:

  • who gained access, and what they can reach;
  • the chain of roles, trust relationships and permissions that makes it possible;
  • why it matters, based on privilege, resource sensitivity and identity type;
  • the file and pull request that introduced it.

Decide whether the new path is intended. If it is not, narrow the change in the same pull request and push a new commit. The check runs again, and when no unintended path remains it passes. Access Diff describes every part of the result.

6. Optional: enable remediation pull requests

If you want AccessRoot to prepare fixes for access that already exists, enable remediation pull request creation for the repository. AccessRoot then opens a pull request with a narrower change and a preview of its effect. Your team reviews and merges it, and your pipeline deploys it. Nothing is applied to production by AccessRoot. See Remediation.

7. Confirm the connections

Open Settings › Audit log. The connections you made appear as events with the person who made them and the time. If a connection looks wrong, you can update its scope or revoke it from Settings › Connections. See Workspace and audit.

Where to go next