Follow the instructions below to add an AWS account using a cross-account role. Use
a cross-account role if you want to add multiple AWS accounts.
The instructions below assume you want to add AWS accounts with these names:
-
AWS Primary Account
-
AWS Account A
![]() |
TipYou can also add a cross-account role through the Deep Security API. See Add the account through the API for details.
|
First, add the AWS Primary Account
-
Complete all the tasks in Add an AWS account using a manager instance role to add the AWS Primary Account.
Next, find the AWS Primary Account identifier
-
Make sure you're logged in to the AWS Primary Account.
-
Go to the IAM service.
-
Click Roles.
-
Find the manager instance role that you created in Add an AWS account using a manager instance role. For example:
Deep_Security_Manager_Instance_Role
-
Select the role in the list to reveal its details.
-
Look for the Role ARN field at the top of the page. Its value is similar to:
arn:aws:iam::1111111111:role/Deep_Security_Manager_Instance_Role
-
Note the role's account ID in the ARN. It is the number (
1111111111
). You'll need it later to create the cross-account role.
-
Make sure you're logged in to the AWS Primary Account.
-
At the top-right of AWS, click Support > Support Center.
-
Note the Account Number shown at the top-right (
1111111111
, in this example). You'll need it later to create the cross-account role.
Next, retrieve the external ID
-
Log in to Deep Security Manager.
-
Click Computers at the top.
-
Click Add > Add AWS Account. A wizard appears.
-
Click the eye icon next to the obscured external ID to reveal it. For more on this ID, see What is the external ID?
Note
If you don't see the eye icon, it might be because your Deep Security Manager AMI is out of date. To refresh it, perform a one-click upgrade. -
Copy the external ID to a secure place. You will need it in the next step to configure AWS Account A and any other AWS accounts you want to add.
-
(Optional.) Close the wizard and the manager.
Next, configure an IAM policy for AWS Account A
![]() |
NoteThis IAM policy is the same as the policy for the AWS Primary Account, except it does
not require the sts:AssumeRole permission.
|
-
Make sure you're logged in to AWS Account A.
-
In the Amazon Web Services Console, go to the IAM service.
-
In the left navigation pane, click Policies.
Note
If this is your first time on this page, you'll need to click Get Started. -
Click Create policy.
-
Select the JSON tab.
-
Copy the following JSON code into the text box:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "cloudconnector", "Action": [ "ec2:DescribeImages", "ec2:DescribeInstances", "ec2:DescribeRegions", "ec2:DescribeSubnets", "ec2:DescribeTags", "ec2:DescribeVpcs", "ec2:DescribeAvailabilityZones", "ec2:DescribeSecurityGroups", "workspaces:DescribeWorkspaces", "workspaces:DescribeWorkspaceDirectories", "workspaces:DescribeWorkspaceBundles", "workspaces:DescribeTags", "iam:ListAccountAliases", "iam:GetRole", "iam:GetRolePolicy" ], "Effect": "Allow", "Resource": "*" } ] }
Note
The "iam:GetRole
" and "iam:GetRolePolicy
" permissions are optional, but recommended because they allow Deep Security to determine whether you have the correct policy when an update to the manager occurs that requires additional AWS permissions. -
Click Review policy.
-
Give the policy a name and description. Example name:
Deep_Security_Policy_Cross
. -
Click Create policy. Your policy is now ready to use.
Next, create a cross-account role for AWS Account A
-
Make sure you're logged in to AWS Account A.
-
Go to the IAM service.
-
In the left navigation pane, click Roles.
-
In the main pane, click Create role.
-
Click the Another AWS account box.
-
In the Account ID field:
-
Enter the account ID of AWS Primary Account that you noted in a previous step. For example:
1111111111
-
-
Next to Options, enable Require external ID. In the External ID field, enter the external ID you retrieved from the manager earlier.
-
Click Next: Permissions.
-
Select the IAM policy that you just created (the example name was
Deep_Security_Policy_Cross
) and then click Next: Review. -
On the Review page, enter a role name and description. Example role name:
Deep_Security_Role_Cross
. -
On the main role page, search for the role you just created (
Deep_Security_Role_Cross
). -
Click it.
-
Find the Role ARN field at the top. It looks similar to:
arn:aws:iam::2222222222:role/Deep_Security_Role_Cross
-
Note the Role ARN value. You'll need it later.
You now have a cross-account role under AWS Account A that includes the correct policy
and references the
manager instance role of
the AWS Primary Account.
Next, add AWS Account A to the manager
-
Log in to Deep Security Manager.
-
Click Computers at the top.
-
Click Add > Add AWS Account.
-
Select Use Cross Account Role.
-
Enter AWS Account A's Cross Account Role ARN. You noted this earlier, when you created the cross-account role. In this example, it is
arn:aws:iam::2222222222:role/Deep_Security_Role_Cross
-
If AWS Account A includes Amazon WorkSpaces, select Include Amazon WorkSpaces to include them with your Amazon EC2 instances. By enabling the check box, you ensure that your Amazon WorkSpaces appear in the correct location in the tree structure in Deep Security Manager and are billed at the correct rate.
-
Click Next. AWS Account A's Amazon EC2 instances and Amazon WorkSpaces are loaded.
You have now added AWS Account A to the manager.
After completing the above tasks, proceed to Install the
agent on your Amazon EC2 and WorkSpace instances if you have not done so
already.
Add the account through the API
-
If you don’t yet have the external ID, call the Deep Security
/api/awsconnectorsettings
endpoint to retrieve it (theExternalId
parameter). For more on this ID, see What is the external ID? -
In AWS, specify the external ID in your cross-account role's IAM trust policy.
-
Use the
/api/awsconnectors
API endpoint to add AWS accounts to Deep Security. Do not use the/rest/cloudaccounts/aws
API because it has been deprecated. See Action required if you are using cross account roles with the API /rest/cloudaccounts/aws for details on how long the/rest/cloudaccounts/aws
API will continue to be supported and tips on how to move to the new endpoint.