How to connect your AWS account to Cloud Accounts if you cannot use the stack template.
Some AWS accounts do not allow the use of stack templates to deploy resources within
the cloud environment. This is usually due to security policies which prevent the
automatic creation of IAM policies and roles required by the deployment script
within the stack template.
To connect an AWS account manually, leverage the API resources on the Automation Center.
Important
|
Procedure
- Generate and download the stack template from Cloud Accounts either from the
Trend Vision One console or by calling an API.
-
Access the Trend Vision One console and create the template.
-
In the Trend Vision One console, go to
-
Click Add Account.
-
On the Deployment Type screen, select CloudFormation and Single AWS Account.
-
Click Next.
-
Specify the Account name, Description, and select the AWS region for deployment.
-
If you have more than one Server & Workload Protection Manager instance, select the instance to associate with the connected account and click Next.
-
Click Next without configuring the Features and Permissions screen.
-
Click Download and Review Template.
Note
The Account Name and Description fields are not exported to the review template. You can provide these parameters when calling the connect account API. -
-
Call an API to retrieve the template.
-
Locate the Get AWS CloudFormation template API on the automation center.
-
Locate the
query_params
strings. -
For
awsRegion
, provide the AWS region where you want to deploy the stack template and Core Features. The default region is based on your Trend Vision One region. -
For
features
andfeatureAwsREgions
, leave the parameters blank. -
Save your changes and call the API.The API returns the following:
-
templateUrl
: The URL to download the template. -
visionOneOidcProviderUrl
: A required parameter for deploying the template. -
createStackUrl
: URL of the AWS CloudFormation console pointing to the CloudFormation template of Trend Vision One.
-
-
Download the template.
-
-
- Access the AWS console.
- Add Trend Vision One as an identity provider.
- In the AWS console, open the Identity and Access Management (IAM) service.
- Go to .
- Click Add provider.The Add an Identity provider screen opens.
- In the Configure provider section, select OpenID Connect.
- For provider URL, type or paste the Provider
URL.
-
If you used the API to call the template, copy and paste the
visionOneOidcProviderUrl
parameter the API returned. -
If you downloaded the template, type cloudaccounts-{region}.xdr.trendmicro.com where
{region}
is your Trend Vision One region (us, eu, au, sg, in,
orjp
)For example, if your Trend Vision One region is the United States, yourvisionOneOidcProviderUrl
is cloudaccounts-us.xdr.trendmicro.com
-
- For Audience input
arn:aws:iam::${AWSAccountId}:root.Replace
${AWSAccountId}
with your AWS account ID. - Click Get thumbprint.
- Click Add provider.The provider is added to the Identity providers list.
- Click the name for the provider you created.The provider details screen opens.
- Copy the provider ARN for use when creating the Role in a later step.
- Locate the Thumbprints section and click Manage.
- Delete the thumbprint generated when creating the provider and paste
the following thumbprints.Click Add thumbprint to add each new line.
-
9e99a48a9960b14926bb7f3b02e22da2b0ab7280
-
9565AD13689C2C4B4F018BE31767084D197F2692
-
8CF427FD790C3AD166068DE81E57EFBB932272D4
-
F21C12F46CDB6B2E16F09F9419CDFF328437B2D7
-
- Click Save changes.
- Add the Trend Vision One policies.
- In the Identity and Access Management service, go to .
- Click Create policy.
- For Policy editor, select JSON.
- Copy and replace the
Statement
parameter using the same parameter fromVisionOnePolicyPart1
in your downloaded template file.You can also click this link to view and copy the JSON code directly.Important
Make sure to keep the second line of the code"Version": "2012-10-17"
. Deleting the line might cause the policy to not work correctly. - Click Next.
- For Policy name, type VisionOnePolicyPart1.
- Click Create policy.The policy is created and the Policies screen appears.
- After the policy is created, click Create policy from the Policies screen.
- For Policy editor, select JSON.
- Copy and replace the
Statement
parameter using the same parameter fromVisionOnePolicyPart2
in your downloaded template file.You can also click this link to view and copy the JSON code directly.Important
Make sure to keep the second line of the code"Version": "2012-10-17"
. Deleting the line might cause the policy to not work correctly. - Click Next.
- For Policy name, type VisionOnePolicyPart2.
- Click Create policy.The policy is created and the Policies screen appears.
- Add the Trend Vision One role.
- In the Identity and Access Management service, go to .
- Click Create role.
- For Trusted entity type, select
Custom trust policy.The Custom trust policy JSON editor appears.
- Replace the placeholder code with the following JSON code:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Federated": "${visionOneOIDCProvider}" }, "Action": [ "sts:AssumeRoleWithWebIdentity", "sts:SetSourceIdentity" ], "Condition": { "StringEquals": { "${visionOneOIDCProviderURL}:aud": "arn:aws:iam::${AWSAccountId}:root", "${visionOneOIDCProviderURL}:sub": [ "urn:visionone:identity:${visionOneRegion}:${visionOneAccountID}:account/${visionOneAccountID}" ] } } } ] }
- Replace the strings for the following parameters:ParameterDescriptionExample
"Federated"
Replace"${visionOneOIDCProvider}"
with the provider ARN for the provider you created.For example, if your Trend Vision One region is the United States, the ARN follows the format "arn:aws:iam::1xxxxxxxxxx1:oidc-provider/cloudaccounts-us.xdr.trendmicro.com""StringEquals"
Replace both instances of"${visionOneOIDCProviderURL}"
with the value used when you created the provider.For example, if your Trend Vision One region is the United States, use cloudaccounts-us.xdr.trendmicro.comFor the string"arn:aws:iam::${AWSAccountID}:root"
, replace${AWS::AccountID}
with your AWS account ID.The string should follow the format "arn:aws:iam::1xxxxxxxxxx1:root"In the string starting with"urn:visionone:identity:..."
, replace the following parameters:-
${visionOneRegion}
: Your Trend Vision One region (us, eu, au, sg, in,
orjp
) -
${visionOneAccountID}
Your Trend Vision One business ID. Make sure to replace both instances.
If your Trend Vision One region is the United States, the string looks like "urn:visionone:identity:us:1#####1:account/1#####1" -
- Click Next.
- On the Add permissions screen, search for the policies you created and select both.
- Click Next.
- On the Name, review, and create screen, type VisionOneRole for the Role name.
- Under Step 3: Add tags, add the following
tags.KeyValueVisionOneFeaturesBaseVisionOneFormationStackNameVision-One-Cloud-Account-ManagementVisionOneFormationStackRegionInput the AWS region where you want to deploy the resources. For example, us-east-1.
- Click Create role.
- Once creation completes, click on the role name for the role you created.
- In the role details screen, copy the ARN to use with the add account API in a later step.
- Connect your AWS account to the Cloud Accounts app using the Add Account
API.
- Access the API from the Automation Center, or copy the
following code to customize.
import requests import json url_base = 'https://api.xdr.trendmicro.com' url_path = '/beta/xdr/cam/awsAccounts' token = 'API Keys' query_params = {} headers = { 'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json;charset=utf-8' } body = { 'roleArn': 'YOUR_ROLEARN (string)', 'name': 'YOUR_NAME (string)', 'description': 'YOUR_DESCRIPTION (string)', 'features': 'YOUR_FEATURES (array)', 'connectedSecurityServices': [ { 'name': 'YOUR_NAME2 (string)', 'instanceIds': 'YOUR_INSTANCEIDS (array)' } ] } r = requests.post(url_base + url_path, params=query_params, headers=headers, json=body) print(r.status_code) for k, v in r.headers.items(): print(f'{k}: {v}') print('') if 'application/json' in r.headers.get('Content-Type', '') and len(r.content): print(json.dumps(r.json(), indent=4)) else: print(r.text)
- Provide the values for the following parameters in the API code.ParameterValue
roleArn
name
The name of the account as it appears in the Cloud Accounts appThe name must be unique within the Cloud Accounts app.description
The description of the account as it appears in the Cloud Accounts appfeatures
Leave this value blankIf you have provisioned at least one Server & Workload Protection instance, you must provide the parameters forconnectedSecurityServices
.ParameterValuename
workloadinstanceIds
The Instance ID for the Server & Workload Protection instance you want to associate with your connected AWS accountYou can find the Instance ID in the Trend Vision One console by going to .Important
You can only associate one Server & Workload Protection instance with an AWS account connection. - Call the Add Account API.
The Cloud Accounts app connects to your AWS account. You can verify the connection in the Cloud Accounts app, or by calling the Get Connected Accounts API. - Access the API from the Automation Center, or copy the
following code to customize.