What CloudBooster Guard can access on GitLab, and how to remove it
The GitLab api scope Guard holds, whose identity it carries, what Guard reads and writes, and how to remove the access.
What CloudBooster Guard can access on GitLab, and how to remove it
Guard connects to GitLab with one credential, which holds GitLab's full api scope. This page
says whose identity that credential carries, what Guard reads and writes with it, what it never
does, and how to remove the access. To connect, see Connect a repository.
The scope: api
GitLab has no narrower scope that can also post merge-request notes, commit statuses and project
webhooks. So every way of connecting holds api: read and write access to everything the
credential's account can reach in GitLab. Guard limits itself to the projects you choose to
watch. GitLab does not limit the credential that way. What bounds it is the account behind it: with
Quick it is everything you can reach, and picking a group in the Console only filters the list
of projects Guard shows and watches. With a service account it is the group you pick, and
with a group or project access token it is that group or project.
Who acts
You choose how to connect. Each choice shows who Guard will act as before you grant anything:
| Option | Acts as | Credential |
|---|---|---|
| Quick: acts as you (OAuth, gitlab.com) | You: the GitLab user who clicked Continue. Everything Guard posts shows your name, and it can do what you can in every group you can reach. It does not create a service account. | An OAuth grant that Guard renews itself. It has no fixed expiry, and it stops when you revoke the app, leave the group or lose access to the project. |
| Service account in this subgroup (after an OAuth connect) | A service account, cbx-guard-bot-<id>, that Guard creates in your top-level group, because GitLab creates service accounts there only. You sign in once as an Owner of the top-level group, then pick a group or subgroup. It is a Maintainer on the group you pick only, and on no group above it. | A token that Guard mints, which expires after 365 days. The Console warns you before it does. Guard revokes your OAuth grant, and on a later reconnect it revokes the account's older tokens. Needs GitLab Premium or Ultimate on gitlab.com. |
| Bring a group or project access token (narrowest) | The bot user GitLab creates for the token, not a person. It reaches only what the token reaches: a group and its subgroups, or one project. A personal access token also works; it then acts as its user. | The token you paste, with the api scope and the Maintainer role. It lives as long as the expiry you set in GitLab. Works on every GitLab tier. |
| Self-managed GitLab | The user that owns the token you paste. | The same as a pasted token. OAuth is for gitlab.com only. |
Whoever acts must be a Maintainer on every project you watch, because GitLab lets only Maintainers create webhooks.
The service account is a Maintainer on the group you pick only, and on no group above it, so it reaches every project under that group and nothing outside it. If it still belongs to a group from an earlier connect, Guard removes it from that group first. If GitLab refuses either change, nothing is upgraded and your connection keeps working. Without a service account or a bot token, Guard stops working for the projects when the person who connected leaves.
What Guard reads
- The files of a watched project at the commit under review: the changed Terraform and the repo config.
- Merge request metadata and diffs.
- The state of the project's merge checks, to show whether your gate can block a merge.
What Guard writes
On the projects you watch, and nowhere else:
- A project webhook on each watched project, for merge request and note events. Push events are off. Each hook carries its own secret token, and Guard stores only a hash of it.
- A
cbxguard/reviewcommit status on the reviewed commit (andcbxguard/ci-planwhen your CI uploads a plan), in the watched project. For a merge request from a fork it is still your project, never the fork: the check reaches that merge request through a pipeline that runs in your project (Contributions from forks). - One review note per merge request, edited in place, and inline threads on risky changed lines. Guard resolves a thread when a later push fixes it.
- Emoji reactions on its own review comments.
What it never does
Guard's code never pushes commits, creates branches, opens merge requests, merges, or changes
project or group settings, members or protections. The only membership it changes is its own
service account's: it adds the account to the group you pick, removes it from any other group it
still belongs to, and removes it from the group again on Disconnect. It never touches a project you
did not watch, including a contributor's fork of one you did.
The credential itself is not limited to that, because api is not. The rest is what Guard's
code does.
How to remove it
Do these in order, because removing the webhooks needs the credential to still work:
- Disconnect in the Console. Open Repositories and select Disconnect (an organisation admin or owner). Guard removes the webhook from each watched project, revokes the credential it holds, and cancels the reviews still queued. For a service account it also takes the account out of the group and revokes all its tokens, unless another GitLab connection of your organisation still uses it. Your projects and repositories stay as they are. The Console says whether the revoke worked, and names the group the account could not leave if it did not.
- Revoke it in GitLab, if the Console says the revoke failed, or to be sure:
- OAuth: in GitLab, Preferences → Applications → Authorized applications, then Revoke next to CBX Guard.
- Pasted token: Settings → Access tokens on the group or project, or Preferences → Access tokens for a personal access token, then Revoke.
- Service account: Disconnect already takes it out of the group and revokes all its tokens. If the Console says it could not be fully removed, take it out of the group it names under Manage → Members. Guard does not delete the account itself: it stays in your top-level group with no membership and no tokens, and you can delete it there.
- Check the webhooks. In each watched project, Settings → Webhooks should list no Guard hook.
If you revoke in GitLab first, Guard can no longer reach GitLab with it, and the Console says the connection needs to be reconnected and reviews stop. It cannot remove the webhooks any more, so delete them yourself under Settings → Webhooks.
Connecting and disconnecting GitLab are recorded under Ledger → Activity with who did it and when.