CloudBoosterDocs

Set up pull-request review

Webhooks, permissions, making the cbxguard/review check required, the repository config, suppressions and the known limits of pull-request review.

Set up pull-request review

CloudBooster Guard reviews every pull request (GitHub) or merge request (GitLab) on the repositories you watch. It plans the Terraform the change touches, offline, without your credentials. It then resolves the plan against the cloud accounts you connected and reports back on the change itself:

  • A check named cbxguard/review. It is a check-run on GitHub and a commit status on GitLab. It is in progress / running while the review runs, and final once the verdict is in. A change whose plan your CI uploads instead (the CI plan check) gets cbxguard/ci-plan: each name says where the plan came from, and the Console labels the review Planned by Guard or Planned in your CI to match. When your CI planned a commit before Guard reviewed it, Guard does not plan it again, but it still completes cbxguard/review with the CI plan's result, and every later upload for that commit updates both checks. So cbxguard/review is on every reviewed commit, a rule that requires it never waits, and it turns red whenever cbxguard/ci-plan does.
  • One Guard comment (GitHub) or note (GitLab), only when the verdict is not clean. Guard keeps that one comment up to date as you push. A clean change gets the check and no comment.
  • Inline comments on the changed lines that flagged findings sit on: review comments on GitHub, resolvable threads on GitLab. On GitLab, a blocking verdict on an armed repository also opens one resolvable gate thread (see All threads must be resolved in section 2).

Every push to an open change is reviewed. A commit pushed while a review is still running is reviewed right after it. It is never skipped.

This guide covers the forge side: webhooks, the permissions Guard needs, making the check required, and the repo config. Getting started puts these steps in order. Connecting a cloud account comes first, under Cloud accounts in the Console (see Connect an AWS account). Without one, every review fails with no cloud account.

1. Connect your forge and watch repositories

In the Console, open Repositories, connect GitHub or GitLab, pick the repositories to watch, and arm the gate on each one you want enforced.

Plan. You can arm the gate on every plan. On Pro and Enterprise, a pull request the armed gate blocks also becomes a PR merge hold, which an admin can allow once for that commit.

Who can change it. Any member can connect GitHub or GitLab. Only an org admin or owner can change what is watched or gated:

  • watch or unwatch a repository;
  • arm or disarm its gate;
  • change which GitLab group a connection looks in;
  • disconnect the forge.

Members and viewers see these controls disabled, with a note that an admin must change them. A developer therefore cannot switch off the check that blocks their own pull request. After a GitLab OAuth connect, an admin picks the group that holds your Terraform repos. The pick only chooses where Guard looks; it doesn't change what the connection can access. You choose which repositories to watch next.

What the Git connection can do

The connection to GitHub or GitLab is not read-only. It acts on your Git host and writes to every pull or merge request it reviews. The Console shows the same facts before you consent, on Repositories → Connect repositories.

GitLab (Quick: acts as you)GitLab (service account, or a token you bring)GitHub
ScopeThe full api scope. GitLab has no narrower scope that can also post comments, statuses and webhooks.The api scope, on the token of the service account or the token you pasted.The App's permissions: checks write, pull requests write, contents read, metadata read.
Acts asYou. Guard acts as your GitLab user, and can do what you can in every group you can reach.The service account Guard created, or the user the token you pasted belongs to (a bot user, for a group or project access token). A service account is a Maintainer of the group you picked only.The Guard GitHub App (cbx-guard[bot]), not a person.
RevokeDisconnect in the Console removes the webhooks and revokes the OAuth grant at gitlab.com. If that fails, or the grant is on another GitLab instance, revoke it in GitLab: Preferences → Applications → Authorized applications → Revoke.Disconnect revokes a service-account token, and revokes a token you pasted using the token itself. If a revoke fails, revoke it in GitLab (Settings → Access tokens on the group or project, or Preferences → Access tokens).In GitHub: Settings → Applications → CBX Guard → Uninstall. Disconnect in the Console only forgets the installation on our side.

What Guard writes:

  • GitHub: a cbxguard/review check-run, one comment, and inline review comments on changed lines.
  • GitLab: one note, inline threads on changed lines, a cbxguard/review commit status, emoji reactions on its own notes, and a project webhook on each project you watch.

Guard's code never pushes commits, opens branches or merges. The GitLab credential is not limited to that, because GitLab cannot scope a token to comments, statuses and webhooks alone. Treat the token as you treat any api token: revoke it when you stop using Guard.

GitHub

Install the CBX Guard GitHub App on your organisation, and give it All repositories or select the ones to review. The App receives pull-request webhooks itself, so there is nothing to configure per repository. It asks for these repository permissions, and no others:

PermissionAccessWhat Guard uses it for
ChecksRead and writePosts the cbxguard/review check-run (and cbxguard/ci-plan for a plan your CI uploads) and updates it as the review runs.
ContentsRead-onlyReads the changed Terraform and the repo config at the pull request's head.
MetadataRead-onlyLists the repositories the install covers. GitHub grants it to every App.
Pull requestsRead and writeReads the pull request, and posts its one comment and the inline review comments.

It subscribes to the Pull request and Repository events. It requests no organisation or account permissions, and it never pushes code or changes your branches. It can write only checks and pull-request comments. Because the App asks to authorise you as a user when you install it, Guard can confirm you have access to the installation you link.

GitLab

GitLab has no app install, so Guard registers a project webhook on each project you watch. Each hook carries its own secret token, and Guard stores only a hash of it. Unwatching a project, or disconnecting GitLab, removes the hook again.

The Maintainer requirement. GitLab lets only Maintainers (and Owners) create webhooks. The account Guard connects with must therefore be a Maintainer on every project you watch, or on the group that holds them. When it is not, the repository shows Webhook: permission denied and reviews do not start on push.

How to connect. The GitLab step offers three choices. Each shows who Guard will act as before you grant anything.

OptionActs asNotes
OAuth (Quick: acts as you)You: the GitLab user who clicked ContinueOne OAuth consent. Grants Guard the api scope as that user, and everything it posts shows your name. Guard can do only what you can, so you must be a Maintainer on the projects you watch. The connection refreshes its own token, but it ends if you leave the group or revoke the grant, and it needs you to connect again.
Service account in this subgroupGuard's own account, cbx-guard-bot-<id>You sign in once, as an Owner of the top-level group. When you come back you pick a group or subgroup. Guard creates its service account in the top-level group (GitLab creates service accounts there only), makes it a Maintainer of the group you picked only, uses its token instead of yours and revokes your OAuth grant. If the account is still a member of a group from an earlier upgrade, Guard removes it from that group first; if GitLab refuses either change, nothing is upgraded and your connection keeps working. Needs GitLab Premium or Ultimate.
Bring a group or project access token (narrowest)The bot user GitLab creates for the tokenWorks on every GitLab tier. Create a group or project access token with the api scope and the Maintainer role, then paste it with the full path of its group or project. Guard checks that the token can read that path before it stores anything. A group path covers that group and its subgroups; a project path covers that one project. A personal access token also works; it then acts as its user. Disconnect removes the webhooks and revokes the token using the token itself; if that fails, revoke it in GitLab (Settings → Access tokens on the group or project).

GitLab tiers. Everything Guard needs works on GitLab Free: project webhooks, commit statuses, MR notes, Pipelines must succeed and All threads must be resolved. Guard deliberately uses project hooks rather than group hooks, because group webhooks need Premium. Two things depend on your tier and are optional:

  • Service accounts are a GitLab Premium / Ultimate feature on gitlab.com. Guard does not create one when you choose Quick: acts as you. If you want a connection that does not depend on one person, choose Service account in this subgroup, or have a group Owner choose Upgrade to a durable bot on a connected OAuth connection. Guard then creates a CloudBooster Guard service account in the top-level group, makes it a Maintainer of the group you picked only, and uses its token instead of yours. Watched repositories outside that group are listed first, and stop being watched only if you confirm. On Free, bring a group or project access token for the same result.
  • External status checks (Ultimate) are not used to gate merges. Guard reads them only to report whether a merge is gated.

Check GitLab's documentation for your plan if you are unsure.

Self-managed GitLab. Guard connects to your own GitLab instance with a bot token:

  1. In Integrations, on the GitHub & GitLab card, select Connect self-managed GitLab.
  2. Enter the instance's https:// URL (for example https://gitlab.example.com, or https://example.com/gitlab when GitLab is served from a sub-path), a personal access token of your bot user with the api scope, and the full path of the group to review. To review the bot user's own projects, enter its username instead.
  3. Guard checks /api/v4/version and /api/v4/user with the token before it saves anything, and says why when it refuses.

The instance must be reachable from the public internet over HTTPS. Guard refuses a URL whose host resolves to a private, loopback, link-local or other non-public address, and checks the address again before every request, so a DNS record changed later to such an address stops the connection rather than reaching your internal network. It does not follow redirects. The card then shows the instance, its GitLab version, whether it answers right now, and the webhook URL your GitLab must be able to reach: allow outbound HTTPS from the instance to it, or webhook deliveries fail and reviews do not start on push. The OAuth option is for gitlab.com only.

The manual fallback. If you cannot give Guard's account the Maintainer role, set the hook up yourself:

  1. In Repositories, select Set up manually on the repository's webhook badge. An org admin then reveals a webhook URL and secret token, shown once only.
  2. In GitLab, open the project → Settings → Webhooks → Add new webhook.
  3. Paste the URL, and the token into Secret token.
  4. Under Trigger, select Merge request events and Comments. Leave the other triggers cleared, and keep Enable SSL verification on.
  5. Save, then select Test → Merge request events. GitLab should report HTTP 200.

Every project you set up by hand uses the same URL and token. Revealing a new token revokes the old one, so update every hook after a re-reveal. The badge then reads Manual webhook.

Check that deliveries arrive. The repository's webhook badge shows the hook's state and when Guard last received a delivery from it. Re-sync recreates or repairs a hook that was deleted or disabled in GitLab. GitLab disables a hook temporarily after repeated failed deliveries.

2. Make the check required

Arming the gate tells Guard to report a blocking result. Your forge decides whether a failing check stops the merge. The Console shows for each repository whether the forge enforces it (enforced, not required or unknown). Until it reads enforced, a blocked change can still be merged.

What cbxguard/review reports:

VerdictGate disarmedGate armed
Cleansuccesssuccess
A tier your gate blocks (default: critical)neutral (GitHub) / success "not blocking" (GitLab)failure (GitHub) / failed (GitLab)
Any other non-clean tierneutral / success "not blocking"neutral / success "not blocking"
The review could not runneutral / success "not blocking"the same while the gate fails open (the default); failure / failed when it fails closed
Some roots could not be plannednever success on GitHub: at best neutral, "Partially reviewed … (not blocking)". GitLab has no neutral state, so it is success described "Partially reviewed: N root(s) not reviewed (not blocking)"as above, failing on a blocking tier or a fail-closed gate
Reviews are paused for your organisationneutral / success "not blocking"the same: a paused gate never blocks

On GitLab, the last three rows post grey skipped instead of success when the repository sets When Guard cannot review to grey (Choose what blocks), which every GitLab repository you start watching does by default. Whether a grey status lets the merge through is up to two GitLab settings: see GitLab: a review that couldn't run.

Reviews paused. While your organisation's billing is restricted (for example, suspended for an unpaid invoice) or the organisation is closed or offboarding, Guard does not review pull requests. So the gate is not mistaken for a broken one, every new or updated pull request on a watched repository gets cbxguard/review titled Not reviewed: reviews are paused for this workspace, with billing or the closure in brackets. It names the reason (billing restricted or organisation closed) and what to do: an organisation owner settles billing in the Console (Settings → Billing), or contacts Guard support to reactivate a closed organisation. The check links to the Console settings. It is neutral on GitHub and success with "not blocking" on GitLab, which has no neutral state, so it never blocks a merge, and no comment is posted. A repository set to grey gets skipped on GitLab instead, which GitLab's merge settings may hold (GitLab: a review that couldn't run). Reviews resume with the next push after the organisation is back in good standing.

So making the check required blocks merges only on the tiers your gate blocks. GitHub counts neutral as passing a required check, and GitLab sees success.

Choose what blocks

The blocking tiers and the fail mode are set per repository, and an organisation owner or admin changes them in the Console. In Repositories, expand the installation and choose Settings on the repository's row, or open the repository's details. Gate settings holds both choices. Members and viewers see the same settings but can't change them.

  • Verdict tiers that fail the check (default: critical). A change at a selected tier fails cbxguard/review, and its developer can't merge it until it's fixed. A change at any other non-clean tier gets a note and can merge. Selecting high or watch holds more changes, and watch holds changes that may be safe, because its reachability or context is unknown. With no tier selected, no verdict fails the check.
  • When the review can't run (default: fail open). Fail open doesn't block, so developers can merge and that change ships unreviewed. Fail closed fails the check, so developers can't merge until a review completes, and a plan that can't run holds the merge.
  • When Guard cannot review (GitLab only; default: grey, skipped for a repository you start watching, while a repository you watched before November 2026 keeps the colour it had: see GitLab: new and existing repositories). GitLab has no neutral state, so a review that failed, covered only some Terraform folders, or was paused is either green or grey. Green, not blocking posts success, and the status text says why it was not reviewed. Grey, skipped posts skipped, so a change nobody reviewed never shows a green tick. A review that fails a fail-closed, armed gate is failed either way. With Pipelines must succeed on, a grey merge request merges only when Skipped pipelines are considered successful is on too: see GitLab: a review that couldn't run. GitHub has a neutral conclusion, so it needs no such setting.

The change applies from the next review; a check already posted keeps its result until the next push. On the posted check, the tiers and the fail mode take effect only while the gate is armed, and you can set them before you arm it. The GitLab colour applies whether the gate is armed or not. Every change appears in Ledger → Activity with who made it and the settings before and after.

The CI plan job doesn't wait for arming. If the repository's pipeline runs the CI plan job, the selected tiers also decide when that job fails on a pull or merge request, from its next run, whether the gate is armed or not. So selecting high or watch while the gate is still disarmed can fail developers' pipelines on that tier, and with no tier selected the job stops failing on verdicts. A job that sets its own fail-on (CBX_GUARD_FAIL_ON on GitLab) keeps that threshold. The fail mode doesn't change the job.

GitHub: a ruleset

  1. Open the repository (or the organisation) → Settings → Rules → Rulesets → New ruleset → New branch ruleset.
  2. Name it, set Enforcement status to Active, and under Target branches add the default branch.
  3. Enable Require status checks to pass, select Add checks and pick cbxguard/review. A check appears in the list once it has run on the repository, so open a test pull request first. Choose the CBX Guard app as its source, so no other app or workflow can satisfy it.
  4. Optionally enable Require branches to be up to date before merging.
  5. Create.

Classic branch protection works too: Settings → Branches → Add branch protection rule → Require status checks to pass before merging → cbxguard/review. Guard reads either one.

Renamed check. Before November 2026 both kinds of review posted one check, cbxguard/policy. Guard no longer posts it. A rule that still requires cbxguard/policy holds every pull request, and the Console's gate badge reads not required and names the check to require instead: replace cbxguard/policy with cbxguard/review (and add cbxguard/ci-plan if your CI uploads plans). cbxguard/review is posted on CI-planned commits too, with the CI plan's result, and every later upload for the commit updates it along with cbxguard/ci-plan. So requiring cbxguard/review alone never holds a pull request and still blocks a CI plan that should not merge. GitLab needs no change: Pipelines must succeed reads every status by itself.

GitHub offers neither rulesets nor branch protection on a private repository under the GitHub Free plan, so nothing there can require the check. The Console reads not required for such a repository and quotes GitHub's answer. Make it public or upgrade the plan (GitHub Pro for a personal repository, GitHub Team for an organization's), then add the ruleset.

GitLab: merge checks

Open the project → Settings → Merge requests → Merge checks:

  • Pipelines must succeed. This is the gate. Guard's commit status is part of the merge request's pipeline, so a failed status stops the merge.

  • All threads must be resolved. Optional. It makes Guard's threads hold the merge too:

    • The gate thread. On a repository whose gate is armed, a blocking verdict opens one resolvable thread on the merge request, CloudBooster Guard holds this merge for commit …. There is one thread per merge request, not one per push. Guard resolves it when a later push reviews clean, or on the next review after the verdict stops blocking (for example, once the gate is disarmed). Resolve it yourself only to accept the risk.
    • Finding threads. A flagged finding that Guard can place on a changed line gets its own resolvable thread on that line, armed gate or not. Guard resolves it once a later push no longer has that finding.

    Guard's summary note stays a plain comment, so it never waits on this setting.

How the status meets your CI pipeline:

  • Run CI on merge requests. If CI runs for merge requests (workflow:rules or job rules with $CI_PIPELINE_SOURCE == "merge_request_event"), Guard attaches its status to that pipeline whenever the pipeline already exists for the reviewed commit. Pipelines must succeed then gates on CI and on Guard together.
  • No CI at all is fine. Guard's status then forms the merge request's pipeline by itself.
  • The race. If Guard posts before your CI pipeline exists, its status lands in a separate external pipeline. The merge request may then gate on whichever pipeline is newest. Running CI on merge-request pipelines, as above, avoids this in practice.
  • Merged-results pipelines run on a merge commit, not on your commit, so Guard's status is not attached to them. It lands on a branch pipeline for the commit, if there is one, or on an external pipeline.

GitLab: when the status can't block a merge

GitLab files a commit status by commit, and Pipelines must succeed reads the merge request's newest pipeline. Some settings put those two on different pipelines, so a failing cbxguard/review may not stop the merge. On a repository whose gate is on, the Console's Repositories page reads these settings and shows what it found:

Pipelines must succeedMerged results pipelinesMerge trainsConsole showsCan a failing status block?
OnOffOffEnforcedYes.
OnOnOffCan't block mergesNot reliably: the status misses the merged results pipeline.
OnEitherOnCan't block mergesNo: a train merges on its own pipeline.
OffAnyAnyNot requiredNo: nothing requires a pipeline to pass.

The fix for Can't block merges: open the project → Settings → Merge requests → Merge options, clear Enable merge trains if it is set, clear Enable merged results pipelines, and save. If the Console shows Not required, also turn on Pipelines must succeed, and clear those two options if the Console's steps list them. The Console re-reads these settings within 10 minutes, then the warning clears.

If you keep merged results pipelines or merge trains on, Guard's verdict stays advisory on that repository. The merge request still gets the note and the status, but nothing stops a merge when the status fails. Merged results pipelines and merge trains are GitLab Premium features. On a lower tier GitLab doesn't report them, so the Console shows Enforced and its detail says it could not read them.

Enforced doesn't cover the race above. It's a timing problem on one merge request, not a project setting, so the Console can't see it in advance.

GitLab: a review that couldn't run

A repository set to Grey, skipped (Choose what blocks) posts cbxguard/review as skipped when Guard couldn't review the change: the review failed, some Terraform folders could not be planned, or reviews are paused. Grey means not reviewed. It is neither a pass nor a block from Guard: whether the merge request can merge is up to two settings in the project's Settings → Merge requests → Merge checks:

  • Pipelines must succeed (only_allow_merge_if_pipeline_succeeds). With it off, nothing requires a pipeline to pass, and a grey merge request merges.
  • Skipped pipelines are considered successful (allow_merge_on_skipped_pipeline). With Pipelines must succeed on, GitLab counts a pipeline whose jobs were all skipped as passed only when this is on too.
Pipelines must succeedSkipped pipelines are considered successfulA merge request Guard couldn't review
OffEitherMerges.
OnOnMerges.
OnOffWaits: GitLab holds a pipeline whose only Guard status is skipped.

A skipped status counts with the rest of the merge request's pipeline. When your CI runs jobs in that pipeline and they pass, the pipeline succeeds and the merge request merges whatever the second setting says. When Guard's status is the pipeline's only job (a project with no CI on merge requests), the pipeline is skipped, and the second setting decides.

To let a merge request Guard couldn't review merge under Pipelines must succeed, turn on Skipped pipelines are considered successful and save. Guard never changes these settings for you. It reads them, and says what they do:

  • The Console. On a repository set to grey, with Pipelines must succeed on and Skipped pipelines are considered successful off, the repository's row in Repositories and its Gate settings say: "On this project a review that couldn't run blocks the merge, because 'Pipelines must succeed' is on. Turn on 'Skipped pipelines are considered successful' in GitLab (Settings › Merge requests) to let it merge." with a link to that page. If Guard couldn't read the project's settings (for example, its token can't read them), they say that instead and ask you to check both settings. The Console re-reads them within 10 minutes of a change.
  • The status. The grey status's description says "Merge is not blocked." only when the settings let it merge. When they hold it, it says "GitLab holds the merge: "Pipelines must succeed" is on and skipped pipelines don't count." When Guard couldn't read them, it says so, and promises neither.
  • The note. Guard's comment on the merge request says the same: a review that couldn't run opens "⚪ Not reviewed · GitLab holds the merge" instead of "⚪ Not reviewed · merge not blocked", and the comment carries the Console's sentence above.

Grey is never success: a change nobody reviewed never shows a green tick. If you would rather a review that couldn't run never holds a merge whatever the project's settings, choose Green, not blocking.

GitLab: new and existing repositories

Since November 2026, a GitLab repository you start watching starts on Grey, skipped. A repository you were already watching keeps the colour it had, so no merge changes on its own, and watching it again, a rename or a reconnected GitLab account doesn't change it either. Stopping watching a repository drops its settings, so watching it again later starts it on grey. GitHub repositories don't change: GitHub posts a neutral conclusion, which is never green.

While a GitLab repository is still on green, its row in Repositories (and its details) says: "A review that couldn't run shows green here. Switch to grey so it's clear nothing was checked." Choose Switch to grey to change it in one click. It is the same setting as When Guard cannot review in Gate settings, so only an organisation owner or admin can use it (members and viewers see it disabled), and the change appears in Ledger → Activity with who made it and the settings before and after.

Before you switch, the row says what grey would do to the merge on that project:

  • With Pipelines must succeed on and Skipped pipelines are considered successful off: "On this project grey blocks the merge when a review couldn't run, because 'Pipelines must succeed' is on. To keep it merging, turn on 'Skipped pipelines are considered successful' in GitLab (Settings › Merge requests) first." with a link to that page.
  • When Guard couldn't read the project's settings: it says so and asks you to check both settings first.
  • When the settings let a grey merge request merge, there is nothing to warn about, and the row shows the suggestion alone.

After the switch, the row says "Switched to grey." and, if the project holds a grey merge request, the Console's sentence from the list above. To go back, choose Green, not blocking in Gate settings and save.

GitLab: merge requests from a fork

On GitLab, a merge request from a fork is gated through your CI's plan upload, in a pipeline that runs in your project. Guard never posts on the fork, and nobody has to give Guard access to a contributor's fork.

GitLab reads a fork merge request's pipelines from the fork, so the cbxguard/review status Guard posts on your project's copy of the commit never reaches the merge request. What does is a merge request pipeline in your project, with the CI plan upload job in your own CI configuration: a member of your project runs it from the merge request's Pipelines tab, the job fails on a finding that gates the change, and Guard posts its check on that pipeline. Contributions from forks lists what to set up, including pointing your project's CI configuration at your default branch so the fork can't change the job, and what to read before you run a fork's pipeline.

Your project's pipeline for the merge requestThe noteThe check on the merge requestWith Pipelines must succeed on
Hasn't run yetAlways posted, even on a clean verdict, and it says the merge request is gated through your CI's plan uploadNoneThe merge request can't merge while it has no pipeline. A pipeline the fork runs on its own counts instead
RanAs usualYes, on that pipeline in your project, which everyone who can read your project seesA gating finding fails the job and blocks the merge; a clean plan lets it through

Before you merge, check that the merge request's latest pipeline is the one in your project. A pipeline the fork's owner runs in the fork later becomes the merge request's latest pipeline, and Pipelines must succeed then reads that one.

3. .cbx-guard.yml

Without a config, Guard finds every Terraform root in the repository and reviews the ones a change touches. A change to a shared module selects every root that uses it. Add .cbx-guard.yml at the repository root to choose roots and pass them variables.

Guard reads it from the default branch, never from the change. A pull request cannot exclude its own roots from review. So a change to the config applies to changes opened after it merges. Org admins can also set an override in the Console, which wins over the file.

version: 1                    # required
roots:                        # optional; when present, ONLY these roots are reviewed
  - path: envs/prod           # repo-relative directory ("." is the repository root)
    kind: terraform           # terraform (default) | kubernetes-manifests
    cloud: aws                # aws | azure | gcp | kubernetes
    scope: "123456789012"     # account / subscription / project / cluster id to resolve against
    varFiles: [prod.tfvars]   # relative to the root; must stay inside the repository
    vars: { environment: prod }  # passed as TF_VAR_*; a variable the root does not declare is ignored
    workspace: prod           # selected (created if missing) before the plan
    terraformVersion: "1.9.5" # quote it: YAML reads 1.10 as the number 1.1
  - path: envs/staging
    cloud: aws
ignore: ["examples/**"]       # globs over discovered roots (used when roots is absent)
maxRoots: 5                   # at most 10

The rules:

  • Every key is checked. An unknown key (a typo such as varfiles) or a bad value fails the review as review config invalid, with the field named. A config that is not understood never falls back to reviewing something else.
  • Without scope, a root resolves against every cloud account you connected.
  • varFiles and vars are how a root's required variables get values. Guard passes no other variables. A required variable without a default that neither supplies fails that root (missing variable).
  • More roots than maxRoots (or 10) fails the review as too many roots. Narrow it with roots or ignore.

4. Accept a known risk: .cbxguard/suppressions.yaml

Some findings are risks you have decided to accept, such as a bastion that is meant to be reachable. List them in .cbxguard/suppressions.yaml (or .cbxguard/suppressions.yml), each with a reason, and they stop blocking merges.

Guard reads it from the default branch, never from the change, the same rule as .cbx-guard.yml. A pull request cannot suppress its own finding. A suppression added in a pull request applies once that pull request merges. The note says when a change edits the file.

version: 1
suppressions:
  - rule: sg-ingress-public             # required: the rule that fired, with or without @version
    resource: aws_security_group.bastion   # required: plan address or resource URN; * matches anything
    root: envs/prod                     # optional: only findings from this root
    reason: "Bastion, VPN-only. Accepted by SecOps (SEC-112)"   # required
    expires: 2026-12-31                 # optional: a date (it applies through that day, UTC)
    finding: CBX-1180                   # optional label, not used for matching

A bare list of entries, without version and suppressions:, works too. That is the shape of the snippet the Console's Suppress button gives you, and policy: there is another name for rule:.

What a suppression does:

  • A suppressed finding does not gate. It is left out of the verdict's tier and does not count toward the check. It is still listed, as suppressed with its reason, in the pull-request note and on the PR's page in the Console. A change that is clean only because of suppressions still gets a note.
  • An expired entry stops applying. The finding blocks again, and the note names the entry that expired.
  • An invalid entry suppresses nothing. Examples are a missing reason, an unknown key, an expiry that is not a date, or a resource that is only *. The note and the Console name the entry and what is wrong, and the check summary says the file needs fixing. The other entries still apply. A file that cannot be read or parsed applies nothing and is reported the same way.
  • A finding takes the first entry that matches it, in file order. rule: sg-ingress-public matches every version of the rule. rule: sg-ingress-public@v1 matches that version only.
  • Suppressed findings are not added to the Alerts inbox.
  • A change to the file on the default branch applies to the next review. To apply it to an unchanged head now, use Retrigger in the Console.
  • Plans your CI uploads follow the same file. When cloudguard check --remote names the pull request (--forge, --pr-number, --head-sha), Guard reads the file from the default branch, with the same rules as its own review, and applies it to the uploaded plan. A suppressed finding is still printed, but it does not count toward the job's verdict or exit code, it does not turn the posted cbxguard/review check red, and it is not recorded as an open risk. The text report ends with a suppressed by .cbxguard/suppressions.yaml line per finding, and the --json output lists it under suppressions, with the entry and its reason. An upload that names no pull request names no repository, so nothing is suppressed. If Guard cannot read the file (for example, the forge is down or rate-limited), nothing is suppressed for that upload and the suppressions.error field says why: the job fails safe.

5. Known limits

Guard plans your code with no network and no credentials. That is what makes reviewing untrusted pull requests safe, and it rules out the following:

  • Data sources that call the cloud. data "aws_ami", aws_caller_identity, aws_vpc, aws_ssm_parameter, terraform_remote_state and the like cannot be read offline, so that root fails plan failed. For such roots, run terraform plan in your own CI, with your credentials, and upload the plan to Guard instead (the CI plan upload: cloudguard check --remote). Leave the root out of .cbx-guard.yml so the server-side review does not report it as failed.
  • Backend blocks are fine. A root that declares a backend (backend "s3" with its settings, an empty backend "s3" {} your CI fills in with -backend-config, or a Terraform Cloud cloud {} block) is reviewed like any other. Guard never reads your state: in its temporary copy of the root it swaps the backend for a local, empty one, so it needs no credentials and never contacts the backend. The one exception is a root with its own override file that sorts after zz_cbx_backend_override.tf (for example zzz_override.tf) and declares a backend or cloud block itself; rename that file or plan the root in CI. A later override file that only sets providers, variables or other settings is fine.
  • Provider blocks inside child modules. Guard makes the aws provider work offline in your root modules. A child module that configures its own provider "aws" block is not covered. Configure providers in the root and pass them to modules, which is also Terraform's own advice.
  • Providers beyond what the offline recipes cover. Guard plans AWS, Azure (azurerm, azuread, azapi), Google (google, google-beta), Kubernetes and Helm roots server-side, and only resource-only roots. A data source that calls the cloud, kubernetes_manifest and a remote Helm chart fail plan failed: plan those roots in your own CI and upload the plan. Any other provider is not planned server-side.
  • Remote modules are downloaded during init. A module from a private registry or a Git host Guard cannot reach fails init failed. Local modules (source = "../modules/x") work as long as they stay inside the repository.
  • Very large roots fail plan timeout or plan too large. Every root of a review shares a 12-minute budget.
  • Account-derived values (account id, ARNs built from it) are unknown in the plan. Guard only needs the shape of the change.

A root that cannot be planned never passes silently. The review lists it, and the check says it is partially reviewed: neutral on GitHub, never success. GitLab has no neutral state, so under a gate that fails open its status is success with the description "Partially reviewed: N root(s) not reviewed (not blocking)", or grey skipped when the repository sets When Guard cannot review to grey (GitLab: a review that couldn't run). A gate that fails closed, or a blocking tier, fails the check on both.

A review that could not run at all (a failed review) is never silent either. Guard posts one note on the pull request or merge request, with the reason and how to fix it, the same wording the Console shows. Re-running the review on the same head edits that note instead of adding another. The check text reads "Not reviewed: <reason>. Merge is not blocked." (on GitLab the status is success under a gate that fails open, or grey skipped when the repository sets When Guard cannot review to grey, and then the text says what the project's merge settings do to it: GitLab: a review that couldn't run). A gate that fails closed says "Merge is blocked until it is reviewed." A clean review stays one line, with no note.

6. Check it works

Open a small test change on a watched repository, such as a tag edit on a resource. Within a minute or two you should see cbxguard/review go running / in progress, and then finish. Read its title (GitHub) or its description (GitLab), not only its colour:

cbxguard/review readsWhat happened
Passed: no dangerous public exposure, and no commentThe review ran and the change is clean. Set-up works.
Not reviewed: …. Merge is not blocked., and one note that says whyThe review could not run. On GitLab the status is still success under a gate that fails open, because GitLab has no neutral state. Fix what the note says, then push again or select Retrigger in the Console.
Advisory: … or Blocked: …, and one commentThe review ran and found something. The comment lists the findings.
Partially reviewed: …Some roots could not be planned. See Known limits.
Not reviewed: reviews are paused for this workspace …The gate works, but reviews are paused. See Reviews paused in section 2.

A green success on GitLab with no note is not enough on its own: check that the description is Passed: no dangerous public exposure. If nothing appears at all:

  • GitLab: the repository's webhook badge should read Active or Manual webhook, with a recent last delivery. Permission denied means Guard's account is not a Maintainer (see above).
  • GitHub: check that the App installation includes the repository.
  • Both: the repository must be watched. The PR's page in the Console shows the review's outcome, including why it failed.