CloudBoosterDocs

Connect an AWS account

Create the read-only IAM role CloudBooster Guard reads your AWS account through: what it can do, how it is protected, and how to disconnect.

Connect an AWS account

CloudBooster Guard reads your AWS account through one read-only IAM role that you create with a CloudFormation stack. Guard's own AWS account assumes that role when it needs to read. You hand over no access key and no password, and you can take the access away at any time by deleting the stack. To show your security team what the role can access and how to remove it, give them What Guard can access in AWS, and how to remove it.

Choose how closely Guard watches

Guard gets the same read-only role in your account either way. You choose how closely it watches:

Read-onlyRead-only + live changes (recommended)
What Guard readsYour resources, scanned about every 8 hours.Your resources, scanned about every 8 hours, and your CloudTrail trail.
Merge requestsA verdict on every Terraform merge request.The same.
A change made in the AWS console or CLIShows up at the next scan.Shows up within about 15 minutes, with who made it and when.
An alert when someone opens access outside a merge requestNo.Yes.
What you create in AWSOne CloudFormation stack.One stack, or two if the account has no trail Guard can read.
AWS costScans add S3 request fees to your AWS bill.Scans and reading the trail add S3 request fees to your AWS bill. A new trail also adds S3 storage for its logs.

A read-only account never asks for CloudTrail. You can turn on live changes later from the account's page, without reconnecting (see Turn on live changes later).

What the role can do

The stack creates one IAM role, named cbx-guard-readonly. It carries AWS's managed ViewOnlyAccess job-function policy, which lists and describes your resources, and four inline policies. These are every action the inline policies allow:

Inline policyActionsWhy
cbx-guard-cloudtrail-readcloudtrail:LookupEvents, cloudtrail:GetTrailStatus, cloudtrail:DescribeTrails, cloudtrail:GetEventSelectors, s3:GetObject, s3:ListBucket, kms:DecryptReads your existing CloudTrail and its log files. 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:GetAccountAuthorizationDetailsGrades a bucket on 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 a role allowed far more than it needs, such as s3:* on every resource. 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. These calls work 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.

Every action applies to all resources (*), except the last row and the narrowed S3 read below. Unless you give the stack your trail bucket, s3:GetObject, s3:ListBucket and kms:Decrypt (through S3) are allowed on any bucket in the account, because Guard has not found your trail yet. Guard uses them only to read CloudTrail log files.

Least privilege from the first deploy. The stack has two optional parameters. Set TrailBucketName to the S3 bucket your CloudTrail trail writes to, and s3:GetObject, s3:ListBucket and kms:Decrypt reach that bucket only from the moment the role exists. If the trail encrypts its log files with a KMS key, also set TrailKmsKeyArn to that key's ARN (arn:aws:kms:<region>:<account>:key/<id>, not an alias), and kms:Decrypt works with that key only. Leave both empty and Guard finds the trail bucket itself; you can still narrow the role after connect (below). A bucket or key that is not your trail's leaves the role unable to read the trail's log files. When Guard knows what you set, it does not start watching: it names the trail's bucket or key and the stack update that fixes it. Set the parameter to the value it names, or leave it empty, then validate again.

Narrow to my trail bucket. Once Guard has found your trail, the account's page offers one stack update that sets the stack's TrailBucketName parameter to the trail's bucket. From then on s3:GetObject, s3:ListBucket and kms:Decrypt reach that bucket only. A TrailKmsKeyArn the stack already has is kept. The role keeps its name, its trust and its ARN, so Guard keeps reading without a reconnect. If the stack holds anything besides what a Guard connect stack creates, the update stops, names it and changes nothing, because replacing the template would delete it. ViewOnlyAccess still lets the role list object names in other buckets, but not read what is in them. kms:Decrypt also still works, through S3, on log files a trail encrypts with its own KMS key; since s3:GetObject reaches only the trail's bucket, objects in other buckets stay unreadable.

A stack created before Guard read IAM policies lacks iam:GetAccountAuthorizationDetails. The scan still runs, says IAM permissions not checked: update your stack, and checks everything except IAM role permissions. Update the stack to the current template to add the action.

The role has no write action. The stack creates no EventBridge rule, no AWS Config recorder, no trail and no bucket.

Automatic connect adds a callback. When the Console connects the stack for you (it waits with we'll connect it automatically), the stack it launches also creates a small Lambda function, 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. The template that Manual setup downloads creates the read-only role only.

How the role is protected

  • One trusted account. The role's trust policy allows only Guard's own AWS account to assume it.
  • An External ID. The trust policy also requires an External ID, which starts with cbx-. The Console generates a new one for each account you connect. It stops another Guard customer from pointing Guard at your role (AWS calls this the confused-deputy problem). The External ID is not a credential: without the trust on Guard's own account it opens nothing. It is not hidden either. Open CloudFormation stack passes it as a stack parameter, and the template that Manual setup downloads writes it into the role's trust policy, so anyone in your account who can read the stack or its template can see it.

Connect the account

  1. In the Console, open Cloud accounts, select Connect account, and pick AWS.
  2. On Connect an AWS account, choose Read-only or Read-only + live changes. Live changes are selected to start with.
  3. Give the account a nickname if you like, pick its main region, and answer Is this a production account? with Production or Not production (see Marking an account production or non-production). The answer is required before the stack is opened, so the first scan is graded for the right environment. You can change it later on the account's Classification tab. Select Continue to AWS.
  4. Select Open CloudFormation stack. The AWS console opens the stack with its parameters filled in. Create it in the account you are connecting.
  5. Stay on the page. It reads Waiting for the stack to finish — we'll connect it automatically. When the stack finishes, it tells Guard the role's ARN, and the card shows Connection successful. Creating the role can take a couple of minutes; select Check now to look again.

Manual setup. If you would rather create the stack yourself, or the automatic step does not pick it up, open Manual setup on the card. Download the CloudFormation template, create the stack from it in the AWS console, then paste the RoleArn from the stack's Outputs and select Finish — start watching. Both ways create the same role.

With Read-only, the account is connected as soon as the role works: there is no CloudTrail step. With Read-only + live changes, Guard then looks for a CloudTrail trail the role can read. If there is none, the card offers a second stack that creates one, which adds S3 storage and request fees, before watching starts.

Changing the name, region, classification or how closely Guard watches before you finish issues a new External ID. If you already created a stack for the old one, delete it and create it again.

To connect every account of an AWS Organization at once, pick AWS Organization instead of AWS in step 1. One stack in the management account rolls the same read-only role out to all member accounts, or to the OUs you choose, through a StackSet.

Turn on live changes later

An account connected read-only shows Read-only in its header. To turn on live changes, open the account from Cloud accounts and select the Live changes tab. Only an owner or admin can turn them on.

  1. Under Which trail should Guard read?, choose one:
    • Use the trail you already have. Offered only when the read-only role can already read a trail in the account. The option names it by its name, region and bucket. Reading it adds S3 request fees to your AWS bill.
    • Create a new trail for Guard. One more CloudFormation stack, which creates a multi-region trail and a private log bucket. Its logs need S3 storage, and reading them adds S3 request fees to your AWS bill.
  2. Select Turn on live changes. With your own trail, live changes start at once. With a new trail, the AWS console opens the stack in a new tab. Create it and keep the Console open: once the stack finishes, Guard finds the trail and turns live changes on by itself, usually within a couple of minutes.

Once live changes are on, the header shows Live changes, and the tab shows the account's real-time status. The Console has no switch to go back to read-only.

After you connect

Guard scans the account: it builds an inventory of your resources and of what can reach them from the internet. The Landscape and Context views show the result. Until the first scan finishes, Guard cannot tell whether a resource is reachable, so a change to it is graded Watch, never passed as safe.

Pull-request reviews resolve each change against the accounts you connected. Without a connected account, a review fails with no cloud account.

Disconnect

Open Cloud accounts, choose the account, and select Disconnect account on the Disconnect tab. Guard stops reading the account at once. Then delete the CloudFormation stack, which removes the role, so the account no longer trusts Guard at all. Deleting the stack on its own also ends the access: Guard can no longer assume the role, so it can no longer read the account.

On this page