CloudBoosterDocs

What CloudBooster Guard can access in AWS, and how to remove it

Every permission of the read-only IAM role, the one that is wider than it sounds, how to see every call in your own CloudTrail, and how to remove the access.

What CloudBooster Guard can access in AWS, and how to remove it

Guard reads an AWS account through one IAM role that you create with a CloudFormation stack. It has no write action. This page lists everything the role can do, the one permission that is wider than it sounds, what else the stack creates, how to see every call Guard makes in your own CloudTrail, and how to remove the access. To set the connection up, see Connect an AWS account.

Who can use the role

Only Guard's own AWS account can assume the role, and only when it presents your External ID. The role's trust policy names that one account, and the template you launch shows its ID. The External ID starts with cbx- and is new for each account you connect. Guard creates no access key, no IAM user and no password in your account.

The role is named cbx-guard-readonly. Each time Guard reads, it assumes the role under the session name cbx-guard-onboarding.

What the role can read

The role attaches AWS's managed ViewOnlyAccess job-function policy and four inline policies. A role that the AWS Organization connect creates has a fifth, cbx-guard-org-accounts-read, in the table below. AWS owns the text of ViewOnlyAccess: it lists and describes your resources (names, settings and tags) and is built not to read the data inside them. The inline policies below are every action the stack adds.

Inline policyActionsWhy
cbx-guard-cloudtrail-readcloudtrail:LookupEvents, cloudtrail:GetTrailStatus, cloudtrail:DescribeTrails, cloudtrail:GetEventSelectors, s3:GetObject, s3:ListBucket, kms:DecryptReads your CloudTrail to see what changed, who changed it and when. kms:Decrypt works only through S3, for a trail encrypted with a KMS key.
cbx-guard-posture-reads3:GetBucketPolicy, s3:GetBucketPolicyStatus, s3:GetBucketAcl, s3:GetBucketPublicAccessBlock, s3:GetAccountPublicAccessBlock, iam:GetAccountAuthorizationDetailsTells whether a bucket is public from its real policy, ACL and Block Public Access settings, and reads the policy documents of the account's IAM users, groups and roles to flag one allowed far more than it needs. Policy documents only, never object data.
cbx-guard-organizations-readorganizations:DescribeOrganization, organizations:ListRoots, organizations:ListParents, organizations:ListPolicies, organizations:ListPoliciesForTarget, organizations:ListTargetsForPolicy, organizations:DescribePolicyReads the service control policies above the account, which limit what a change can do. AWS answers these calls only from the management account or a delegated administrator. Anywhere else Guard records them as not granted.
cbx-guard-log-archive-assumests:AssumeRole, sts:TagSession, on roles named cbx-guard-log-archive-read onlyReads an organization trail kept in a separate log-archive account, through a role you create there. It does nothing when no such role exists.
cbx-guard-org-accounts-read (AWS Organization connect only)organizations:ListAccounts, organizations:ListAccountsForParent, organizations:DescribeAccountLists the accounts of your organization, so Guard can connect each one that has the role. AWS answers these calls only from the management account or a delegated administrator.

Every action applies to all resources (*), except the cbx-guard-log-archive-assume row.

Wider than it sounds: S3 object read on any bucket, unless you narrow it

Guard uses s3:GetObject and s3:ListBucket only to fetch CloudTrail log files. On a stack created with its trail parameters empty, the permission itself is not limited to the trail's bucket. The role could read any object in any bucket in the account, such as backups or Terraform state, and kms:Decrypt works with any key that S3 uses on its behalf.

Guard's own code reads only the trail's log files, but your security team should know what the role is allowed to do, not only what Guard does. The stack narrows it in two ways:

  • From the first deploy. Create the stack with TrailBucketName set to the bucket your trail writes to. s3:GetObject then reaches objects in that bucket only, and s3:ListBucket that bucket only. If the trail encrypts its log files with a KMS key, also set TrailKmsKeyArn to the key's ARN (not an alias): kms:Decrypt then works with that key only, and still only through S3. With both set, the role never had the wider read. If either is not your trail's, the role cannot read the trail; when Guard knows what you set, it does not start watching and names the value to set instead.
  • After connect. Leave both empty and Guard finds the trail itself. The account's page then offers one stack update that sets TrailBucketName to the trail's bucket.

Narrowed, ViewOnlyAccess still lets the role list object names in other buckets, but not read what is in them. Your own controls still apply to the role. A bucket policy that explicitly denies the role cbx-guard-readonly, or a service control policy, overrides the role's allow. If you add one, leave the CloudTrail bucket readable, or Guard can no longer read your trail.

What the role can never do

  • No write action. No inline policy grants a Put, Delete, Create, Update, Attach or Detach action. Guard cannot create, change or delete anything in your account.
  • No keys, users, rules or recorders. The stack creates no access key, no IAM user, no EventBridge rule, no AWS Config recorder, no trail and no bucket.

What else the stack creates

  • AWS Organization connect: the same role in every account. One stack in the management account (or a delegated StackSets administrator) creates this role there and a service-managed StackSet, cbx-guard-readonly, that creates the same role, with the same External ID and the same policies, in every account of the OUs you chose. Auto-deployment gives accounts that join those OUs later the role too. This stack has no callback and no second stack, and it is named cbx-guard-organization when you used the quick-create link.
  • Automatic connect only: a callback. When the Console connects the stack for you, the stack also creates a small Lambda function (CBXGuardCallbackFunction), an execution role for it that can only write the function's own logs (AWSLambdaBasicExecutionRole), and a custom resource that runs it. When the stack is created or updated, the function sends the new role's ARN, your account ID, the region and the External ID to Guard, so the Console connects the account without a paste. It holds no credentials. The template that Manual setup downloads creates the role only.
  • Optional: a second stack. If you chose live changes and the account has no CloudTrail trail Guard can read, the Console offers a second stack, cbx-guard-cloudtrail. An account connected read-only is never offered it until you turn on live changes. It creates a multi-region trail and a log private S3 bucket in your account. It is separate, and you choose whether to create it. The first trail's management events are free. You pay for the S3 storage of the logs, which a lifecycle rule expires. Reading the logs adds S3 request fees to your AWS bill.

See every call Guard makes

Everything Guard does in your account runs as the role, so it is in your own CloudTrail. In CloudTrail Event history, filter on User name cbx-guard-onboarding (the session name). In CloudTrail Lake or Athena, filter on:

userIdentity.sessionContext.sessionIssuer.userName = "cbx-guard-readonly"

You should see the AssumeRole that starts each session, then only Describe*, List* and Get* calls and LookupEvents. S3 reads of your CloudTrail log files show up only if you log S3 data events, and Decrypt shows up when KMS encrypts your trail. If you use an organization trail, you also see the role assume cbx-guard-log-archive-read. An action outside these is worth a question to us, and deleting the stack ends it.

How to remove it

  1. Delete the stack in CloudFormation. It is named cbx-guard-connect when you used the automatic link, cbx-guard-readonly when you used the manual quick-create link, and whatever you named it when you created it from the downloaded template. Deleting it removes the role, the callback Lambda and its role. Guard can no longer assume the role, so it can no longer read the account. For an AWS Organization, delete the stack in the management account (or the delegated administrator) instead: cbx-guard-organization when you used the quick-create link, or the name you gave the downloaded organization template. It is not the single-account stack of the same name as the StackSet. Deleting it removes the role there and the cbx-guard-readonly StackSet, which removes the role from every member account and stops new accounts from getting it.
  2. Disconnect the account in the Console. Open Cloud accounts, choose the account, and select Disconnect account on the Disconnect tab. For an organization, each member account is its own entry under Cloud accounts, so do this for each one. Guard forgets the role and stops reading the account at once. Disconnecting asks for a recent second factor.
  3. Delete cbx-guard-cloudtrail too, if you created it. It is a separate stack, and deleting the connect stack does not remove it.
  4. Delete cbx-guard-log-archive-read in the log-archive account, if you created it for an organization trail.

Do the steps in either order. Step 1 ends the access, and step 2 makes Guard forget the account. Guard cannot delete a stack in your account for you, because its access is read-only by design.

Questions for your security team

  • Can Guard change my account? No. The role has no write action.
  • What is the widest thing it can read? Any object in any S3 bucket of the account, because the S3 read is not limited to the trail's bucket. See above.
  • How do we see what it does? Your CloudTrail records every call under the role cbx-guard-readonly.
  • How do we stop it? Delete the stack. The role no longer exists, so nothing can assume it.