AWS
Trustle reads IAM users, groups, roles, and policies, Identity Center users, groups, permission sets, and account assignments, Organizations accounts, AgentCore agents, and CloudTrail events from AWS. Trustle can add and remove group members, assign and remove permission sets and policies, create, suspend, and delete users, grant IAM roles, and let AgentCore agents sign in to Trustle.
Prerequisites
Section titled “Prerequisites”- An AWS account with permission to create IAM roles and policies. If you use AWS Organizations, use the management account. Only the management account can read the Organizations and Identity Center data.
- The region where AWS IAM Identity Center runs, if you use Identity Center.
- An identity provider connected in Trustle, for example Okta or Microsoft Entra ID. Trustle hides Cloud Providers until one is connected.
Trustle never receives an access key. Trustle assumes a role in your account and gets temporary credentials that expire after 1 hour.
Configure AWS
Section titled “Configure AWS”Step 1: Get the values from Trustle
Section titled “Step 1: Get the values from Trustle”- In Trustle, go to Connections.
- Under Cloud Providers, find AWS and click Connect.
- Trustle shows Your Configuration Values.
- Copy each value. Keep this Trustle tab open. You return to it in Connect in Trustle.
| Value from Trustle | Where it goes in AWS |
|---|---|
| External ID | The trust policy in Step 3, <EXTERNAL_ID> |
| Trustle Bridge Role ARN | The trust policy in Step 3, <TRUSTLE_BRIDGE_ROLE_ARN> |
Step 2: Create the permissions policy
Section titled “Step 2: Create the permissions policy”-
In the IAM console, go to Policies. Click Create policy.
-
Select the JSON tab. Replace the default policy with this policy:
{"Version": "2012-10-17","Statement": [{"Sid": "TrustleReadAccess","Effect": "Allow","Action": ["bedrock-agentcore:GetAgentRuntime","bedrock-agentcore:ListAgentRuntimes","bedrock-agentcore:ListWorkloadIdentities","cloudtrail:LookupEvents","iam:GetAccessKeyLastUsed","iam:GetGroup","iam:GetGroupPolicy","iam:GetLoginProfile","iam:GetOutboundWebIdentityFederationInfo","iam:GetPolicy","iam:GetPolicyVersion","iam:GetUser","iam:GetUserPolicy","iam:ListAccessKeys","iam:ListAccountAliases","iam:ListAttachedGroupPolicies","iam:ListAttachedUserPolicies","iam:ListGroupPolicies","iam:ListGroups","iam:ListGroupsForUser","iam:ListMFADevices","iam:ListPolicies","iam:ListPolicyVersions","iam:ListRoles","iam:ListSSHPublicKeys","iam:ListServiceSpecificCredentials","iam:ListSigningCertificates","iam:ListUserPolicies","iam:ListUsers","identitystore:DescribeGroup","identitystore:DescribeGroupMembership","identitystore:DescribeUser","identitystore:GetGroupId","identitystore:GetGroupMembershipId","identitystore:GetUserId","identitystore:IsMemberInGroups","identitystore:ListGroupMemberships","identitystore:ListGroupMembershipsForMember","identitystore:ListGroups","identitystore:ListUsers","organizations:DescribeAccount","organizations:DescribeOrganization","organizations:ListAccounts","organizations:ListAccountsForParent","organizations:ListOrganizationalUnitsForParent","organizations:ListRoots","sso:DescribeAccountAssignmentCreationStatus","sso:DescribeAccountAssignmentDeletionStatus","sso:DescribePermissionSet","sso:GetInlinePolicyForPermissionSet","sso:ListAccountAssignments","sso:ListAccountAssignmentsForPrincipal","sso:ListAccountsForProvisionedPermissionSet","sso:ListCustomerManagedPolicyReferencesInPermissionSet","sso:ListInstances","sso:ListManagedPoliciesInPermissionSet","sso:ListPermissionSets","sso:ListPermissionSetsProvisionedToAccount"],"Resource": "*"},{"Sid": "TrustleProvisionAccess","Effect": "Allow","Action": ["iam:AddUserToGroup","iam:AttachUserPolicy","iam:CreateUser","iam:DeactivateMFADevice","iam:DeleteAccessKey","iam:DeleteLoginProfile","iam:DeleteSSHPublicKey","iam:DeleteServiceSpecificCredential","iam:DeleteSigningCertificate","iam:DeleteUser","iam:DeleteUserPolicy","iam:DeleteVirtualMFADevice","iam:DetachUserPolicy","iam:RemoveUserFromGroup","iam:TagUser","identitystore:CreateGroup","identitystore:CreateGroupMembership","identitystore:CreateUser","identitystore:DeleteGroup","identitystore:DeleteGroupMembership","identitystore:DeleteUser","identitystore:UpdateUser","sso:CreateAccountAssignment","sso:DeleteAccountAssignment"],"Resource": "*"},{"Sid": "TrustleManagementAccountSSOProvisioning","Effect": "Allow","Action": ["iam:AttachRolePolicy","iam:CreateRole","iam:DeleteRole","iam:DeleteRolePolicy","iam:DetachRolePolicy","iam:PutRolePolicy","iam:UpdateAssumeRolePolicy","iam:UpdateRole","iam:UpdateRoleDescription"],"Resource": "arn:aws:iam::*:role/aws-reserved/sso.amazonaws.com/*"},{"Sid": "TrustleAccessToSSOProvisionedRoles","Effect": "Allow","Action": ["iam:GetRole","iam:ListAttachedRolePolicies","iam:ListRolePolicies"],"Resource": "arn:aws:iam::*:role/aws-reserved/sso.amazonaws.com/*"},{"Sid": "TrustleGrantableRoleTrust","Effect": "Allow","Action": ["iam:GetRole","iam:UpdateAssumeRolePolicy"],"Resource": "arn:aws:iam::*:role/trustle-grantable/*"},{"Sid": "TrustleAgentSignInEnable","Effect": "Allow","Action": ["iam:EnableOutboundWebIdentityFederation"],"Resource": "*"},{"Sid": "TrustleAgentTokenMintAttach","Effect": "Allow","Action": ["iam:AttachRolePolicy","iam:DetachRolePolicy"],"Resource": "arn:aws:iam::*:role/*","Condition": {"ArnLike": {"iam:PolicyARN": "arn:aws:iam::*:policy/TrustleAgentTokenMint"}}},{"Sid": "TrustleAgentSignInRoleRead","Effect": "Allow","Action": ["iam:ListAttachedRolePolicies"],"Resource": "arn:aws:iam::*:role/*"},{"Sid": "TrustleSAMLProviderAccess","Effect": "Allow","Action": ["iam:GetSAMLProvider"],"Resource": "arn:aws:iam::*:saml-provider/*"},{"Sid": "TrustleAssumeRoleInMemberAccounts","Effect": "Allow","Action": "sts:AssumeRole","Resource": "arn:aws:iam::*:role/OrganizationAccountAccessRole"}]} -
Click Next.
-
Enter the name
TrustleIntegrationPermissions. Click Create policy.
Each statement does one job:
| Permission | Required | What Trustle does with it |
|---|---|---|
TrustleReadAccess |
Yes | Imports IAM, Identity Center, and Organizations data. Reads credential metadata, such as MFA devices and access keys, to find dormant accounts. Reads CloudTrail events to find permissions that nobody uses. Verify Access uses iam:ListUsers. |
TrustleProvisionAccess |
Optional | Creates, suspends, and deletes users, changes group members, attaches and detaches user policies, and assigns permission sets. Before Trustle deletes an IAM user, it deletes the user’s keys, MFA devices, and inline policies. Without it, the connection is read-only. |
TrustleManagementAccountSSOProvisioning |
Optional | Assigns a permission set in the management account. Identity Center then creates the AWSReservedSSO_* role with the credentials of the caller. Applies only to roles under aws-reserved/sso.amazonaws.com/. |
TrustleAccessToSSOProvisionedRoles |
Optional | Reads the roles that Identity Center creates, to show the full path from a permission set to IAM. Without it, that path is incomplete. |
TrustleGrantableRoleTrust |
Optional | Grants and revokes IAM roles under the path /trustle-grantable/. See Step 5. |
TrustleAgentSignInEnable |
Optional | Turns on outbound web identity federation when you enable an AgentCore agent. Trustle never turns it off. |
TrustleAgentTokenMintAttach |
Optional | Attaches and detaches TrustleAgentTokenMint on the execution role of an agent. The condition limits the statement to that one policy. |
TrustleAgentSignInRoleRead |
Optional | Reads which policies a role has, so an attach or detach does not fail when the policy is already in place. |
TrustleSAMLProviderAccess |
Optional | Reads the SAML provider that Identity Center creates. |
TrustleAssumeRoleInMemberAccounts |
Optional | Reads IAM data in each member account of your organization through OrganizationAccountAccessRole. AWS creates this role when it creates an account in the organization. Trustle cannot use a role with a different name. Without it, Trustle reads only the management account. |
Without Identity Center, you can delete the identitystore:* and sso:* actions and the two SSO statements. Without AWS Organizations, you can delete TrustleAssumeRoleInMemberAccounts.
AgentCore actions
Section titled “AgentCore actions”Three actions in TrustleReadAccess read your Amazon Bedrock AgentCore agents. They cannot invoke, change, or deploy an agent.
| Permission | Required | What Trustle does with it |
|---|---|---|
bedrock-agentcore:ListWorkloadIdentities |
Optional | Shows each workload identity as a principal, so an agent can hold entitlements. Without it, Trustle shows no agents. |
bedrock-agentcore:ListAgentRuntimes |
Optional | Records each agent runtime. Without it, Trustle shows no agents. |
bedrock-agentcore:GetAgentRuntime |
Optional | Reads the execution role of each runtime. Trustle keeps only the execution role ARN and the workload identity ARN. Without it, Trustle refuses role grants to agents. |
The IAM action prefix is bedrock-agentcore, not bedrock-agentcore-control. Trustle discovers agents only in the management account and only in the connection’s region.
Step 3: Create the integration role
Section titled “Step 3: Create the integration role”-
In the IAM console, go to Roles. Click Create role.
-
For Trusted entity type, select Custom trust policy.
-
Paste this trust policy. Replace
<TRUSTLE_BRIDGE_ROLE_ARN>and<EXTERNAL_ID>with the values from Step 1.{"Version": "2012-10-17","Statement": [{"Effect": "Allow","Principal": {"AWS": "<TRUSTLE_BRIDGE_ROLE_ARN>"},"Action": "sts:AssumeRole","Condition": {"StringEquals": {"sts:ExternalId": "<EXTERNAL_ID>"}}}]} -
Click Next.
-
Search for
TrustleIntegrationPermissions. Select it and click Next. -
Enter the role name
TrustleIntegration. -
For Maximum session duration, select 1 hour.
-
Click Create role.
Only Trustle’s bridge role can assume this role, and only with your External ID. The External ID stops another Trustle customer from using your role.
Step 4: Create the agent token policy (optional)
Section titled “Step 4: Create the agent token policy (optional)”Do this step only if you run agents on Amazon Bedrock AgentCore. The policy lets an agent sign in to Trustle with a token that AWS issues to it. The agent keeps no Trustle secret.
-
In the IAM console, go to Policies. Click Create policy.
-
Select the JSON tab. Paste this policy:
{"Version": "2012-10-17","Statement": [{"Sid": "TrustleAgentTokenMint","Effect": "Allow","Action": "sts:GetWebIdentityToken","Resource": "*","Condition": {"ForAllValues:StringEquals": {"sts:IdentityTokenAudience": ["https://mcp.trustle.io/mcp"]},"Null": {"sts:IdentityTokenAudience": "false"},"StringEquals": {"sts:SigningAlgorithm": "RS256"}}}]} -
Click Next.
-
Enter the name
TrustleAgentTokenMintexactly. Do not set a path. -
Click Create policy. Do not attach the policy to a role.
The Trustle wizard shows the same policy as Step 3 (only if you run agents on AWS Bedrock AgentCore): Agent Token Policy, with the audience for your Trustle environment.
When you enable an agent in Trustle, Trustle turns on outbound web identity federation for the account and attaches TrustleAgentTokenMint to the agent’s execution role. When the agent loses access, Trustle detaches the policy. Federation stays on, because other agents can use it.
You can also create the policy with the AWS CLI. Save the JSON as trustle-agent-token-mint.json, then run:
aws iam create-policy \ --policy-name "TrustleAgentTokenMint" \ --policy-document file://trustle-agent-token-mint.jsonStep 5: Make roles grantable (optional)
Section titled “Step 5: Make roles grantable (optional)”Do this step only if you want Trustle to grant IAM roles. To grant a role, Trustle adds one statement to the role’s trust policy. The statement lets the grantee call sts:AssumeRole. To revoke, Trustle removes that statement and changes no other statement. Each Trustle statement has a Sid that starts with Trustle.
The grantee is an IAM user or the execution role of an AgentCore agent. Identity Center users cannot get a role grant.
-
Create each grantable role under the IAM path
/trustle-grantable/. IAM cannot change the path of an existing role.Terminal window aws iam create-role \--role-name "ReadOnlyAudit" \--path "/trustle-grantable/" \--assume-role-policy-document file://base-trust-policy.json -
Give each role a narrow base statement. A trust policy needs at least one statement, so Trustle refuses to revoke its statement when it is the last one. Use a statement that trusts one admin role, or a break-glass statement such as this one:
{"Version": "2012-10-17","Statement": [{"Sid": "BreakGlassOnly","Effect": "Allow","Principal": {"AWS": "arn:aws:iam::<account-id>:root"},"Action": "sts:AssumeRole","Condition": {"StringEquals": {"aws:PrincipalTag/trustle-grantable-break-glass": "true"}}}]} -
For a role in a member account, make sure
OrganizationAccountAccessRolein that account allowsiam:GetRoleandiam:UpdateAssumeRolePolicyon the role. -
For a grantee in a different account from the role, attach a policy to the grantee that allows
sts:AssumeRoleon the role. Trustle does not add this policy.
Trustle can change the trust policy of every role under /trustle-grantable/. Put only roles that Trustle may grant there.
Step 6: Collect the values for Trustle
Section titled “Step 6: Collect the values for Trustle”| Trustle field | Where to find it in AWS | Example |
|---|---|---|
| AWS Account ID | The account menu in the upper-right corner of the console, or aws sts get-caller-identity --query Account --output text |
123456789012 |
| IAM Role ARN | IAM → Roles → TrustleIntegration → ARN |
arn:aws:iam::123456789012:role/TrustleIntegration |
| Region | The region of IAM Identity Center. Without Identity Center, your main region. | us-east-1 |
Connect in Trustle
Section titled “Connect in Trustle”- Return to the Trustle tab from Step 1. Click Continue.
- Enter the values from Step 6. Trustle fills in IAM Role ARN from the account ID. Change it if your role has a different name.
- Click Verify Access.
- After the check passes, click Create Connection. Trustle names the connection
AWS Account <account-id>.
To let an AgentCore agent sign in to Trustle, enable the agent in Trustle after the first sync. Trustle then makes the changes that Step 4 describes. If one change fails, Trustle does not enable the agent and shows the cause.
Update an existing connection
Section titled “Update an existing connection”A connection that is older than the agent sign-in and role grant statements does not have them. The AWS connection page shows Trustle Can Set Up Agents with Yes or No. When the value is No, a banner lists the statements to add and the policy to create.
- Add the missing statements from Step 2 to
TrustleIntegrationPermissions. - If you run AgentCore agents, do Step 4.
- On the connection page, click Check Again.
You do not need to connect the account again. The next sync uses the new permissions.
Verify
Section titled “Verify”- On the Connections page, open the AWS connection.
- Wait for the first sync to finish.
- Check that the user count matches the IAM users plus the Identity Center users in AWS.
- If you use AWS Organizations, check that Trustle shows your member accounts.
- If you run AgentCore agents, check that they show as principals.
To check the role from the AWS CLI:
aws iam get-role --role-name "TrustleIntegration"aws iam list-attached-role-policies --role-name "TrustleIntegration"aws iam get-policy --policy-arn "arn:aws:iam::<account-id>:policy/TrustleAgentTokenMint"The last command applies only to AgentCore. Before you enable an agent, the policy has zero attachments.
If something is missing, see Troubleshooting.
Security notes
Section titled “Security notes”Troubleshooting
Section titled “Troubleshooting”Verify Access fails
Section titled “Verify Access fails”- Trust policy: the
Principalmust be the Trustle Bridge Role ARN, andsts:ExternalIdmust be the External ID from Step 1. - IAM Role ARN: it must contain the same 12-digit ID as AWS Account ID.
- Permissions policy:
TrustleIntegrationPermissionsmust be attached to the role. The check callsiam:ListUsers.
Verify Access passes, but Identity Center users are missing
Section titled “Verify Access passes, but Identity Center users are missing”- Region: it must be the region of IAM Identity Center. Trustle looks for Identity Center only in that region. If it finds none, it skips Identity Center without an error.
- Account: create the role in the management account.
- Permissions: the policy needs the
identitystore:*andsso:*actions from Step 2.
Member accounts or Organizations data are missing
Section titled “Member accounts or Organizations data are missing”- Create the role in the management account, not in a member account.
- Keep the
TrustleAssumeRoleInMemberAccountsstatement. - Make sure
OrganizationAccountAccessRoleexists in each member account and trusts the management account. AWS does not create it in an account that you invite to the organization.
Usage data is missing for some regions
Section titled “Usage data is missing for some regions”Trustle reads CloudTrail events only in the connection’s region, for the last 30 days. A permission that someone uses only in another region shows as unused.
No AgentCore agents show
Section titled “No AgentCore agents show”- The policy needs
bedrock-agentcore:ListWorkloadIdentitiesandbedrock-agentcore:ListAgentRuntimes. - The agents must run in the management account, in the connection’s region.
Trustle shows the agents after the next sync.
The connection page says “Trustle Cannot Set Up AWS Agents Yet”
Section titled “The connection page says “Trustle Cannot Set Up AWS Agents Yet””The role does not have the agent sign-in statements, or TrustleAgentTokenMint does not exist. Add what the banner shows. Then click Check Again. See Update an existing connection.
Trustle cannot enable an agent
Section titled “Trustle cannot enable an agent”Trustle shows the cause. Check that:
- A policy named exactly
TrustleAgentTokenMintexists, with no path. - The role has the
TrustleAgentSignInEnable,TrustleAgentTokenMintAttach, andTrustleAgentSignInRoleReadstatements. - The agent has its own execution role, not
TrustleIntegration.
Trustle cannot suspend or create an Identity Center user
Section titled “Trustle cannot suspend or create an Identity Center user”- Add
identitystore:UpdateUserandidentitystore:CreateUserfrom Step 2. - Trustle cannot suspend a user that SCIM provisions from your identity provider. Suspend the user in the identity provider.
Trustle refuses a role grant
Section titled “Trustle refuses a role grant”- The role must be under the IAM path
/trustle-grantable/. - For a grant to an agent, the policy needs
bedrock-agentcore:GetAgentRuntime. - For a role in a member account,
OrganizationAccountAccessRolemust allowiam:GetRoleandiam:UpdateAssumeRolePolicyon the role.
A grantee cannot assume a role in a different account
Section titled “A grantee cannot assume a role in a different account”Attach a policy to the grantee that allows sts:AssumeRole on the role. See Step 5.
Trustle refuses to revoke a role grant
Section titled “Trustle refuses to revoke a role grant”The Trustle statement is the last statement in the trust policy. Add a narrow base statement, as Step 5 describes. Then revoke again.
None of these fixes work
Section titled “None of these fixes work”Email support@trustle.com. Include the error message, the connection name, and the AWS Account ID and the IAM Role ARN. Never send a secret, key, or token.