IAM changes in Terraform
The risk: an AI agent widens cloud permissions in a Terraform change, for example a role that can now act on every resource, and the change merges because it looks like routine infrastructure work.
What Arbiter does: every change under the folders you list for IAM is held until your security team approves it on
GitHub. This rule does not read the Terraform: it holds the change because of where it is, not what it says. If you
also turn on the Terraform check (terraform_iam in your policy, off unless you add it; see the policy reference),
Arbiter reads your Terraform files too, and holds any IAM change it cannot prove adds none of four widening patterns:
an action wildcard (* or s3:*), a resource wildcard, an admin policy, or a wider trust. Other grants pass it (see
“What it does not cover”).
The rule
Section titled “The rule”- Every change under a listed folder is held: a new file, an edited file, a deleted file, and a file renamed into or out of the folder.
- It is cleared by one approval from your security team (
acme/securityin the starter policy). The approval counts only if it is the reviewer’s latest decisive review, approves the latest commit, and comes from an active member of that team in your organization, whose account is also on the policy’s approver list (P16), who did not open the pull request, author or commit any of its commits, or create or push to its branch. A review by a bot does not count, and neither does an approval from someone outside the team. - The other infrastructure rules still apply. In the starter policy the folder
infrastructure/iam/**is also part ofinfrastructure/**, so a change there also needs its platform approval and a passingterraform-validate. Arbiter checks those again once the hold is cleared. A folder outsideinfrastructure/**, such asmodules/iam/**, gets only the security hold unless you add your own evidence requirement for it.
Set it up
Section titled “Set it up”The starter policy (Starter policy and onboarding) holds infrastructure/iam/**. Change it
to the folders your repository uses.
-
List every folder that defines IAM or feeds it:
- the IAM resources themselves;
- the modules that create them;
- the policy JSON or YAML files they load;
- the variable and
.tfvarsfiles they read.
-
Add each one to
protected_pathswithrisk_class: "high", so the IAM hold covers it:protected_paths:- pattern: "infrastructure/iam/**"label: "IAM roles and policies"risk_class: "high"- pattern: "modules/iam/**"label: "IAM modules"risk_class: "high"- pattern: "environments/*/iam.tfvars"label: "IAM variables"risk_class: "high" -
Name your security team in the escalation’s
cleared_by(policy-author manual, P10). -
Switch on blocking when you are ready: the starter runs in advisory mode (below).
Patterns ignore letter case, so Infrastructure/IAM/role.tf is held as infrastructure/iam/role.tf is, and the Terraform
check reads it too. An exemption (!docs/**) still matches only as written.
What it does not cover
Section titled “What it does not cover”- A change outside the folders you list. If IAM is defined somewhere you did not list, that change is not held by this rule. Listing every folder is what gives you the protection.
- The content of the change, unless you turn on the Terraform check. This rule does not read Terraform, so it
does not tell
Action "*"from a typo fix: both get the same hold, and your security team judges the change. The Terraform check (terraform_iam) reads the content, and holds whatever it cannot prove free of its four patterns. - A grant the Terraform check has no pattern for. The check looks for four patterns only. A new specific action
(for example
iam:PassRole), a partial wildcard (iam:Put*), a mix of actions that adds up to more power, or a grant moved from one named resource to another passes it. So does a value set outside the repository (-var,TF_VAR_*, Terraform Cloud variables), because no pull request carries it. - Two Terraform folders that differ only in letter case. With the Terraform check on, while a repository holds
both
Infrastructure/IAMandinfrastructure/iam, Arbiter cannot tell which a pattern means, and denies every pull request, not only those that touch Terraform: “Two Terraform folders differ only in letter case. Rename one so each folder has one spelling; the pull request that does so is not blocked by this.” The pull request that renames one is not denied for it. For this check and for the large-repository walk below, “letter case” means the letters A to Z only, soÄ/andä/are not a collision. - A very large repository and a pattern that starts with a wildcard, a group or a negation. On a repository whose file list GitHub cuts short, a
terraform_iam.pathspattern that starts with a wildcard (the default**too), a group or a negation (!docs/**,@(infra|ops)/**) makes Arbiter walk the tree from its root, and it can run out of GitHub requests. When it does, it denies every pull request (request_budget), and policy review warns about the pattern. Name the folders in patterns that start with a plain folder name (infrastructure/**) to avoid it. - A pull request from a fork. Arbiter cannot count approvals on a fork, so the hold stays until the change is opened from a branch in your repository. The check says GitHub data could not be read, and the comment tells the author to open the pull request from a branch in this repository (Starter policy and onboarding, “Pull requests from forks”).
- Advisory mode. The hold blocks the merge only in enforce mode, with Arbiter’s check required on the branch. In advisory mode, which the starter ships with, the check is neutral (“Would hold”) and the pull request can merge. Two exceptions: Arbiter denies every pull request, in every mode, when it cannot confirm that the policy repository is protected, or when the target branch does not require the check with “Require branches to be up to date before merging” on.
What the pull request author sees
Section titled “What the pull request author sees”- The check:
Arbiter / authorizereads “Held: needs review by acme/security” (“Would hold: …” in advisory mode), with “(+1 more)” or similar when something else is also missing. - The comment names the rule,
iam_change_needs_security_review: IAM changes need a security team approval, and the next step: ask members ofacme/securityto approve (1 needed). Arbiter checks the pull request again after each review. - The pull request author guide explains the comment and which approvals count.
What Arbiter reads
Section titled “What Arbiter reads”This rule adds nothing to what Arbiter reads: it uses the paths the pull request changes, the approvals on GitHub and the members of the named team. The infrastructure rules also read check results. On its own, the rule reads no Terraform content. Other reads, such as the files an ordinary required check runs, are in the data rule.
Arbiter reads only the files your policy needs. That is always the pull request’s provenance and evidence files; your Terraform files and the JSON or YAML files they load, if you turn on the Terraform check; the changed workflow, action and dependency files, if you turn on the workflow or dependency analysis; and, when your policy requires an ordinary check (one that is not a trusted check), the repository’s file list and the workflow, scripts, modules and test files that check runs. It reads them; it never runs them. It holds what it reads only for one evaluation, in memory or in a working folder it deletes when the evaluation ends. Two cases can leave a working folder behind: if Arbiter stops partway, the next start deletes it; if the data directory’s device number changes, an administrator deletes it (the data rule’s “Repository file contents” row). From the provenance file it keeps only a fingerprint of the agent’s session id. From Terraform files it keeps only file paths, line numbers, resource names and what it found. From the files a check runs it keeps nothing but a fixed reason when a check cannot count. It never reads plan output. What Arbiter receives, keeps and deletes lists every read.
Built from Arbiter 0.1.3 at commit 05d1dcb.